9:51 pm

July 16, 2015

Hello everyone.
Like many people I've made a distributed sensor network via XB Series 2 modules, sending back to a central base unit Arduino, and now want to send this data to Thingspeak.
The base station Arduino has an XBee Wifi module running through SoftwareSerial.
The XBee is configured with the appropriate SSID, passphrase, destination ip 184.106.153.149 for thingspeak, port 80, via XCTU.
I can't successfully post the update string suggested on the Data Import/Export tab:
https://api.thingspeak.com/update?key=xxxMY KEYxxx&field1=0
After days and hours of futile searching and different attempts, I haven't found anyone addressing this scenario. I thought this setup would be quite common. I came to believe this would be the easy bit.
I can paste that update string into the address bar of my browser, and the relevant feed updates - but nothing happens when I send the same text through the XBee Wifi.
What is the format for the arduino code?
This is what I've tried:
WiFiSerial.print("https://api.thingspeak.com/update?key=xxxxxxxxxxx&field1=0")
WiFiSerial.print("POST https://api.thingspeak.com/update?key=xxxxxxxxxxx&field1=0")
WiFiSerial.print("GET https://api.thingspeak.com/update?key=xxxxxxxxxxx&field1=0")
WiFiSerial.print("POST /https://api.thingspeak.com/update?key=xxxxxxxxxxx&field1=0")
WiFiSerial.print("GET /https://api.thingspeak.com/update?key=xxxxxxxxxxx&field1=0")
I'm obviously missing something fundamental.
Thanks in advance.
Andy.
8:28 am

July 16, 2015

Thanks Lee for the prompt attention.
I had already tried that, and have done so again, to no avail.
I also tried the broken down request, vis.
WiFiSerial.print("POST /update HTTP/1.1
");
WiFiSerial.print("Host: api.thingspeak.com
");
WiFiSerial.print("Connection: close
");
WiFiSerial.print("X-THINGSPEAKAPIKEY: xxxxxxxxxxxxxxx
");
WiFiSerial.print("Content-Type: application/x-www-form-urlencoded
");
WiFiSerial.print("Content-Length: ");
WiFiSerial.print(tsData.length());
WiFiSerial.print("
");
WiFiSerial.print(tsData);
Am going through the XB WiFi documentation again, looking for nuggets.
I have the module in AT transparent mode. Perhaps API will be better... Perhaps via SPI rather than serial..... I'll keep trying.
I'm still surprised by the total absence of this as a live topic anywhere. Doesn't anyone else want to get online with a WiFi XBee?
Thanks again.
Andy.
1:28 pm

October 14, 2015

Hi Campbell,
Did you succeed in posting to thingspeak via xbee? I have a similar problem. I have tried various combinations of post method but with no success.
http://api.thingspeak.com/update?key=XXXXXXXXXXX&field1=12
This works on my browser but does not work when sent through an xbee. I tried arduino codes and also serial port emulators. I see the data being sent out to be consistent, yet i keep getting the 400 bad request error. I am pretty sure that I am missing something basic here.
Could someone help me out?
Most Users Ever Online: 166
Currently Online:
25 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
rw950431: 272
Vinod: 240
piajola: 95
turgo: 70
vespapierre: 63
Adarsh_Murthy: 62
Member Stats:
Guest Posters: 1
Members: 8665
Moderators: 1
Admins: 2
Forum Stats:
Groups: 3
Forums: 14
Topics: 1600
Posts: 5760
Newest Members:
kusmumichael, petersmith99, Rambant, blakeharriss09, optisol, Niyonzima FilsModerators: cstapels: 460
Administrators: Hans: 405, lee: 457