Faced with strange behavior when using RUI3 version 4.1.1: at a random moment of time when using timers, their handlers stops being called (one or more, some system timers continue to be processed). Only resetting the device helps.
Only three timers are created: two RAK_TIMER_PERIODIC with 1sec and 5msec intervals, and one RAK_TIMER_ONESHOT with 10 minutes interval (it is not started yet).
We think that the problem is in the code responsible for creating a linked list of timers and selecting the next one to be processed.
If your timer function takes longer than the timer interval, that can indeed lead to problems.
Either make your timer interval longer or define the timer as one-shot. Process your ModBus data, then restart the timer with 5 seconds interval as one-shot again.
If multiple timers hit “at the same time”, they are processed one by one.
I think your problem is with the 5 millisecond timer interval. That is very short and might block other tasks that are running in RUI3.
Not sure why you need a 5ms Modbus handler.
I have built devices with the RAK3172 using ModBus (both slave and master) and they work without such an resource intensive timer.