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. Complete shutdown of MySensors in code possible ?

Complete shutdown of MySensors in code possible ?

Scheduled Pinned Locked Moved Development
6 Posts 4 Posters 1.9k 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.
  • G Offline
    G Offline
    GertSanders
    Hardware Contributor
    wrote on last edited by
    #1

    Is there a way to completely shutdown all MySensors code via code (not via compile defines, but a decision made in code) ?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tekka
      Admin
      wrote on last edited by
      #2

      @gertsanders No, but you could modify the MyMain<Arch>.cpp files, e.g. for AVR:

      https://github.com/mysensors/MySensors/blob/development/hal/architecture/AVR/MyMainAVR.cpp#L30

      with a conditional execution of _process()

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GertSanders
        Hardware Contributor
        wrote on last edited by
        #3

        I'm building a MySensors aware clock. However, I need to provide for the situation that the netwerk is down (gateway without power, or not installed). Or there could be a problem with the radio. In all cases I want the clock to still start up and run without apparent slowdown.
        What I found was, that when I do not install a radio, the MySensors library is aware of this (a FALSE result from isTransportReady() ), but the MySensors code seems to take it's time and hog the processor by trying to reconnect.
        This is visible on my clock, because the time on the display seems to "freeze" for some seconds. As I use a real RTC, this not really a big problem, but it is visible none the less. And being a perfectionist, I do not want a clock which seems to jump a few seconds now and then.
        So the question is how to skip these processor intensive parts if the user accepts that the clock should work without MySensors integration.
        Any suggestion is fine :-)

        mfalkviddM 1 Reply Last reply
        0
        • G GertSanders

          I'm building a MySensors aware clock. However, I need to provide for the situation that the netwerk is down (gateway without power, or not installed). Or there could be a problem with the radio. In all cases I want the clock to still start up and run without apparent slowdown.
          What I found was, that when I do not install a radio, the MySensors library is aware of this (a FALSE result from isTransportReady() ), but the MySensors code seems to take it's time and hog the processor by trying to reconnect.
          This is visible on my clock, because the time on the display seems to "freeze" for some seconds. As I use a real RTC, this not really a big problem, but it is visible none the less. And being a perfectionist, I do not want a clock which seems to jump a few seconds now and then.
          So the question is how to skip these processor intensive parts if the user accepts that the clock should work without MySensors integration.
          Any suggestion is fine :-)

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

          @gertsanders could setting MY_TRANSPORT_WAIT_READY_MS to something quick enough to not be noticeable work?

          An alternative could be to use a timer interrupt to drive the update of the screen and make sure that interrupt has higher priority than the radio interrupt.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GertSanders
            Hardware Contributor
            wrote on last edited by
            #5

            @mfalkvidd I set it to 1000ms, but the jumps are sometimes 3 - 4 seconds. I was hoping that shutdownTransport() would do the trick. But that does not seem to help. It looks like I need to define a hardware_shutdown button or something.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DavidZH
              wrote on last edited by
              #6

              @GertSanders I can't know where you stand pricepoint wise, but this sounds like a 2 MCU project. One to handle the clock functions, and one to communicate with MySensors. Messages between the 2 MCU's over I2C.
              If the link is down, that will only clog the comms MCU.

              1 Reply Last reply
              2

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              7

              Online

              12.0k

              Users

              11.2k

              Topics

              113.4k

              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