logo elektroda
logo elektroda
X
logo elektroda

Adding Watchdog and Reboot Reason Tracking to OpenLN882H - Feedback Requested

p.kaczmarek2 720 6
ADVERTISEMENT
  • #1 21023308
    p.kaczmarek2
    Moderator Smart Home
    I am thinking about adding watchdog and reboot reasons to OpenLN882H. It seems that the related header is reboot_trace.h.

    Code: C / C++
    Log in, to see the code

    For now, I am focusing only on reboot reason. Can anyone check out the new fork and tell me whether the device display reboot reason correctly and can tell between "power on" (via powering on) and "restart" reboot?
    @divadiow @max4elektroda
    PR link: https://github.com/openshwprojects/OpenBK7231T_App/pull/1154

    Next I will setup a watchdog ,so LN882H devices will reboot automatically in case of a problem.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #2 21023326
    divadiow
    Level 34  
    reboot status if using restart button

    Screenshot of a user interface with a Restart button and diagnostic information.

    and if killing the power abruptly

    Screenshot of a device control panel with Restart button and other configuration options.
  • ADVERTISEMENT
  • #3 21023339
    p.kaczmarek2
    Moderator Smart Home
    Thank you for confirmation. I think I will merge it before looking into watchdog itself.

    Watchdog will also help as a backup recovery method for some other issues like device freezing, etc.

    Added after 11 [minutes]:

    EDIT: Well it doesn't seem that there is much info about watchdog itself:
    https://github.com/openshwprojects/OpenLN882H/blob/master/mcu/driver_ln882h/reg/reg_wdt.h
    Only registers there...

    Added after 2 [minutes]:

    Wait, it looks better:
    https://github.com/openshwprojects/OpenLN882H/blob/master/mcu/driver_ln882h/hal/hal_wdt.h

    Added after 55 [seconds]:

    And we have some sample code:
    Code: C / C++
    Log in, to see the code
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 21023419
    max4elektroda
    Level 20  

    Too late, since it's already included, but I can confirm it working here, too:
    OpenLN882H user interface showing system information and configuration options.
    Control panel of the OpenLN882H_C25E1088 device with network status information and configuration buttons.
  • #5 21023435
    p.kaczmarek2
    Moderator Smart Home
    I have translated watchdog demo to English:
    https://github.com/openshwprojects/OpenLN882H/commit/1285225adb70fea6a937b1841f74aab66d06d759
    I think I will try to plug it into some console command next so we can all check if it works... or at least check if it does not prevent LN from working.

    If I understand correctly, I will need to "feed the watchdog" every quick tick or something like that with:
    Code: C / C++
    Log in, to see the code

    Otherwise the watchdog will reboot the LN882H module.
    Helpful post? Buy me a coffee.
  • Helpful post
    #6 21044083
    miegapele
    Level 15  

    Added watchdog here, seems to work if I force freeze
  • ADVERTISEMENT
  • #7 21044097
    p.kaczmarek2
    Moderator Smart Home
    Thank you, I have somehow forgot to continue this topic. I've merged your PR. Keep it up!
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around the implementation of watchdog functionality and reboot reason tracking in the OpenLN882H device. The user seeks feedback on a new fork that includes reboot reason detection, distinguishing between power-on and software restarts. Responses confirm the functionality of reboot reason tracking and the integration of watchdog features, which serve as a recovery method for device freezes. Sample code for watchdog initialization and operation is shared, emphasizing the need to periodically "feed the watchdog" to prevent unintended reboots. The community expresses support for the changes and confirms their effectiveness.
Summary generated by the language model.
ADVERTISEMENT