Thingspeak with two devices
Moderators: grovkillen, Stuntteam, TD-er
Thingspeak with two devices
Hi,
I have just recently switched to ESPeasy and I have upgraded my working hardware :
1 ESP8277 07 with 1 DHT22 (temp & humidity) , 1 DHT21 (temp & humidity), 1 SHARP GP2Y10 (dust sensor) and 1 DSM501A (PM1.0 and PM2.5 dust sensor).
Previously all the data where sent to a private channel on thingspeak server and everything worked fine.
Now, switching to ESPeasy, I find that , already with two sensors redaing, only the data from first are correctly uploaded.
Afters some testing, I found out that the way ESPeasy works is to open a connection with the server for each sensor.
In this way the second sensor data are send too soon to the thingspeak server, which discardes them (this is a limit set on the server).
Does anybody knows a way to avoid this: either inserting a 20 sec delay between different sensor updates, or doing all the updates with a single connection?
many thanks
I have just recently switched to ESPeasy and I have upgraded my working hardware :
1 ESP8277 07 with 1 DHT22 (temp & humidity) , 1 DHT21 (temp & humidity), 1 SHARP GP2Y10 (dust sensor) and 1 DSM501A (PM1.0 and PM2.5 dust sensor).
Previously all the data where sent to a private channel on thingspeak server and everything worked fine.
Now, switching to ESPeasy, I find that , already with two sensors redaing, only the data from first are correctly uploaded.
Afters some testing, I found out that the way ESPeasy works is to open a connection with the server for each sensor.
In this way the second sensor data are send too soon to the thingspeak server, which discardes them (this is a limit set on the server).
Does anybody knows a way to avoid this: either inserting a 20 sec delay between different sensor updates, or doing all the updates with a single connection?
many thanks
Re: Thingspeak with two devices
It's been a while since we build that controller code, but I can remember that we set a 15000 mSec delay in tools/advanced/Message Delay.
Could work in your case.
Could work in your case.
Re: Thingspeak with two devices
Hi,
First I have problem with delay, I just need to change time of delay. I have DHT22 sensor and how to read humidity!? On thingspeak I have only temp readings, one graph. Is it even possible to have readings for temperature and humidity on thingspeak!?
Thanks
First I have problem with delay, I just need to change time of delay. I have DHT22 sensor and how to read humidity!? On thingspeak I have only temp readings, one graph. Is it even possible to have readings for temperature and humidity on thingspeak!?
Thanks
Re: Thingspeak with two devices
I've been having problems with thingspeak too; sensors that report 2 fields work ok because that is sent in one message, but all subsequent messages are sent too quickly for thingspeak. To prove this, i added a 15sec delay to the end of the thingspeak publishing routine, and now all sensors are working. This is not however the solution. The way esp easy publishes values makes it very difficult to publish everything in one message. Looks like thingspeak is only good for publishing one sensor per esp.
Re: Thingspeak with two devices
Using ThingSpeak, you have to use sensor delays that are larger than the combined number of tasks x 15 seconds.
I'd recommend tasks x 30 seconds.
I'm running a testlab setup with 3 tasks, with a sensor delay of 90 seconds.
Message delay set to 15000
Seems to run without issues, system load is between 10-20%
I'd recommend tasks x 30 seconds.
I'm running a testlab setup with 3 tasks, with a sensor delay of 90 seconds.
Message delay set to 15000
Seems to run without issues, system load is between 10-20%
Re: Thingspeak with two devices
Sorry it took me so long to see this.frey wrote:I've been having problems with thingspeak too; sensors that report 2 fields work ok because that is sent in one message, but all subsequent messages are sent too quickly for thingspeak. To prove this, i added a 15sec delay to the end of the thingspeak publishing routine, and now all sensors are working. This is not however the solution. The way esp easy publishes values makes it very difficult to publish everything in one message. Looks like thingspeak is only good for publishing one sensor per esp.
See http://www.esp8266.nu/forum/viewtopic.php?f=4&t=1175 for a full discussion of how to interface w/ ThinkSpeak, including how to show more than one reading for a sensor.
-
- Normal user
- Posts: 25
- Joined: 29 Apr 2016, 06:54
Re: Thingspeak with two devices
I am trying to use two sensors: DHT22 and a DS18B20. I have them working, however the values are sent at different times to Thingspeak. How do I get them to sync to stop all of the null entries in my data?
Re: Thingspeak with two devices
I don't believe you can. ThingSpeak requires a 15 second message delay, so that pretty much guarantees you cannot sync them up.
-
- Normal user
- Posts: 25
- Joined: 29 Apr 2016, 06:54
Re: Thingspeak with two devices
Right, but there isn't a way to make the firmware send all the data at once?andy wrote:I don't believe you can. ThingSpeak requires a 15 second message delay, so that pretty much guarantees you cannot sync them up.
Re: Thingspeak with two devices
Hi Everyone,
Seems like this discussion topic is quite old, but the problem mentioned in this post still persists. If you don't mind I would like to breath life into it once again
I came across ESPEasy and was quite amazed with the flexibility of controllers and plugins, particularly its support for Thingspeak. I have some experience with coding on ESP to transmit data to Thingspeak. But in my case, I used to transmit data in batches, i.e. collect data for all fields in one request and transmit it.
ESPEasy's Thingspeak controller seems to be lacking in this area. Though as mentioned above, setting message delay to 15000ms can solve this issue of transmitting values from multiple sensors, but I find it to be very inefficient.
I am currently working on a modified controller for thingspeak which will allow accumulation of values from all sensors before publishing it to thingspeak. Hopefully this can be accomplished with changes to the plugin file and will not require any changes to core firmware.
My basic strategy would be (modified):
1) Have a list of 8 empty variables (for 8 allowable fields on thingspeak), referred to as buffer
2) Every time a request is received to publish values to thingspeak,
a) The plugin will store (overwrites if already there) the values in the list according to the sensor's idx (only for values corresponding to 8 fields in Thingspeak)
b) And check if the 15s (minimum thingspeak write time) has elapsed
3) If the 15s time has elapsed then all values in the buffer are transmitted to the thingspeak server, and buffer is emptied.
4) If no data is available in buffer then publish request is not sent.
This update eliminates the problem with multiple sensors publishing in 15s time period, resulting in only one publish being successful and others ignored. With this update, any new sensor values received within 15s of last publish will be stored in buffer and will be sent when next time the plugin is called and 15s have elapsed.
Please feel free to provide your suggestions and feedback for this proposed solution.
Update:
Updated Thingspeak plugin pull request on ESPEasy Playground can be found at following link:
https://github.com/letscontrolit/ESPEas ... nd/pull/24
Alternatively, you can download Thingspeak Controller Plugin (_C004.ino) directly from my fork of the playgound project.
https://github.com/omair-suria/ESPEasyPluginPlayground
I have also attached the zip file containing this plugin file Download it and replace the original thingspeak plugin (_C004.ino) with this one, compile, upload and Enjoy!!
Seems like this discussion topic is quite old, but the problem mentioned in this post still persists. If you don't mind I would like to breath life into it once again
I came across ESPEasy and was quite amazed with the flexibility of controllers and plugins, particularly its support for Thingspeak. I have some experience with coding on ESP to transmit data to Thingspeak. But in my case, I used to transmit data in batches, i.e. collect data for all fields in one request and transmit it.
ESPEasy's Thingspeak controller seems to be lacking in this area. Though as mentioned above, setting message delay to 15000ms can solve this issue of transmitting values from multiple sensors, but I find it to be very inefficient.
I am currently working on a modified controller for thingspeak which will allow accumulation of values from all sensors before publishing it to thingspeak. Hopefully this can be accomplished with changes to the plugin file and will not require any changes to core firmware.
My basic strategy would be (modified):
1) Have a list of 8 empty variables (for 8 allowable fields on thingspeak), referred to as buffer
2) Every time a request is received to publish values to thingspeak,
a) The plugin will store (overwrites if already there) the values in the list according to the sensor's idx (only for values corresponding to 8 fields in Thingspeak)
b) And check if the 15s (minimum thingspeak write time) has elapsed
3) If the 15s time has elapsed then all values in the buffer are transmitted to the thingspeak server, and buffer is emptied.
4) If no data is available in buffer then publish request is not sent.
This update eliminates the problem with multiple sensors publishing in 15s time period, resulting in only one publish being successful and others ignored. With this update, any new sensor values received within 15s of last publish will be stored in buffer and will be sent when next time the plugin is called and 15s have elapsed.
Please feel free to provide your suggestions and feedback for this proposed solution.
Update:
Updated Thingspeak plugin pull request on ESPEasy Playground can be found at following link:
https://github.com/letscontrolit/ESPEas ... nd/pull/24
Alternatively, you can download Thingspeak Controller Plugin (_C004.ino) directly from my fork of the playgound project.
https://github.com/omair-suria/ESPEasyPluginPlayground
I have also attached the zip file containing this plugin file Download it and replace the original thingspeak plugin (_C004.ino) with this one, compile, upload and Enjoy!!
Who is online
Users browsing this forum: No registered users and 92 guests