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. Troubleshooting
  3. Message during setup() doesn't work in version 2.0.x

Message during setup() doesn't work in version 2.0.x

Scheduled Pinned Locked Moved Troubleshooting
5 Posts 3 Posters 870 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.
  • spacejayS Offline
    spacejayS Offline
    spacejay
    wrote on last edited by
    #1

    Hello all,

    I tried to convert the sketch from my relay node to the new version 2.0.x. In the setup() routine I set the state of the relay to off and sent the state to the controller. In version 1.5.4 worked this without problems. Now with version 2.0.0, it doesn't work anymore. It seems, that the node starts working just after setup() routine. Is there another possibility to run this command once after note setup/startup?

    Regards

    spacejay

    YveauxY tekkaT 2 Replies Last reply
    0
    • spacejayS spacejay

      Hello all,

      I tried to convert the sketch from my relay node to the new version 2.0.x. In the setup() routine I set the state of the relay to off and sent the state to the controller. In version 1.5.4 worked this without problems. Now with version 2.0.0, it doesn't work anymore. It seems, that the node starts working just after setup() routine. Is there another possibility to run this command once after note setup/startup?

      Regards

      spacejay

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by
      #2

      @spacejay Start your loop() code like this:

      void loop()
      {
          static bool first = true;
      
          if (first)
          {
              // .. Your code that should only be executed on first run ..
              first = false;
          }
          // .. your normal loop-contents ..
      }
      

      http://yveaux.blogspot.nl

      spacejayS 1 Reply Last reply
      0
      • spacejayS spacejay

        Hello all,

        I tried to convert the sketch from my relay node to the new version 2.0.x. In the setup() routine I set the state of the relay to off and sent the state to the controller. In version 1.5.4 worked this without problems. Now with version 2.0.0, it doesn't work anymore. It seems, that the node starts working just after setup() routine. Is there another possibility to run this command once after note setup/startup?

        Regards

        spacejay

        tekkaT Offline
        tekkaT Offline
        tekka
        Admin
        wrote on last edited by tekka
        #3

        @spacejay @Yveaux Addressed in #513.

        1 Reply Last reply
        1
        • YveauxY Yveaux

          @spacejay Start your loop() code like this:

          void loop()
          {
              static bool first = true;
          
              if (first)
              {
                  // .. Your code that should only be executed on first run ..
                  first = false;
              }
              // .. your normal loop-contents ..
          }
          
          spacejayS Offline
          spacejayS Offline
          spacejay
          wrote on last edited by
          #4

          @Yveaux Yes, I already solved this in this way temporarily.
          @tekka Thanks for solving that bug!

          YveauxY 1 Reply Last reply
          0
          • spacejayS spacejay

            @Yveaux Yes, I already solved this in this way temporarily.
            @tekka Thanks for solving that bug!

            YveauxY Offline
            YveauxY Offline
            Yveaux
            Mod
            wrote on last edited by
            #5

            @spacejay it's always hard to judge a user's experience level. Anyway, great you created a workaround and can continue!

            http://yveaux.blogspot.nl

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


            11

            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