Many IoT projects collect data from a sensor and send the data to ThingSpeak at the same time over and over. To continuously collect and send data to the cloud requires the device to be powered and connected all of the time. A battery-powered IoT device like a Particle Photon or Onion Omega2 would run out of power quickly. There are many IoT applications where you want your IoT device to collect the data offline over a long period of time, then send the data all at once to ThingSpeak for analysis.
The ThingSpeak team at MathWorks is excited to announce Bulk-Update! This new ThingSpeak feature is targeted at IoT devices trying to optimize battery use by allowing the device to update a lot of data at once. To help you get started with bulk-update, we have written examples for Arduino, ESP8266, Particle Photon, and the Raspberry Pi 3.
Once your data is on ThingSpeak, it is easy to analyze using the MATLAB Analysis and Visualization apps within ThingSpeak, MATLAB Online, or Desktop MATLAB. To read data from ThingSpeak into MATLAB, use the ThingSpeak Support Toolbox and the thingSpeakRead command. We have released documentation and examples to help you get started with bulk-update on ThingSpeak.
Resources for Bulk-Update
- ThingSpeak Documentation for Bulk-Update
- Continuously Collect Data and Bulk-Update a ThingSpeak Channel Using an Arduino MKR1000 Board or an ESP8266 Board
- Continuously Collect Data and Bulk-Update a ThingSpeak Channel Using a Particle Photon Board
- Continuously Collect Data and Bulk-Update a ThingSpeak Channel Using a Raspberry Pi Board
- MATLAB thingSpeakRead Documentation
- ThingSpeak Support Toolbox for MATLAB
- MATLAB Online
3 CommentsOldest to Newest
I am trying to implement this bulk transfer from the Particle Electron. I have tried directly copying the example code for the photon, but in the “Response code” published I reliably get either a 1, 0, or 500, and my ThingSpeak channel is not updated.
I have also attempted using the webhook method recommended by Particle, but although I have done my best to format the JSON file in the publish as it is in the documentation, there is usually a 401 (invalid API key or channel mismatch), but the API key I have put into the json and the channel number in the url are both correct.
Can anyone advise me on implementing this bulk transfer method for an Electron? My project needs to be as low-powered as possible, and the methods in the particle documentation are insufficient as there does not appear to be any other way of ensuring that published data points are associated with their own particular timestamp rather than the timestamp of the publish.
I recently re-verified the example code for bulk posting with a particle photon (https://www.mathworks.com/help/thingspeak/bulk-update-a-thingspeak-channel-using-particle-photon-board.html). The JSON formatting can sometimes be a pain. Or perhaps there is some difference with the libraries for the electron. We will look into this further.
I have taken a closer look at the issue. In your code do you have a line that looks like this?
Make sure “time_format” has an underscore.
Let us know if that helps.