I read the data from the sensor measure coroutine every 20 mins and the upload data corotine runs once every 4 hours. I need to use machine.deepsleep() in between these long running schedules. Can anyone help me with a small snippet how can i make this work ?
i am positng a small code example to what i have written
Code: Select all
import * async def measure(): temperature = round(si.temperature(),1) storeData() async def upload(): uploadMqtt() async def main(): asyncio.create_task(schedule(measure, hrs=None, mins=range(0,60,20))) asyncio.create_task(schedule(upload, hrs=(0.60.4), mins=None)) await asyncio.sleep(100000000) #some infinitey large number asyncio.run(main())