I guess I am the first one to post a question about the use of ThingSpeak with an Arduino. I hope there is someone that has some prior experience, since I am running into a few issues after using the tutorial to modify my existing code.
I have added the code almost exactly as per the tutorial on this website, obviously I modified the data to be sent to ThingSpeak. I also added some Serial.println here and there to see what part of the code is being executed and I get so far that in the Serial monitor of the Arduino IDE (using v0022 on Ubuntu 10.10) I see the message "Connected to ThingSpeak..." which happens at the beginning of the updateThingSpeak(), and I also see "Data sent to ThingSpeak...", which I added at the very last line of updateThingSpeak() in the part where the connection is succesful, otherwise a "Connection failed" would have been shown.
I would expect that means that the arduino sent sensor data to my ThingSpeak channel, but unfortunately, I do not see anything popping up in my web interface when I try to make charts.
This could be:
a) I am doing something wrong (very likely 😉 )
b) the data is indeed received, but not (yet?) available to make charts
c) Arduino does connect, but something is wrong in the communication
I noticed that I never had to fill in my feed id anywhere, but I guess that information is locked in the writeApiKey, right?
Anyone got a clue how to debug this?
p.s. the service seems awesome, hope I can get it to work soon!
Thanks for the kind comments. Now, let's hope we can get your Arduino sketch working.
The tutorial was written with Arduino 22 on Windows. Now sure if that makes a difference...
The Channel ID is encoded in the Write API Key, that way a private channel can stay private.
If everything goes to plan the data should be available right away in your feed and charts. Caching only kicks in when you return more than 100 results.
Can you ping the Arduino's IP address? Atleast so we can verify connectivity and cross that off of the list.
Well, what can I say, it works!
See this channel: https://www.thingspeak.com/channels/157
But, the data you are seeing there is testdata and does not contain real sensor data yet. Somehow, I can't seem to build a proper string to send to ThingSpeak. I receive the data as comma separated values (i.e. 10.00,666,123,1,0,10). And the comma's should be replaced by "field1=", "&field2=", "&field3=", etc.
I have managed to send this same data to my own webserver and a Pachube feed (http://www.pachube.com/feeds/11261), so I have some homework to do...
Any hints appreciated 😉
If you are going to send sensor data, all you have to do is send the fields in any order using the keys.
10.00,666,123,1,0,10 => field1=10.00&field2=666&field3=123&field4=1&field5=0&field6=10
You can pass the key as an X-header or as a another parameter.
… &key=[write api key]
Make sure content type is:
Otherwise, without seeing your code, I am not sure what is breaking down. Can you post some where? I can then get to the bottom of it.
Thanks for the reply. I understand what needs to happen and the code works fine, except my string-manipulation-skills (or lack thereof) have not been able to come up with a solid solution to replace the comma's into "field1=", then "&field2=", etc.
I'd love to share the code, however I am nowhere near the code now, so will have to that some time later...
Most Users Ever Online: 114
Currently Browsing this Page:
Guest Posters: 1
Administrators: Hans, lee