Method to OTA a sleeping node



  • Hi,
    I'm looking for some hints how to enable doing OTA to a node that is normally sleeping most of the time. Whilst sleeping the node can't receive messages from the controller so initiating OTA is difficult.

    The node wakes up every 5mins to send a sensor update. I was thinking to then also get the node to request a value from the controller representing it's 'run mode'. The controller then sends a value and the node changes it's 'run mode' to this.
    Such run modes could then be:

    • Normal RUN with sleep

    • RUN without sleep (OTA could be triggered)

    • STOP (waiting for OTA)

    It would be nice to somehow standardize on this, I think other battery operated nodes have the same need. Controllers could then also standardize handling such 'run mode request' by if needed automatically switching the node to STOP - OTA mode and doing the OTA. On could then instruct the controller to upload a new firmware to the node as soon as it comes online (in my case every 5 mins).

    Any other ideas or can this already be done in a standard way?
    Please comment if you find this a useful feature as well. Then I could add it as a feature request 💃

    Kurt



  • @Kurt said:

    I'm looking for some hints how to enable doing OTA to a node that is normally sleeping most of the time. Whilst sleeping the node can't receive messages from the controller so initiating OTA is difficult.
    [...]
    Please comment if you find this a useful feature as well. Then I could add it as a feature request

    I fully support this feature request! The majority of my sensors are battery powered and they all have SPIflash installed

    • Jan

  • Admin

    We've already implemented something we call "smart sleep" which makes sure to send a heart beat to server and wait for a short period before going into sleep mode. This enables controllers to buffer outgoing commands and potential FOTA transmissions for sleeping nodes.

    https://www.mysensors.org/view/167#sleeping

    AFAIK only MYSController and MyController supports this feature.



  • That sounds great hek, I'll give it a try.
    Strangely I looked over this when reading the API spec.


  • Admin

    I must have missed adding the smartSleep functions in the documentation page when we released 2.0. Did it just before answering you 😊


  • Plugin Developer

    Home assistant also supports smartsleep.


Log in to reply
 

Suggested Topics

  • 1
  • 3
  • 5
  • 2
  • 1
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts