EXTREMELY URGENT: help with wifly shield

Im really hoping someone can help me here - I am due to show a piece of work at a museum opening tomorrow and my installation has stopped working!

Im using the original version of the wifly shield from sparkfun to connect to a local server. The piece has been working perfectly for a number of years, but recently I had to transfer everything server side onto a new machine with a new ip address - this should be easy to handle with the arduino!

However the code was written pre-arduino 1 and some of the libraries/syntax are no longer supported.

Ive tried downloading old IDEs and also to update the code to the new arduino 1.0.4 im running but I cant get any success

Please help!

Here is the original code:

#include <NewSoftSerial.h>


// (Based on Ethernet's WebClient Example)

#include "WiFly.h"


#include "Credentials.h"

#define rxPin 6
#define txPin 7

NewSoftSerial printer = NewSoftSerial(rxPin, txPin);

const byte command = 0x1B;
const byte fullcut = 0x69;

byte server[] = {
  192,168,0,10 }; // Google

//Client client(server, 80);

Client client("192.168.0.10", 80);


int pot = A1;
int searchButton = 2;
int potVal = 0;
int buttonVal = 0;
String web;
char c;
int index = 0;

void setup() {

  pinMode(pot, INPUT);
  pinMode(searchButton, INPUT);
  pinMode(12, OUTPUT);

  printer.begin(9600);

  Serial.begin(9600);

  WiFly.begin();

  if (!WiFly.join(ssid, passphrase)) {
    Serial.println("Association failed.");
    while (1) {
      // Hang on failure.
    }
  }  
}


void printOnPrinter(char text[]) {
  printer.print(text);
}


void feed() {
  printer.println("");
  printer.println("");
  printer.println("");
}


void cut() {
  printer.print(command, BYTE);
  printer.print(fullcut, BYTE);
}


void loop() {
  buttonVal = digitalRead(searchButton);
  if(buttonVal == 1){

    digitalWrite(12, HIGH);
    delay(3000);
    digitalWrite(12, LOW);

    int potVal = analogRead(pot);
    potVal = map(potVal, 0, 950, 1, 5);
    Serial.println(potVal);

    if(potVal==1) {
      web = "GET /nameTest1.php HTTP/1.0";
    }

    if(potVal==2) {
      web = "GET /nameTest2.php HTTP/1.0";
    }

    if(potVal==3) {
      web = "GET /nameTest3.php HTTP/1.0";
    }

    if(potVal==4) {
      web = "GET /nameTest4.php HTTP/1.0";
    }

    if(potVal==5) {
      web = "GET /nameTest5.php HTTP/1.0";
    }


    Serial.println("connecting...");

    if (client.connect()) {
      Serial.println("connected");
      client.println(web);
      client.println();
    } 
    else {
      Serial.println("connection failed");
    }


    do{
      char c = client.read();
      if(c == '

And here Ive tried to modernise it without any joy:

#include <SoftwareSerial.h>

//#include <NewSoftSerial.h>


// (Based on Ethernet's WebClient Example)

#include "WiFly.h"


#include "Credentials.h"

#define rxPin 6
#define txPin 7

SoftwareSerial printer = SoftwareSerial(rxPin, txPin);

const byte command = 0x1B;
const byte fullcut = 0x69;

byte server[] = {
  192,168,0,10 }; // Google

//Client client(server, 80);

Client client("192.168.0.10", 80);


int pot = A1;
int searchButton = 2;
int potVal = 0;
int buttonVal = 0;
String web;
char c;
int index = 0;

void setup() {

  pinMode(pot, INPUT);
  pinMode(searchButton, INPUT);
  pinMode(12, OUTPUT);

  printer.begin(9600);

  Serial.begin(9600);

  WiFly.begin();

  if (!WiFly.join(ssid, passphrase)) {
    Serial.println("Association failed.");
    while (1) {
      // Hang on failure.
    }
  }  
}


void printOnPrinter(char text[]) {
  printer.print(text);
}


void feed() {
  printer.println("");
  printer.println("");
  printer.println("");
}


void cut() {
  printer.print(byte (command));
  printer.print(byte (fullcut));
}


void loop() {
  buttonVal = digitalRead(searchButton);
  if(buttonVal == 1){

    digitalWrite(12, HIGH);
    delay(3000);
    digitalWrite(12, LOW);

    int potVal = analogRead(pot);
    potVal = map(potVal, 0, 950, 1, 5);
    Serial.println(potVal);

    if(potVal==1) {
      web = "GET /nameTest1.php HTTP/1.0";
    }

    if(potVal==2) {
      web = "GET /nameTest2.php HTTP/1.0";
    }

    if(potVal==3) {
      web = "GET /nameTest3.php HTTP/1.0";
    }

    if(potVal==4) {
      web = "GET /nameTest4.php HTTP/1.0";
    }

    if(potVal==5) {
      web = "GET /nameTest5.php HTTP/1.0";
    }


    Serial.println("connecting...");

    if (client.connect()) {
      Serial.println("connected");
      client.println(web);
      client.println();
    } 
    else {
      Serial.println("connection failed");
    }


    do{
      char c = client.read();
      if(c == '

){
        break;
      }
      if(index == 540){
        printer.print(c);
      }
      else{
        index++;
      }
    }

while( c != '


And here Ive tried to modernise it without any joy:

§DISCOURSE_HOISTED_CODE_1§


);


    if (client.connected()) {
      digitalWrite(12, LOW);
      Serial.println();
      Serial.println("disconnecting.");
      client.stop();
      feed();
      feed();
      cut();
      feed();
      feed();
//      feed();
      index = 0;
      //    for(;;); 
    }
  }
}

And here Ive tried to modernise it without any joy:

§_DISCOURSE_HOISTED_CODE_1_§

){
        break;
      }
      if(index == 540){
        printer.print(c);
      }
      else{
        index++;
      }
    }

while( c != '


){
        break;
      }
      if(index == 540){
        printer.print(c);
      }
      else{
        index++;
      }
    }

    while( c != '

And here Ive tried to modernise it without any joy:

§_DISCOURSE_HOISTED_CODE_1_§

);

if (client.connected()) {
      digitalWrite(12, LOW);
      Serial.println();
      Serial.println("disconnecting.");
      client.stop();
      feed();
      feed();
      cut();
      feed();
      feed();
//      feed();
      index = 0;
      //    for(;;);
    }
  }
}


