I've tried your &data[44] thing (I just started at byte 100 instead), but it doesn't work!
/*
* A simple sketch that uses WiServer to serve a web page
*/
#include <WiServer.h>
#include <LCD4Bit.h>
//create object to control an LCD.
//number of lines in display=2
LCD4Bit lcd = LCD4Bit(2);
#define WIRELESS_MODE_INFRA 1
#define WIRELESS_MODE_ADHOC 2
// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,2,124}; // IP address of WiShield
unsigned char gateway_ip[] = {192,168,2,254}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"PRJWLAN"}; // max 32 bytes
unsigned char security_type = 2; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"MatheV_home"}; // max 64 characters
// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, // Key 0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3
};
// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;
unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------
char* message;
boolean dataReady = false;
int currentHour = 1;
//POST request settings
// IP Address for www.tkjweb.dk
uint8 ip[] = {188,40,48,208};
// Create a POST request that sends an email
POSTrequest getTable(ip, 80, "www.tkjweb.dk", "/skoleskema.php", tableInput);
// This function generates the body of our POST request
void tableInput() {
WiServer.print("wt=false&hour=");
WiServer.print(currentHour);
}
void processData(char* data, int len) {
message = &data[100];
dataReady = true;
}
void setup() {
// Initialize WiServer and disable the Webpage Serving Feature
WiServer.init(NULL);
// Enable Serial output and ask WiServer to generate log messages (optional)
Serial.begin(9600);
WiServer.enableVerboseMode(true);
//POST request setup
getTable.setReturnFunc(processData);
currentHour = 1;
getTable.submit();
while (dataReady == false) {
// Run WiServer
WiServer.server_task();
delay(10);
}
Serial.print("Message: ");
Serial.println(message);
}
void loop() {
// Run WiServer
WiServer.server_task();
delay(10);
}