Hi i have been trying to send data from my arduino to my ASP.Net website and have been successful until i try to send a timestamp as a variable in the GET request. I have think it has somthing to do with the forward slash that separates the values but when i send a diffrent symbol like a "-" i get the same result (no data saved)
EDIT: sorry its not the forward slash! it is because asp.net expects: 01/01/01 01:01:01 and am sending 1/1/1 1:1:1. so i need to figure out how send it with the zero in front if needed
my code so far (the sending part)
void sendLightData() {
DateTime now = rtc.now();
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip);
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
client.print("GET /LightData.aspx?uname=");
client.print(userName);
client.print("&pword=");
client.print(password);
client.print("&LStatus=");
client.print(lightStatus);
client.print("&LHeight=9&");
client.print("timestamp=");
client.print(now.day(), DEC);
client.print("/");
client.print(now.month(), DEC);
client.print("/");
client.print(now.year(), DEC);
client.print("%20");
client.print(now.hour(), DEC);
client.print(":");
client.print(now.minute(), DEC);
client.print(":");
client.print(now.second(), DEC);
client.println(" HTTP/1.1");
client.println("Host: www.auntieagie.eu");
client.println("Connection: close");
client.println();
// this works if entered into a browser (trying to replicate in arduino) http://auntieagie.eu/LightData.aspx?uname=test&pword=t&LStatus=1&LHeight=2×tamp=21/02/2014%2001:01:01
}
any help or a point in the right direction would be great