October 17, 2018
Hello there! I need a little help in terms of logic and programming.
I have a CSV file stored on my raspberry pi 2 B+ having an Ethernet connection to ThingSpeak channel. I have written a python code, running which I am able to upload the data (a record every 15 seconds). This record contains both string and integer values. THIS IS ALL WORKING FINE. Now let's say I have around 500 rows of data and I uploaded around 200 of them in the last sitting. How can I continue/resume from row # 201 just by running the same python code again (without making any amendments). Since I want to keep it real-time, I want to run the same python code every time and the data should be APPENDED to the ThingSpeak channel starting from the last UNREAD record.
Thanks in advance!
March 7, 2017
All ThingSpeak data is time series data, so you should have no problem keeping your points in order.
What process did you use to upload the first 200 points?
If you used the MATLAB thingSpeakWrite command, you would have provided timestamps. If you want the new data to be in chronological order, just provide timestamps that are in the desired order.
If you did not provide timestamps, ThingSpeak will order the points in the order that you send them.
If you used the REST API, for example, and updated one point at a time, they would have a timestamp that corresponds exactly with the time you sent them.
March 25, 2019
March 7, 2017
The easiest way will most likely be using the bulk write API.
You will have to write python code to convert your csv file to the appropriate format.
There are definitely HTTP libraries available for posting from Rpi. For example urllib and urllib2. (Google POST Rpi HTTP)
Since you are already reformatiing the data, you may also want to consider JSON format:
Most Users Ever Online: 166
Currently Browsing this Page:
Guest Posters: 1
Newest Members:Matthewdupreez1, sbhunu, pabcstar, johnhutcheson1, madhuhada, dayne
Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457