Page 1 of 1

EspEasy sends data to Thingspeak in odd time intervals

Posted: 05 Jun 2019, 13:59
by scaevola
Hello,
I have a problem with the ESP Easy mega configuration. I have three sensors DS18b20, two connected via a p2p network. The values of all 3 are copied to the dummy device every minute.
Then I try to send data to the thingspeak server, but the server usually does not get it. Sometimes, once every 2-3 hours, he gets only one value (why not all three?)
I suspect that this may be related to the server limitations so that you do not upload more often than every 15 seconds. But my Thingspeak controller is set to 120000ms, similarly in tools / advanced I have typed 120000ms. I do not know why this is happening, after all, time limits are not exceeded?
My version of espeasy:
mega-20181027.
The dummy device sends data to controll every 2 minutes.

I try to fight this since yesterday and don't know what is going on.

Re: EspEasy sends data to Thingspeak in odd time intervals

Posted: 05 Jun 2019, 14:44
by grovkillen
You need to upload them in one go, I suspect you try to upload them one after each other. That means that you need to upload each value with a minimum delay of 15 seconds in-between.

Easiest way would probably be to use rules and upload them as one message (instead of three add you do now).

Re: EspEasy sends data to Thingspeak in odd time intervals

Posted: 05 Jun 2019, 14:46
by grovkillen
OR change the advanced settings to 100ms and instead use the interval inside the dummy task.

Re: EspEasy sends data to Thingspeak in odd time intervals

Posted: 05 Jun 2019, 15:20
by scaevola
Hmm, ok,
I turned off the thingspeak inbuilt controller and added to rules:

Code: Select all

On Clock#Time do // this event comes in every minute
  TaskValueSet 2,3,[Temperatura_CO#Temperatura_CO]
SendToHTTP api.thingspeak.com,80,/update?key=blahblah&field1=[Wrapitup#Temperatura_wewnetrzna]&field2=[Wrapitup#Temperatura_zewnetrzna]&field3=[Wrapitup#Temperatura_CO]
endon
Now in log i can see it tries to send data every minute, but thingspeak doesn't response? or don't get it?

Code: Select all

6640331: SendToHTTP: Host: api.thingspeak.com port: 80
6640332: SendToHTTP: Path: /update?key=KE3CAXN08BDJJ8JV&field1=25.44&field2=27.37&field3=26.25
6640498: GET /update?key=blahblah&field1=25.44&field2=27.37&field3=26.25 HTTP/1.1^^Host: api.thingspeak.com^^User-Agent: ESP Eas
6640498: GET /update?key=blahblah&field1=25.44&field2=27.37&field3=26.25 HTTP/1.1^^Host: api.thingspeak.com^^User-Agent: ESP Eas
6640499: HTTP : Command_HTTP_SendToHTTP closing connection
Am I right that server does not accept the data?

Re: EspEasy sends data to Thingspeak in odd time intervals

Posted: 05 Jun 2019, 16:34
by grovkillen
I think you need to update the firmware, thing speak updated it's API some couple of months ago.

Re: EspEasy sends data to Thingspeak in odd time intervals

Posted: 06 Jun 2019, 11:10
by scaevola
Allright, I updated the firmware to the latest release (23.05.2019), but this changed nothing.
What is more interesting, till yesterday I used ESPEasy with Thingspeak in some ancient version from 2017 and it worked flaweless. I changed the firmware to add a node and send all data in one batch.
It had to be better, but it's worse.

Edit:
ok, I've got small progress. On thingspeak forum I've read that on thingspeak controller in espeasy you have to set "Check reply" to "Check Acknowledgement".
Now I get the readouts, but only from one sensor. How can I force controller to send all three variables, or get acknowledgement through rules?

Re: EspEasy sends data to Thingspeak in odd time intervals

Posted: 07 Jun 2019, 09:18
by rayE
Unless the thingspeak controller has been updated since a couple of months ago then this is the way to do it.
1. Create a quad dummy var.
2. Give this dummy var an IDX of 1, Enable and send to thingspeak controller. The first temp will be field 1 and so on.
3. Copy your 3 temps into this var
4. set your thingspeak controller to >15,000mS and to "check acknowledge".

The thing speak controller can only send a max of 4 fields at once (one quad dummy var), i dropped a suggestion that this needs to be updated to 8 fields (2 quad dummy vars)

Thats it.
Ray

Re: EspEasy sends data to Thingspeak in odd time intervals

Posted: 07 Jun 2019, 11:46
by scaevola
That is the exact solution that I have.
The dummy device sends data to thingspeak. When I set the variable type of "quad" only one value is sent.
But the funny thing is, setting this variable to "temp/humidity/pressure" causes sending all three variables at once, as it should be.
However, I have noticed this setting is most fragile. Another opening this page in browser causes that only one variable is sent again. Even without it after few minutes it falls back to one variable only.

I don't know what is the reason that it drops data.

Edit:
I have an impression, that this problem has something with web browser. When I set variables from phone, it breaks up. Even when I refresh dummy device page, the value of variable type come back to "Single".
Now it works for few hours and everything is ok.

Re: EspEasy sends data to Thingspeak in odd time intervals

Posted: 08 Jun 2019, 01:08
by rayE
I have tried both the thingspeak controller and sendtoHttp methods with thingspeak but both were not 100% reliable, sometimes updates were missed. Thingspeak now supports MQTT so I ended up modifying one of the MQTT controllers to work with thingspeak and this method ROCKS, no missed updates on the 8 fields that i send. Here is a link to my channel feed.

https://thingspeak.com/channels/564301

There are issues with my modified controller as i don't really understand the ESPeasy framework so the coding method i used is "weak". It will publish 8 data fields OK but im clueless as to subscribe. If you want to try it then i do not mind sharing with you.

Ray

Re: EspEasy sends data to Thingspeak in odd time intervals

Posted: 20 Nov 2023, 18:23
by kniazio
rayE wrote: 08 Jun 2019, 01:08 I have tried both the thingspeak controller and sendtoHttp methods with thingspeak but both were not 100% reliable, sometimes updates were missed. Thingspeak now supports MQTT so I ended up modifying one of the MQTT controllers to work with thingspeak and this method ROCKS, no missed updates on the 8 fields that i send. Here is a link to my channel feed.

https://thingspeak.com/channels/564301

There are issues with my modified controller as i don't really understand the ESPeasy framework so the coding method i used is "weak". It will publish 8 data fields OK but im clueless as to subscribe. If you want to try it then i do not mind sharing with you.

Ray
Please share with me