[Timer] Dealing with long running Sensor and Output Updates #25

Open
opened 2025-03-16 04:04:21 +01:00 by DeltaLima · 0 comments
Owner

When Sensor_Update() or Output_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 and TCS34725 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() or Output_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 for Output_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)

When `Sensor_Update()` or `Output_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` and `TCS34725` 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()` or `Output_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 for `Output_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)
DeltaLima added the
enhancement
v0.2.x
v0.3.x
labels 2025-03-16 04:04:21 +01:00
DeltaLima added this to the CanGrow Firmware project 2025-03-16 04:04:21 +01:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DeltaLima/CanGrow#25
No description provided.