Data being sent to ThingSpeak not in regular intervals

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Vilda
Normal user
Posts: 13
Joined: 16 Jun 2019, 22:12

Data being sent to ThingSpeak not in regular intervals

#1 Post by Vilda » 03 Jul 2019, 11:29

I am trying to sent the data from 4 different sensors (7 different values) to ThingSpeak every 30 seconds. Sensors are set to get the data each 30 seconds (or more frequent). Messaging frequency in Advanced settings is set to 30 seconds. Nevertheless datat from some sensors are received by Thingspeak more frequently than from the others - check the channel:
https://thingspeak.com/channels/813426
Any idea what could be causing this behaviour (and more important how to fix it?)
Thank you

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Data being sent to ThingSpeak not in regular intervals

#2 Post by grovkillen » 03 Jul 2019, 17:34

I suggest you don't tinker with the advanced settings for messages. Instead use rules to publish the values.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Data being sent to ThingSpeak not in regular intervals

#3 Post by rayE » 04 Jul 2019, 00:12

Hi,
The following will write all 8 fields to a public/private channel. Replace write API key and vars with your stuff. Trigger the send from a timer.

Code: Select all

SendToHTTP api.thingspeak.com,80,/update?key=YourWriteAPIkey&field1=[HLW_Accu#V]&field2=[HLW_Accu#A]&field3=[HLW_Accu#W]&field4=[S_Info#Pcount]&field5=[S_Info#WiFi]&field6=[S_Info#Load]&field7=[S_Info#Uptime]&field8=[S_Info#MQTT]
Love it! IOT Bees :-)

Ray

Vilda
Normal user
Posts: 13
Joined: 16 Jun 2019, 22:12

Re: Data being sent to ThingSpeak not in regular intervals

#4 Post by Vilda » 06 Jul 2019, 12:04

THANKS for making me a bit more clever again, rayE! ;)
Works very well!

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Data being sent to ThingSpeak not in regular intervals

#5 Post by rayE » 06 Jul 2019, 12:12

Wonderful mate, glad i could be of help.

Keep those IOT bees happy as without them the human race is SCREWED :-) Please keep me updated on any progress. I live in the Philippines and honey is a very much liked product here as well as general cross pollination of plants provided by our furry flying friends :-).

Do you have a website/blog on what your doing? If not you really should as it's so important. Perhaps i can help spread your knowledge over here?

Best Regards
Ray

Vilda
Normal user
Posts: 13
Joined: 16 Jun 2019, 22:12

Re: Data being sent to ThingSpeak not in regular intervals

#6 Post by Vilda » 06 Jul 2019, 12:59

Hi Ray!

you can check here http://itrubec.cz/en - unfortunately not too many topics in English. I am currently building an IoT Beehive which is going to be placed at the roof of IBM building in Brno, Czech Republic. The data will be public. Please keep fingers crossed! :-)

Vilem

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Data being sent to ThingSpeak not in regular intervals

#7 Post by rayE » 06 Jul 2019, 13:02

Good luck with the project, i for one understand the importance of what your doing :-)

If you need any FREE assistance in this project then im an electronics design engineer with programming knowledge, give me a shout at

rayellam@yahoo.com

im semi retired and glad to assist :-)

Ray

Vilda
Normal user
Posts: 13
Joined: 16 Jun 2019, 22:12

Re: Data being sent to ThingSpeak not in regular intervals

#8 Post by Vilda » 07 Jul 2019, 20:29

is there some limit on the number of GET parametres sent?

I am sending following:

Code: Select all

SendToHTTP itrubec.cz,80,/monitor/iotbeehive.php?key=xyz&dev=dd1&f1=[DHT#TIN]&f2=[DHT#HIN]&f3=[BME#TOUT]&f4=[BME#HOUT]&f5=[BME#POUT]&f6=[Light#L]&f7=[Relay#R]&f8=[i1#T1]&f9=[i2#T2]&f=[i3#T3]
and I get following (each parameter on one line):

xyz
dd1
20.1
57
23.3
48
1010
553
0
22.8
20.8
[i3

...it looks like the last parameter is not parsed properly...

Vilda
Normal user
Posts: 13
Joined: 16 Jun 2019, 22:12

Re: Data being sent to ThingSpeak not in regular intervals

#9 Post by Vilda » 07 Jul 2019, 22:07

Looks like there is a limit to 9 values parsed from sensors. I needed 10, so I did following workarround:

Code: Select all

On Rules#Timer=2 do
  timerSet,2,59
  if [Relay#R]=0
    SendToHTTP itrubec.cz,80,/monitor/iotbeehive.php?a=[DHT#TIN]&b=[DHT#HIN]&c=[BME#TOUT]&d=[BME#HOUT]&e=[BME#POUT]&f=[Light#L]&g=0&h=[HP1#hp1]&i=[HP2#hp2]&j=[Sonda#sonda]&key=xxx&dev=yyy
  else
    SendToHTTP itrubec.cz,80,/monitor/iotbeehive.php?a=[DHT#TIN]&b=[DHT#HIN]&c=[BME#TOUT]&d=[BME#HOUT]&e=[BME#POUT]&f=[Light#L]&g=1&h=[HP1#hp1]&i=[HP2#hp2]&j=[Sonda#sonda]&key=xxx&dev=yyy
  endif
endon

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Data being sent to ThingSpeak not in regular intervals

#10 Post by rayE » 08 Jul 2019, 00:05

From memory i think there is a limit that can be sent in one go. This can be increased, i think it's a setting in the globals file? This requires a change and recompile to the ESP source code.

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests