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. General Discussion
  3. void receive(const MyMessage &message)

void receive(const MyMessage &message)

Scheduled Pinned Locked Moved General Discussion
40 Posts 6 Posters 1.9k Views 5 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.
  • skywatchS skywatch

    @mfalkvidd Thank you soooo much for the tips with this, I still am learning new stuff and getting a project done = a double win for me :)

    SO here is what I changed.....

    In void loop I added

    //Stop if received message = STOP
      if(RX_STOP == true){
        stop();
        }
    

    And void receive() now looks like this ( I never needed to call up() or down() from here anyway. I realise that now - doh!).

    void receive(const MyMessage &message) {
    
      // STOP - if message == V_STOP, stop blinds immediately.
      if (message.type == V_STOP) {
       RX_STOP = true;
      }
    
      // UP - if message == V_UP call void UP()
      if (message.type == V_UP) {
        MOVING_UP = true;
      }
    
      // DOWN - if message == V_DOWN call void DOWN()
      if (message.type == V_DOWN) {
        MOVING_DOWN = true;
      }
    
      //Add if (message.type==V_PERCENTAGE); and add calculation....maybe?
      // for reference 1% == 395 steps....
    }
    

    I'll test it later as I need some food now! ;)

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

    @skywatch great work. This is a much better design.

    skywatchS 1 Reply Last reply
    0
    • mfalkviddM mfalkvidd

      @skywatch great work. This is a much better design.

      skywatchS Offline
      skywatchS Offline
      skywatch
      wrote on last edited by skywatch
      #30

      @mfalkvidd Thank you!

      And of course RX_STOP = false; is now at the end of the stop(); loop to reset it for next time it is needed.....I forgot that bit!

      Update - it didn't work as expected, but I know why. I also had to change in the UP() and DOWN() loops from

       if (debouncerUP.fell()) {
          stop();
          }
      

      To....

       if (debouncerUP.fell()|| RX_STOP == true) {
          stop();
          }
      

      And then to completely mimic the button responses...

      if (debouncerDOWN.fell() || RX_STOP == true || MOVING_DOWN == true) {
            stop();
          }
      

      Now I am hungry and really will go get some food!

      1 Reply Last reply
      0
      • mfalkviddM mfalkvidd

        @skywatch if you want to know that, you need to add code in receive() to handle the echoed message. And you need to make sure those echoed messages don't interfere with "normal" messages.

        skywatchS Offline
        skywatchS Offline
        skywatch
        wrote on last edited by
        #31

        @mfalkvidd said in void receive(const MyMessage &message):

        @skywatch if you want to know that, you need to add code in receive() to handle the echoed message.

        Is there a basic example of this anywhere? I can't see it...

        And you need to make sure those echoed messages don't interfere with >"normal" messages.

        It is mainly for the window sensor which as well as being useful for the blind, it will also form part of the security alarm system as well.

        mfalkviddM 1 Reply Last reply
        0
        • skywatchS skywatch

          @mfalkvidd said in void receive(const MyMessage &message):

          @skywatch if you want to know that, you need to add code in receive() to handle the echoed message.

          Is there a basic example of this anywhere? I can't see it...

          And you need to make sure those echoed messages don't interfere with >"normal" messages.

          It is mainly for the window sensor which as well as being useful for the blind, it will also form part of the security alarm system as well.

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

          @skywatch no there is no example. We identified a need for such an example 3 years ago (see section 1 in https://forum.mysensors.org/post/34267 ) but so far no-one who understands how that stuff works has had sufficient time and motivation to do the necessary work. The task is very complicated.

          skywatchS 1 Reply Last reply
          1
          • mfalkviddM mfalkvidd

            @skywatch no there is no example. We identified a need for such an example 3 years ago (see section 1 in https://forum.mysensors.org/post/34267 ) but so far no-one who understands how that stuff works has had sufficient time and motivation to do the necessary work. The task is very complicated.

            skywatchS Offline
            skywatchS Offline
            skywatch
            wrote on last edited by
            #33

            @mfalkvidd #sad (as Donald Trump would put it).....

            Maybe think of removing.....
            " Don’t worry, we’ll explain everything."
            and....
            "We provide easy to follow build instructions, ready to use code examples and adaptable open source hardware designs."
            from the main page until the content matches the hype?

            Seriously - 3 YEARS ???? - Just how hard can it be?

            mfalkviddM zboblamontZ 2 Replies Last reply
            0
            • skywatchS skywatch

              @mfalkvidd #sad (as Donald Trump would put it).....

              Maybe think of removing.....
              " Don’t worry, we’ll explain everything."
              and....
              "We provide easy to follow build instructions, ready to use code examples and adaptable open source hardware designs."
              from the main page until the content matches the hype?

              Seriously - 3 YEARS ???? - Just how hard can it be?

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

              @skywatch if I ever get 2-3 days of continuous, undisturbed time I might be able to do it. But that will probably not happen anytime soon, and if it did happen there are probably other MySensors issues that would benefit more people I should focus on. Someone more skilled might be able to do it quicker.

              1 Reply Last reply
              1
              • skywatchS skywatch

                @mfalkvidd #sad (as Donald Trump would put it).....

                Maybe think of removing.....
                " Don’t worry, we’ll explain everything."
                and....
                "We provide easy to follow build instructions, ready to use code examples and adaptable open source hardware designs."
                from the main page until the content matches the hype?

                Seriously - 3 YEARS ???? - Just how hard can it be?

                zboblamontZ Offline
                zboblamontZ Offline
                zboblamont
                wrote on last edited by
                #35

                @skywatch #sad, as Donald Trump would put it - "Seriously - 3 YEARS ???? - Just how hard can it be?" - Well it you can't build a Wall yourself... ;)

                1 Reply Last reply
                0
                • skywatchS Offline
                  skywatchS Offline
                  skywatch
                  wrote on last edited by skywatch
                  #36

                  I just wish I could do it and post it, it is obviously needed.

                  @mfalkvidd - I wasn't suggesting it was your job to do this, but thanks for considering it. --- If I can help in any way let me know!
                  @zboblamont - I can't build a wall without mortar nor instructions on where and how high to build it (also bricks might come in handy come to think of it).

                  ....and before I upset anyone, I know this is not a paid for product. There are many talented people working freely behind the scenes to make it happen.
                  But it's all pointless if it is not accessable to the people who want to be a part of it. _ I don't want a degree level thesis, just an example or two to work from.

                  mfalkviddM 1 Reply Last reply
                  0
                  • skywatchS skywatch

                    I just wish I could do it and post it, it is obviously needed.

                    @mfalkvidd - I wasn't suggesting it was your job to do this, but thanks for considering it. --- If I can help in any way let me know!
                    @zboblamont - I can't build a wall without mortar nor instructions on where and how high to build it (also bricks might come in handy come to think of it).

                    ....and before I upset anyone, I know this is not a paid for product. There are many talented people working freely behind the scenes to make it happen.
                    But it's all pointless if it is not accessable to the people who want to be a part of it. _ I don't want a degree level thesis, just an example or two to work from.

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

                    @skywatch that's the hardest part. Making things so easy anyone can use it is 100x harder than just making it accessible to experienced people. I think MySensors has been able to make about 99% of what people want easily accessible. But the more stuff is easily accessible, people want to do more and more advanced stuff. So the more accessible things are, the less happy people are about it. This curse happens to all projects that are successful.

                    skywatchS 1 Reply Last reply
                    0
                    • mfalkviddM mfalkvidd

                      @skywatch that's the hardest part. Making things so easy anyone can use it is 100x harder than just making it accessible to experienced people. I think MySensors has been able to make about 99% of what people want easily accessible. But the more stuff is easily accessible, people want to do more and more advanced stuff. So the more accessible things are, the less happy people are about it. This curse happens to all projects that are successful.

                      skywatchS Offline
                      skywatchS Offline
                      skywatch
                      wrote on last edited by
                      #38

                      @mfalkvidd This is drifted well off topic now - can I PM you?

                      mfalkviddM 1 Reply Last reply
                      0
                      • skywatchS skywatch

                        @mfalkvidd This is drifted well off topic now - can I PM you?

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

                        @skywatch sure. But if the discussion is left in the open others can chip in, and others can read it and learn from it.

                        skywatchS 1 Reply Last reply
                        0
                        • mfalkviddM mfalkvidd

                          @skywatch sure. But if the discussion is left in the open others can chip in, and others can read it and learn from it.

                          skywatchS Offline
                          skywatchS Offline
                          skywatch
                          wrote on last edited by
                          #40

                          @mfalkvidd Today it did some real testing with the actual setup (not a test node) and it is all working really well so far.

                          I was expecting to have to use limit switches to detect up and down limits, with microswitches to provide emergency power cut out to the motors if it overran. I even considered timing the motion too (done this with Crestron systems and curtains in the past).

                          But I have had two really great surprises......

                          1. The little stepper motors, when set within their comfort zone, are very precise. It looks like just counting steps is all that is required.
                          2. The steppers draw just 77mA when opening the blind. This is such good news for me as solar powered blinds (with li-ion or lead acid battery) will last all year!

                          Big thanks to you all for the hints and finding where I mis-understood. It won't be easy, but I will get there in the end. ;)

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


                          16

                          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