Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. Arduino sketch, How to specify Timeout Mysensor initailisation

Arduino sketch, How to specify Timeout Mysensor initailisation

Scheduled Pinned Locked Moved Development
4 Posts 2 Posters 778 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    benbidouille
    wrote on last edited by
    #1

    Hello,
    Maybe a naive question but I'm looking after a way to exit from mysensor initailisation in case it fails hooking to gateway and I havent found the way to specify a timeout.

    About the context:
    I have a Arduino based Mysensor Node that is used to control 2 relays for Opening and Closing curtains.
    The Node control is done either through radio as a Mysensor Node either locally through local to curtains Button control.

    The Button status are in fact read by Arduino, programs arbitrates between local buttons and radio.

    All works well as long as the Mysensor network is ON and the curtain Node hooks to mysensor gateway, but I want to make sure I can keep control of the curtains with local buttons in absence of the mysensor network and I haven't yet found the way to manage it.

    On Arduino sketch of the curtain node, at Reset the program keeps expecting a successfull link with gateway and keeps cycling before excecution of presentation() or even loop() of the arduino sketch.

    Would somebody have a trick to specify a timeout or a maximum attempts to hook gateway and keeps executing arduino sketch ?

    Also I would be interested to now How to reinitiate a mysensor initialisation from the Arduino sketch without having to reset the arduino.

    Thanks in advance

    mfalkviddM 1 Reply Last reply
    0
    • B benbidouille

      Hello,
      Maybe a naive question but I'm looking after a way to exit from mysensor initailisation in case it fails hooking to gateway and I havent found the way to specify a timeout.

      About the context:
      I have a Arduino based Mysensor Node that is used to control 2 relays for Opening and Closing curtains.
      The Node control is done either through radio as a Mysensor Node either locally through local to curtains Button control.

      The Button status are in fact read by Arduino, programs arbitrates between local buttons and radio.

      All works well as long as the Mysensor network is ON and the curtain Node hooks to mysensor gateway, but I want to make sure I can keep control of the curtains with local buttons in absence of the mysensor network and I haven't yet found the way to manage it.

      On Arduino sketch of the curtain node, at Reset the program keeps expecting a successfull link with gateway and keeps cycling before excecution of presentation() or even loop() of the arduino sketch.

      Would somebody have a trick to specify a timeout or a maximum attempts to hook gateway and keeps executing arduino sketch ?

      Also I would be interested to now How to reinitiate a mysensor initialisation from the Arduino sketch without having to reset the arduino.

      Thanks in advance

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      @benbidouille welcome to the MySensors forum!
      To do stuff at reset, before MySensors code runs, implement preHwInit() or before() in your sketch.

      To set timeout, use MY_TRANSPORT_WAIT_READY_MS.

      search for these keywords in the forum to see some earlier discussions on similar use cases - maybe you can reuse some ideas and code.

      Re-initialization should happen automatically as soon as you try to send something.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        benbidouille
        wrote on last edited by
        #3

        Many Thanks @mfalkvidd
        Works just great as expected.
        Regards

        mfalkviddM 1 Reply Last reply
        1
        • B benbidouille

          Many Thanks @mfalkvidd
          Works just great as expected.
          Regards

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          @benbidouille great. Thanks for reporting back.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          12

          Online

          11.7k

          Users

          11.2k

          Topics

          113.1k

          Posts


          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • MySensors
          • OpenHardware.io
          • Categories
          • Recent
          • Tags
          • Popular