Hello Marque,
I am very happy that I found your project. I am working at my own project and have some problems. First I want to suggest my project.
I use an arduino mega to read out some sensors. The values I want to send to my android phone. I tried to use and adapt another project working with the same WifiShield(RedFly WifiShield) (you can find this project here:
http://android-arduino-redfly.npage.de/) but there I got the problem that i only can send small values(0...255). For my project I need to send bigger values.
Because I am using the RedFly WifiShield to connect to the LAN I have to use other libraries in my sketch so that I can't copy your code. I tried to get your code working with my WifiShield but there are some problems I don't understand.
I attached my code named ARDUINO_CONTROLLER.ino because when I post it the post exceeds the maximum allowed length(9500 characters).
Errorlog:
ARDUINO_CONTROLLER:17: error: 'RedFlyServer' does not name a type
ARDUINO_CONTROLLER.ino: In function 'void checkclient()':
ARDUINO_CONTROLLER:78: error: 'server' was not declared in this scope
ARDUINO_CONTROLLER:86: error: 'sentheader' was not declared in this scope
ARDUINO_CONTROLLER:137: error: 'action' was not declared in this scope
ARDUINO_CONTROLLER:154: error: 'action' was not declared in this scope
ARDUINO_CONTROLLER.ino: In function 'void action(int, RedFlyClient (*)())':
ARDUINO_CONTROLLER:176: error: request for member 'print' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:177: error: request for member 'println' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:182: error: request for member 'print' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:183: error: request for member 'println' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:188: error: request for member 'print' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:189: error: request for member 'println' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:194: error: request for member 'print' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:195: error: request for member 'println' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:200: error: request for member 'print' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:201: error: request for member 'println' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:206: error: request for member 'print' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:207: error: request for member 'println' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:212: error: request for member 'print' in 'client', which is of non-class type 'RedFlyClient (*)()'
ARDUINO_CONTROLLER:213: error: request for member 'println' in 'client', which is of non-class type 'RedFlyClient (*)()'
I am sure that the follwing code is right because it works with the other project. This setup connects the Arduino Mega with RedFly Shield to my Wifi.
void setup()
{
uint8_t ret;
//init the WiFi module on the shield
ret = RedFly.init();
if(ret)
{
debugoutln("INIT ERR"); //there are problems with the communication between the Arduino and the RedFly
}
else
{
//scan for wireless networks (must be run before join command)
RedFly.scan();
//join network
//ret = RedFly.join("WLAN-SSID", "passwort123", INFRASTRUCTURE);
ret = RedFly.join("Connectify-arduinopc", "12345678", INFRASTRUCTURE);
if(ret)
{
debugoutln("JOIN ERR");
for(;

; //do nothing forevermore
}
else
{
//set ip config
ret = RedFly.begin(ip, 0, 0, netmask);
if(ret)
{
debugoutln("BEGIN ERR");
RedFly.disconnect();
for(;

; //do nothing forevermore
}
}
}
Serial.begin(9600); // open the serial connection at 9600bps
}
I attached the RedFly libraries. But I am sure these are the same like the normal HTTPClient library and so on. The only difference is that they are adapted to work with the RedFly Shield.
Can you help me to get your code working with my RedFly Wifi Shield?
Another option for me could be that you give me only the code I need for arduino to send something to an android phone and the code I need in the android-app to receive the data. If I understand your project right it's a normal HTTP request needed to send data. I can make HTTP Requests with my arduino and the RedFly Shield.
For Example the following code works with CouchDB.
if(client.connect(server, 5984))
{
//make a HTTP request
//client.print_P(PSTR("GET / HTTP/1.1\r\nHost: "HOSTNAME"\r\n\r\n"));
//Delte Database
//client.println_P(PSTR("DELETE /test2/ HTTP/1.0"));
//client.println_P(PSTR("Content-Type: application/json\r\n"));
//Create Database
//client.println_P(PSTR("PUT /test9/ HTTP/1.0"));
//client.println_P(PSTR("Content-Type: application/json\r\n"));
//Put a document to the database THIS DOESN'T WORK
/*client.println_P(PSTR("POST /test1/ HTTP/1.0"));
client.println_P(PSTR("Content-Type: application/json\r\n"));
client.println_P(PSTR("{"));
client.println_P(PSTR("\"Subject\":\"I like Plankton\","));
client.println_P(PSTR("\"Author\":\"Rusty\","));
client.println_P(PSTR("\"PostedDate\":\"2006-08-15T17:30:12-04:00\","));
client.println_P(PSTR("\"Tags\":[\"plankton\", \"baseball\", \"decisions\"],"));
client.println_P(PSTR("\"Body\":\"I decided today that I don't like baseball. I like plankton.\""));
client.println_P(PSTR("}"));
*/
}
Thank you in advance!