Delays explanation

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
velja
Normal user
Posts: 29
Joined: 08 Feb 2017, 08:07

Delays explanation

#1 Post by velja » 29 Mar 2017, 13:06

Hi,

My ESP-01 work on battery (solar power) so I wont to lower power consumption. Data has been sent to ThinkSpeak. So, in advanced tab is Message Delay, in Devices: Delay and in the config Sensor delay.
What this delays exactly mean? I want to send data once in 10 minutes. I have 4 tasks with 8 values totally. What is the less power consumption solution?

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

Re: Delays explanation

#2 Post by grovkillen » 29 Mar 2017, 15:32

In devices the delay is non-unit and in advanced it is msec, thus if you specify delay as "1" in devices and have it set to "1000" msec in advanced the delay will be:
1x1000msec = 1sec

If you have "1" in devices and "1" msec in advanced this would result in:
1x1msec = 1msec

So Is suggest you leave it for "1000" msec in advanced and treat the delay in devices as seconds. So to have the ESP send to ThinkSpeak every 10 minutes you would have the delay in devices set to:

10min = 10x60sec = 600sec
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:

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Delays explanation

#3 Post by Shardan » 29 Mar 2017, 16:48

For some clearance.

The "Sensor Delay" Setting on the config page controls how often your ESP8266-sensor reports to FHEM, Openhab or whatever.
As far as i know used with "Deep Sleep" to wake the ESP from DeepSleep every "n" seconds. (never played with this setting..)
From the Wiki:
Sensor Delay Set the delay between sensor reporting in seconds.
https://www.letscontrolit.com/wiki/index.php/ESPEasy
Note that with DeepSleep all values are sent at once, then the chip goes down until next wake up.
The "Message Delay" in the Advanced tab should be set to zero with that.
See: https://www.letscontrolit.com/wiki/index.php/SleepMode


The "Message Delay" in the Advanced Settings controls the time between single reports.
For example if you use several sensors or sensors with several values and you send that in one bunch to
for example Thingspeak, the Server won't accept it - you need a break between the messages.
From the Wiki:
Message Delay To prevent overloading your controller or webservice, a delay between reports can be set. Defaults to 1000 milliseconds.
For Thingspeak set it to 15000 miliseconds.

The "Delay" field within the device Tasks controls how often this specific task is triggered and reports fresh values.
It can be used to Keep an eye on fast cahnging values while keeping data load down from other, slow moving tasks.
So you might set a fluid level sensor to a short delay of 3..5 seconds (avoids wet feet from the bath tub...) while
the temperature sensor on the same ESP reports eveery 60 or 120 secs as temperature does not move that quick usually.


Regards
Shardan
Regards
Shardan

velja
Normal user
Posts: 29
Joined: 08 Feb 2017, 08:07

Re: Delays explanation

#4 Post by velja » 30 Mar 2017, 10:20

I understand that and try many combination but can't get longer interval between two transmit than 4 minutes. When I set message delay greater than 200 000 ms I get smaller delay on some task and on some task no transmittion to thinkspeak at all. Firmware is R148.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Delays explanation

#5 Post by Shardan » 30 Mar 2017, 14:21

Hello,

as i don't use thingspeak i have to guess a bit.
Basically the ESP is a single threaded system so tasks will more or less impact each other.

I'm at the office atm so i can't test anything.

The "Message Delay" is not meant to make long breaks between transmissions.
Servers like thingspeak have a locking mechanism to avoid flooding.

A malicious or misconfigured software may repeat sending data veroy often to flood the Server until it crashes.
So the server watches the source of the data and does not allow another transmission from the same source for a certain time (15 sec).
This is controlled by "Message Delay", it should be set to 15000 for thingspeak.

I'm even not sure if you can enter a message delay of 200.000 at all - this depends on the data type used inside the program.
(How many bits has the variable ? Signed? Unsigned?). If the times you get are very different it might be possible that you
exceeded the bit length of "Message Delay".

How often your sensor sends data is set with the delay field in the device Task, should be 600 for your settings.

As mentioned above the tasks and settings hame some influence to eachother - even temperature of the chip has a little influence.
If you set the sensor's delay in the device task to 600 (=10 min) it will send every 10 minutes - more or less.

Can you tell us the sensors you use?
If possible i might do some further testing over the weekend.

Regards
Shardan
Regards
Shardan

velja
Normal user
Posts: 29
Joined: 08 Feb 2017, 08:07

Re: Delays explanation

#6 Post by velja » 31 Mar 2017, 09:49

I got delay as I want changing delay value in devices. Thank you for help. Here are screenshot of device windows and link to Thinkspeak. Wind and rain sensor (Dummie device) are out of order so values are zero.


https://thingspeak.com/channels/231248
Attachments
2.jpg
2.jpg (95.89 KiB) Viewed 8601 times
1prozor.jpg
1prozor.jpg (151.46 KiB) Viewed 8601 times

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Delays explanation

#7 Post by Shardan » 31 Mar 2017, 14:21

Anytime :)
Regards
Shardan

User avatar
EDsteve
Normal user
Posts: 56
Joined: 11 May 2018, 21:13

Re: Delays explanation

#8 Post by EDsteve » 11 May 2018, 21:25

Hi,

i have connected a BME280 on a NodeMCU using ESPeasy (from 24.03.18) which sends the data to Domoticz.
I want the data to be updated every 30 seconds but if i write 30 seconds in the delay it keeps updating every 60 seconds. Is that a bug or a feature? ;)

With my connected light sensor 10 seconds no problem. Why i can't do that with BME280?

Thanks
ED

TD-er
Core team member
Posts: 3500
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Delays explanation

#9 Post by TD-er » 12 May 2018, 21:38

EDsteve wrote: 11 May 2018, 21:25 Hi,

i have connected a BME280 on a NodeMCU using ESPeasy (from 24.03.18) which sends the data to Domoticz.
I want the data to be updated every 30 seconds but if i write 30 seconds in the delay it keeps updating every 60 seconds. Is that a bug or a feature? ;)

With my connected light sensor 10 seconds no problem. Why i can't do that with BME280?

Thanks
ED
The BMx280 plugin is hard coded in the software to this cycle of 1 minute.
So setting it lower will not work right now.

I was planning to look at the code of that sensor in the next few weeks.

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests