[Timer] Dealing with long running Sensor and Output Updates #25
Labels
No labels
bug
documentation
duplicate
enhancement
help wanted
invalid
question
v0.1.x
v0.2.x
v0.3.x
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: DeltaLima/CanGrow#25
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When
Sensor_Update()
orOutput_Update()
is called from the timer (every 1 second), then the timer can queue up when the sensor readings or output set-requests are taking too long.This is for example the case when you have a
BME680
andTCS34725
configured. Both together delaying the system for about 1,5 Seconds.A Tasmota Webcall can also run into a timeout, or just take a bit longer to finish the request because of a bad wifi signal.
For those cases, maybe it would be helpful to measure, how long
Sensor_Update()
orOutput_Update()
took and then but them into a different timer.For example,
Sensor_Update()
took 250ms to finish, it will be in the 1s Timer. If it is above 800ms, it will go into a 5s timer. Same forOutput_Update()
This would make it necessary to do a larger rework of the Output and Sensor Update mechanism, because Water outputs might have to be updated every second (because 1s is the smallest possible
config.grow.water.onTime
value)