And here Ive tried to modernise it without any joy:

§DISCOURSE_HOISTED_CODE_1§


);


    if (client.connected()) {
      digitalWrite(12, LOW);
      Serial.println();
      Serial.println("disconnecting.");
      client.stop();
      feed();
      feed();
      cut();
      feed();
      feed();
//      feed();
      index = 0;
      //    for(;;); 
    }
  }
}

){
        break;
      }
      if(index == 540){
        printer.print(c);
      }
      else{
        index++;
      }
    }

while( c != '


And here Ive tried to modernise it without any joy:

§DISCOURSE_HOISTED_CODE_1§


);


    if (client.connected()) {
      digitalWrite(12, LOW);
      Serial.println();
      Serial.println("disconnecting.");
      client.stop();
      feed();
      feed();
      cut();
      feed();
      feed();
//      feed();
      index = 0;
      //    for(;;); 
    }
  }
}

And here Ive tried to modernise it without any joy:

§_DISCOURSE_HOISTED_CODE_1_§

If it helps, there are two flashing LEDs on the wifly - one slow blinking green, and one rapid blinking orange. Can anyone interpret these?

Ive tried downloading old IDEs and also to update the code to the new arduino 1.0.4 im running but I cant get any success

What the heck does this mean? The code you posted does something, but you did not deem it important to tell us what.

You want it to do something, but you didn't deem it important to tell us what.

I suspect your opening is going to be a bit of a disappointment. But,I'm sure you won't tell anyone why.

@PaulS - the IDEs are arduino programming environments. They've changed and ben updated over the years, and some libraries and syntax are no longer supported in arduino 1. I originally wrote this code for version 0022, and so downloaded a retro version of the programming environment that would support it.

Unfortunately the code I posted doesnt do anything right now - the wifly fails to connect, but hangs at wifly.begin. It it meant to pull some info from a php page via the GET commands in the code, and print that info out.

Its really just the connection problem thats causing me issues - what happens when it does connect is fine.

PaddyS011:
Ive tried downloading old IDEs and also to update the code to the new arduino 1.0.4 im running but I cant get any success

The old IDE is still available, isn't it? Why not just use that?

It would also help to provide a link to the EXACT board you're trying to use, then
people wouldn't have to 2nd guess.

If you want urgent help provide as much information as you can.

How to use this forum

Making people guess, ask questions, to-and-fro, is hardly helping get you a quick answer.

... but I cant get any success ...

In what way, for example? Can't find the download? Doesn't compile? If not, what error message?