Hi Dev Team,
I am running a program that takes in sensor data at 10 min intervals and publishes it to my server through MQTT at 1hr intervals.
I have different threads running for different events (Taking data from sensor and sending data outside). I am using the kernel timers to execute these events repeatedly.
Now, I want to schedule these events in such a way that I start my program at any time and then it reads the sensor value at 00:00 (12 am), 00:10 (12:10)... with 10 mins interval and then publishes my sensor value to server through MQTT every 1 hour (01:00, 02:00....) at exact times.
Currently, I just start the program and then the process initiates at that time and continues. But I need the data to be read at specific times i.e: start of the hour time (like exactly at 12:00,12:10, 12:20, 12:30, 12:40, 12:50, 01:00) and then publish the data exactly at 01:00,02:00,03:00... and then continue this process.
Could you let me know how to schedule events such that they happen sequentially at the time I need.
Regards,
Adeel.