Tips about dealing with scedule time, e.g light swith timer etc
Posted: Thu Apr 09, 2020 4:42 pm
Hi!
I am working on a basic watering system. The plan is to control when to water and for how long with some sort of timer. For example "activate pump at time x for 15 seconds". Working with time in general is quite tricky so I am asking for advice.
I dont want the time schedule to be hard corded, I will implement MQTT to send commands to the wemos unit to set the time. The action will be repeated daily until it stops. Preferably I would like to dynamically set any number of timers. Say water for 20 seconds at 10.00 and 10 seconds 20.00 etc.. Same logic could be to turn on and off a light etc.
I want to keep it rather basic. My level is basic to intermediate in python. I have less experience with micro ]python and IOT in general.
Using RTC https://docs.micropython.org/en/latest/ ... ne.RTC.irq and
RTC.alarm(id, time, *, repeat=False)
If I understand correctly, to initialize RTC the easiest way would be to make a api call comewhere to get current time.
Is there any other good ways to make a timer to start events during a particular length of time?
I am working on a basic watering system. The plan is to control when to water and for how long with some sort of timer. For example "activate pump at time x for 15 seconds". Working with time in general is quite tricky so I am asking for advice.
I dont want the time schedule to be hard corded, I will implement MQTT to send commands to the wemos unit to set the time. The action will be repeated daily until it stops. Preferably I would like to dynamically set any number of timers. Say water for 20 seconds at 10.00 and 10 seconds 20.00 etc.. Same logic could be to turn on and off a light etc.
I want to keep it rather basic. My level is basic to intermediate in python. I have less experience with micro ]python and IOT in general.
Using RTC https://docs.micropython.org/en/latest/ ... ne.RTC.irq and
RTC.alarm(id, time, *, repeat=False)
If I understand correctly, to initialize RTC the easiest way would be to make a api call comewhere to get current time.
Is there any other good ways to make a timer to start events during a particular length of time?