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. Announcements
  3. 💬 Serial Protocol - 2.x

💬 Serial Protocol - 2.x

Scheduled Pinned Locked Moved Announcements
43 Posts 17 Posters 10.7k Views 13 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.
  • mfalkviddM mfalkvidd

    @gvorster see https://forum.mysensors.org/post/43373

    G Offline
    G Offline
    gvorster
    wrote on last edited by
    #21

    @mfalkvidd said in 💬 Serial Protocol - 2.x:

    @gvorster see https://forum.mysensors.org/post/43373

    Thanks, got it now.

    1 Reply Last reply
    1
    • siodS Offline
      siodS Offline
      siod
      wrote on last edited by siod
      #22

      how can I handle sendheartbeat() messages in my controller? What payload will be sent? 1 or 0, True or False...?

      ps I´m using openhab

      still learning...

      G 1 Reply Last reply
      0
      • siodS siod

        how can I handle sendheartbeat() messages in my controller? What payload will be sent? 1 or 0, True or False...?

        ps I´m using openhab

        G Offline
        G Offline
        gvorster
        wrote on last edited by
        #23

        @siod said in 💬 Serial Protocol - 2.x:

        how can I handle sendheartbeat() messages in my controller? What payload will be sent? 1 or 0, True or False...?

        ps I´m using openhab

        I just tested this using a Serial gateway.

        Sending sendHeartbeat() from node displays this on my Serial gateway:

        ...
        214;255;3;0;22;73
        214;255;3;0;22;108
        214;255;3;0;22;143
        ...
        

        3=internal message
        0=nack
        22=I_HEARTBEAT_RESPONSE

        In MyTransport.cpp I found

        uint32_t transportGetHeartbeat(void)
        {
        	return transportTimeInState();
        }
        
        ---
        
        uint32_t transportTimeInState(void)
        {
        	return hwMillis() - _transportSM.stateEnter;
        }
        

        So the payload is some elapsed time in milliseconds.

        siodS 1 Reply Last reply
        0
        • G gvorster

          @siod said in 💬 Serial Protocol - 2.x:

          how can I handle sendheartbeat() messages in my controller? What payload will be sent? 1 or 0, True or False...?

          ps I´m using openhab

          I just tested this using a Serial gateway.

          Sending sendHeartbeat() from node displays this on my Serial gateway:

          ...
          214;255;3;0;22;73
          214;255;3;0;22;108
          214;255;3;0;22;143
          ...
          

          3=internal message
          0=nack
          22=I_HEARTBEAT_RESPONSE

          In MyTransport.cpp I found

          uint32_t transportGetHeartbeat(void)
          {
          	return transportTimeInState();
          }
          
          ---
          
          uint32_t transportTimeInState(void)
          {
          	return hwMillis() - _transportSM.stateEnter;
          }
          

          So the payload is some elapsed time in milliseconds.

          siodS Offline
          siodS Offline
          siod
          wrote on last edited by
          #24

          @gvorster Thank you for explanation!

          One more thing: I wanted to implement a sendHeartbeat() into a Repeater node (which should never sleep!), where should I put this function and how? When putting it just into the loop it is of course spamming my gateway with heartbeat messages...Is it possible anyway?

          still learning...

          G 1 Reply Last reply
          0
          • siodS siod

            @gvorster Thank you for explanation!

            One more thing: I wanted to implement a sendHeartbeat() into a Repeater node (which should never sleep!), where should I put this function and how? When putting it just into the loop it is of course spamming my gateway with heartbeat messages...Is it possible anyway?

            G Offline
            G Offline
            gvorster
            wrote on last edited by
            #25

            @siod said in 💬 Serial Protocol - 2.x:

            @gvorster Thank you for explanation!

            One more thing: I wanted to implement a sendHeartbeat() into a Repeater node (which should never sleep!), where should I put this function and how? When putting it just into the loop it is of course spamming my gateway with heartbeat messages...Is it possible anyway?

            There are many examples code how to do this. One Timer library I use myself is this https://playground.arduino.cc/Code/Timer

            e.g. for a repeater you could use this:

            #include "Timer.h"
            
            Timer t;
            
            void setup() {
                t.every(60000, sendImAlive);
            }
            
            void loop() {
                t.update();
            }
            
            void sendImAlive() {
                sendHeartbeat();
            }
            
            1 Reply Last reply
            1
            • S Offline
              S Offline
              shabba
              wrote on last edited by
              #26

              What is the best for a push button? I have a button to open a lock. The button cannot lock the lock however. So binary is not really a proper option?

              1 Reply Last reply
              0
              • hekH Online
                hekH Online
                hek
                Admin
                wrote on last edited by
                #27

                ATM scene controller is probably the best option.

                https://github.com/mysensors/MySensors/issues/724

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dmurphy
                  wrote on last edited by
                  #28

                  S_SPRINKLER is defined as having V_STATUS and V_TRIPPED - no V_ARMED....but V_ARMED says it is in S_SPRINKLER...Which way should I code this up for my controller??

                  1 Reply Last reply
                  0
                  • jjkJ Offline
                    jjkJ Offline
                    jjk
                    wrote on last edited by
                    #29

                    Hi there,
                    do you know that, you've built a node like a 100 times and I think it's all routine and then something that completely bluffs you? I happened to me with a simple Temp/Hum node (DHT22) that keeps sending me messages that I can't seem to figure out: 43;255;3;0;33;300000 and 43;255;3;0;32;500 - They seem to show up in the frequency that other nodes send a heartbeat signal, but no heartbeat is sent from this node. The regular DHT22 datapoints are sent as normal. Anyone knows what this means?

                    1 Reply Last reply
                    0
                    • gohanG Offline
                      gohanG Offline
                      gohan
                      Mod
                      wrote on last edited by
                      #30

                      Are you using smart sleep?

                      1 Reply Last reply
                      0
                      • jjkJ Offline
                        jjkJ Offline
                        jjk
                        wrote on last edited by
                        #31

                        yes, I do - like on every other DHT node as well, but never had that...?! Plus, I can't seem to figure out what the messages mean.

                        1 Reply Last reply
                        0
                        • gohanG Offline
                          gohanG Offline
                          gohan
                          Mod
                          wrote on last edited by
                          #32

                          I assume the 300000 is the sleep time you set while the 500 is the smart sleep embedded 500ms wait that lets the controller know the node is about to go to sleep but it is going to wait for 500ms for queued commands to be sent to the node

                          1 Reply Last reply
                          1
                          • jjkJ Offline
                            jjkJ Offline
                            jjk
                            wrote on last edited by
                            #33

                            hm, you might be right on the 300000 as that#s indeed the smartsleep wait time I'm setting. Not sure about the 500, but certainly possible (is that documented somewhere?) I'm wondering, though, why this node is sending this info, but not the other ones?! I don't think I have changed anything t the sketch other than the node-id and node name...

                            1 Reply Last reply
                            0
                            • gohanG Offline
                              gohanG Offline
                              gohan
                              Mod
                              wrote on last edited by
                              #34

                              500ms is the default setting when using smartsleep

                              1 Reply Last reply
                              0
                              • jjkJ Offline
                                jjkJ Offline
                                jjk
                                wrote on last edited by
                                #35

                                o.k., fair enough, that's a great explanation! - I'm still struggling, though, with why this node is sending this (but no heartbeat), but none of the previous ones I did...

                                1 Reply Last reply
                                0
                                • gohanG Offline
                                  gohanG Offline
                                  gohan
                                  Mod
                                  wrote on last edited by
                                  #36

                                  Try reflash the older node, maybe you updated library or else. Why do you need heatbeat if the node is sending every 5 minutes?

                                  jjkJ 1 Reply Last reply
                                  0
                                  • gohanG gohan

                                    Try reflash the older node, maybe you updated library or else. Why do you need heatbeat if the node is sending every 5 minutes?

                                    jjkJ Offline
                                    jjkJ Offline
                                    jjk
                                    wrote on last edited by
                                    #37

                                    @gohan fair question, I don't need it, it's just still in the code and besides, the 5 min message from smartsleep seems to show up every two mins (the heartbeaat rate)
                                    And yes, I did indeed update the library, so maybe that's why. Turns out, the bigger problem is that these message seem to cause an exception in the openhab mysensor binding, so at best I'd like to figure out how to stop the node from sending them... Will do some digging

                                    1 Reply Last reply
                                    0
                                    • gohanG Offline
                                      gohanG Offline
                                      gohan
                                      Mod
                                      wrote on last edited by
                                      #38

                                      Are you sure it is the smartsleep? Since you are debugging, use https://www.mysensors.org/build/parser to decode messages to a more human readable format

                                      1 Reply Last reply
                                      0
                                      • jjkJ Offline
                                        jjkJ Offline
                                        jjk
                                        wrote on last edited by
                                        #39

                                        yes, I am sure now: https://forum.mysensors.org/topic/8933/mysensors-2-2-0-released/27

                                        Looks like the only way to eliminate the messages is to not use smartsleep ;)

                                        1 Reply Last reply
                                        0
                                        • gohanG Offline
                                          gohanG Offline
                                          gohan
                                          Mod
                                          wrote on last edited by
                                          #40

                                          You may need to get in touch with openhab binding developer to fix that

                                          jjkJ 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.0k

                                          Posts


                                          Copyright 2019 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