martinayotte wrote:In your URL request, we see "Host: 192.168.0.230\n\r\n\r\n\r", it should be "Host: 192.168.0.230\r\n\r\n"
Also, about length, "\r\n" is count as 2 characters, and it can't be transmitted as is thru a serial monitor such putty, except if transmitted as Ctrl-M/Ctrl-J, otherwise it need to be sent from the arduino sketches, of python scripts.
Thanks Martin, that clears up the mystery & explains why when I check the length of a string I get an unexpected length & why it is has allways been an even number less.
Length check code:
// checks the length of a string (Arduino IDE 1.6.5)
void setup() {
Serial.begin(115200); // starts serial monitor
delay(10);
String postStr = ("GET /datasources/20/addvalue?value=1 HTTP/1.0\r\nHost: 192.168.0.230\r\n\r\n"); //<-string to check length of
Serial.println();
Serial.print(postStr);
Serial.print("String length = ");
Serial.print(postStr.length());
}
void loop() {
// No loop needed.
Serial responce to the above:
GET /datasources/20/addvalue?value=1 HTTP/1.0
Host: 192.168.0.230
String length = 70