0

IO one data feed update rate much slower than others
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

IO one data feed update rate much slower than others

by jwardell on Tue Aug 20, 2019 10:32 am

I recently built an Arduino ESP32 temp logger with IO, which pushes three feeds: temperature, humidity, and heat index. They are stored right after the other in the code. However, IO is only receiving updates for the heat index feed once every several minutes (I've seen delays up to 30 min) while temp and humidity come in every minute or more.

Does anyone have any idea how or why this is happening? Is there some way to set the rate at which the Adafruit IO libraries upload data? Can the server be blocking this or is this some issue with Arduino code?

Here is a recent capture from IO Monitor page:

Code: Select all | TOGGLE FULL SIZE
2019/08/20 10:16amtempsense.temperature80.239998
2019/08/20 10:16amtempsense.humidity61.000000
[b]2019/08/20 10:16amtempsense.heatindex82.216843[/b]
2019/08/20 10:16amtempsense.temperature80.239998
2019/08/20 10:16amtempsense.temperature80.239998
2019/08/20 10:16amtempsense.humidity61.599998
2019/08/20 10:15amtempsense.temperature80.239998
2019/08/20 10:15amtempsense.humidity61.799999
2019/08/20 10:15amtempsense.temperature80.239998
2019/08/20 10:15amtempsense.temperature80.239998
2019/08/20 10:14amtempsense.temperature80.239998
2019/08/20 10:14amtempsense.humidity62.200001
2019/08/20 10:14amtempsense.temperature80.239998
2019/08/20 10:14amtempsense.temperature80.239998
2019/08/20 10:14amtempsense.humidity61.900002
2019/08/20 10:13amtempsense.temperature80.239998
2019/08/20 10:13amtempsense.humidity61.900002
2019/08/20 10:13amtempsense.temperature80.239998
2019/08/20 10:13amtempsense.humidity62.299999
2019/08/20 10:13amtempsense.temperature80.239998
2019/08/20 10:12amtempsense.humidity62.099998
2019/08/20 10:12amtempsense.temperature80.239998
2019/08/20 10:12amtempsense.humidity62.200001
2019/08/20 10:12amtempsense.temperature80.239998
2019/08/20 10:12amtempsense.humidity62.200001
2019/08/20 10:12amtempsense.temperature80.239998
2019/08/20 10:11amtempsense.temperature80.239998
2019/08/20 10:11amtempsense.temperature80.059998
2019/08/20 10:11amtempsense.temperature80.239998
2019/08/20 10:10amtempsense.humidity62.099998
2019/08/20 10:10amtempsense.temperature80.059998
2019/08/20 10:10amtempsense.humidity61.900002
2019/08/20 10:10amtempsense.temperature80.059998
2019/08/20 10:10amtempsense.temperature80.239998
2019/08/20 10:10amtempsense.humidity62.400002
2019/08/20 10:09amtempsense.humidity62.000000
2019/08/20 10:09amtempsense.temperature80.059998
2019/08/20 10:09amtempsense.temperature80.239998
2019/08/20 10:09amtempsense.humidity62.400002
2019/08/20 10:09amtempsense.temperature80.239998
2019/08/20 10:09amtempsense.humidity62.299999
2019/08/20 10:08amtempsense.temperature80.239998
2019/08/20 10:08amtempsense.humidity62.099998
2019/08/20 10:08amtempsense.temperature80.239998
2019/08/20 10:08amtempsense.temperature80.059998
2019/08/20 10:08amtempsense.humidity62.700001
[b]2019/08/20 10:07amtempsense.heatindex82.138512[/b]
2019/08/20 10:07amtempsense.humidity62.299999
2019/08/20 10:07amtempsense.temperature80.059998
2019/08/20 10:07amtempsense.humidity62.299999
2019/08/20 10:07amtempsense.temperature80.239998
2019/08/20 10:07amtempsense.temperature80.059998
2019/08/20 10:07amtempsense.humidity62.099998
2019/08/20 10:06amtempsense.humidity62.099998
2019/08/20 10:06amtempsense.temperature80.059998
2019/08/20 10:06amtempsense.temperature80.059998
2019/08/20 10:06amtempsense.humidity62.299999
2019/08/20 10:06amtempsense.temperature80.059998


I also notice it is constantly re-connecting, is that normal?

Code: Select all | TOGGLE FULL SIZE
2019/08/20 10:16:51amf6000623-dec5-47af-98ab-adae0ab6connected
2019/08/20 10:16:50am60059bfe-03c6-45c7-ad4d-fdc970c4disconnected
2019/08/20 10:16:49am60059bfe-03c6-45c7-ad4d-fdc970c4connected
2019/08/20 10:16:30amd86326ef-55c4-4d55-b1bd-a6060c2bdisconnected
2019/08/20 10:16:11amd86326ef-55c4-4d55-b1bd-a6060c2bconnected
2019/08/20 10:16:10am1c157577-5373-4785-999d-0b9ba0cadisconnected
2019/08/20 10:15:53am1c157577-5373-4785-999d-0b9ba0caconnected
2019/08/20 10:15:51amc113c1b3-e127-49ca-b85a-67697effdisconnected
2019/08/20 10:15:49amc113c1b3-e127-49ca-b85a-67697effconnected
2019/08/20 10:15:29am9ca5f955-06d2-4956-aed5-ab818012disconnected
2019/08/20 10:15:29am9ca5f955-06d2-4956-aed5-ab818012connected
2019/08/20 10:15:09am096c1324-99c9-4d40-94de-53d50764disconnected
2019/08/20 10:14:50am096c1324-99c9-4d40-94de-53d50764connected
2019/08/20 10:14:49amb8697c63-bc5c-42b0-b825-2b695936disconnected
2019/08/20 10:14:49amb8697c63-bc5c-42b0-b825-2b695936connected
2019/08/20 10:14:29am37ad5177-2b35-43f0-88ee-e88d0ce8disconnected
2019/08/20 10:14:10am37ad5177-2b35-43f0-88ee-e88d0ce8connected
2019/08/20 10:14:09amb10e89ef-3c90-4918-b136-50fa85ecdisconnected
2019/08/20 10:13:50amb10e89ef-3c90-4918-b136-50fa85ecconnected
2019/08/20 10:13:49am1117c70c-6ac6-4b4a-be0a-6bdd2b61disconnected


Arduino code attached
Attachments
iotemp.ino
(6.67 KiB) Downloaded 6 times

jwardell
 
Posts: 12
Joined: Wed Jan 09, 2019 10:08 am

Re: IO one data feed update rate much slower than others

by brubell on Tue Aug 20, 2019 11:17 am

However, IO is only receiving updates for the heat index feed once every several minutes (I've seen delays up to 30 min) while temp and humidity come in every minute or more.

Does anyone have any idea how or why this is happening? Is there some way to set the rate at which the Adafruit IO libraries upload data?


I don't have a lot of experience with FreeRTOS. Does sending those values, outside of FreeRTOS (like, in a regular sketch) cause the same delay? It might be caused by a timer or task, I'd rule that out first.



Your code for sending values looks OK to me. `->save` should immediately update a feed. You may want to set a small delay between sending all three data points, though, even if it's a few milliseconds.

If you have a free Adafruit IO Account, the rate limit is 30 data points per minute. If you have upgraded to an Adafruit IO Plus account, the base rate limit is 60 data points per minute.

Code: Select all | TOGGLE FULL SIZE
  // save fahrenheit (or celsius) to Adafruit IO
  temperature->save(newValues.temperature);
  // save humidity to Adafruit IO
  humidity->save(newValues.humidity);
  heatindex->save(heatIndex);

brubell
 
Posts: 496
Joined: Fri Jul 17, 2015 10:33 pm

Re: IO one data feed update rate much slower than others

by jwardell on Wed Aug 21, 2019 10:05 am

This is just a regular sketch.

I tried adding a 20ms delay in between stores but that didn't help.

I suppose I will try changing around the order next to see if this is an issue with feed or quantity.

jwardell
 
Posts: 12
Joined: Wed Jan 09, 2019 10:08 am

Re: IO one data feed update rate much slower than others

by jwardell on Thu Aug 22, 2019 10:01 am

It seems to report the first feed 3x a minute, then the 2nd and 3rd feed only successfully update once every 5-15 minutes.
I moved heat index to save first and it is now the one updating, so order matters. I increased delay to 50ms but that did not help.

I'm guessing the connection is breaking before the other feeds can be sent. Is it normal for the connection to be opened and closed with each update, as I showed in the first post?

jwardell
 
Posts: 12
Joined: Wed Jan 09, 2019 10:08 am

Re: IO one data feed update rate much slower than others

by jwardell on Fri Aug 23, 2019 10:19 am

I have it mostly working now! All 3 feeds are now almost always updating, and the board does not reconnect every second or two...it stays connected for 5-10 minutes.

I removed the delays after the feed updates, and added a second of delay in the mainloop.

Is it possible that calling io.run() is interrupting the connection if it isn't finished? Just a guess if my main loop was executing quickly.

I suggest adding some documentation the board should not be repeatedly connecting. I thought that was normal.

jwardell
 
Posts: 12
Joined: Wed Jan 09, 2019 10:08 am

Please be positive and constructive with your questions and comments.