This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

mqtt simple + timer collision

Dear Sir.

We are using software based on mqtt simple project .

We added a 1 hz timer, Every 1 hz we toggle a led on and off.

Sometime the led is stuck on " on " or " off  which means to me that the timer is not 

working fine or the mqtt routine in the background stops it.

Any idea how to debug this problem.

Please Advise.

Parents
  • Hi Ephraim,

    My guess is that this is due to scheduling.

    Could you post the code and configuration you use for the timer?

    Regards,
    Sigurd Hellesvik

  • Hi.

    In main.c  configure timer

    k_timer_init(&my_timer, my_expiry_function, NULL); //Timer - 1 Hz
    k_timer_start(&my_timer, K_MSEC(TIEMR_INTERVAL_SEC), K_SECONDS(TIEMR_INTERVAL_SEC)); //Timer - 1 Hz

    void my_expiry_function(struct k_timer *timer_id)
    {
    k_work_submit(&work_top);
    }

    The code of mqtt is the same as in the project mqtt simple , turning on and off the mqtt

    by issuing the commands   lte_lc_offline(); and lte_lc_normal();

    Every time the the modem reconnect there is a delay in the timer ( see pic ). Sometimes the timer is stopped.

    Please Advise.

Reply
  • Hi.

    In main.c  configure timer

    k_timer_init(&my_timer, my_expiry_function, NULL); //Timer - 1 Hz
    k_timer_start(&my_timer, K_MSEC(TIEMR_INTERVAL_SEC), K_SECONDS(TIEMR_INTERVAL_SEC)); //Timer - 1 Hz

    void my_expiry_function(struct k_timer *timer_id)
    {
    k_work_submit(&work_top);
    }

    The code of mqtt is the same as in the project mqtt simple , turning on and off the mqtt

    by issuing the commands   lte_lc_offline(); and lte_lc_normal();

    Every time the the modem reconnect there is a delay in the timer ( see pic ). Sometimes the timer is stopped.

    Please Advise.

Children
No Data
Related