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.
  • tbowmoT Offline
    tbowmoT Offline
    tbowmo
    Admin
    wrote on last edited by
    #7

    @Zeph

    As the binary protocol is breaking things anyways, we could break it so it becomes right :) So it doesn't have to map 1:1 with the old protocol.

    I think that we had the ASCII protocol so much in the heads, when we started looking at a future (binary) protocol it was made 1:1.. But it's not finalized at all yet, so it's still very open for comments :)

    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #8

      There has been some discussions on making it possible to use redundant gateways. Serious use of home automation will need the communication to be working all the time. Maybe that's something to consider.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        robosensor
        wrote on last edited by
        #9

        Is there any chances that binary protocol will support sending of multiple sensor values per one message?

        I'm talking about nodes that (for example) sending several binary switch sensor values with 1-byte value. Even if one set/req message contains 5 fields (5 bytes, currently Sensor id, Var type, Ack-thing (request ack / is ack), Payload type (integer, float, string, binary), Payload) it's possible to pack at least 4-5 results into single 32-byte message. This will reduce the load on the radio network 5 times. Also this will reduce gateway's load. It's also possible to remove duplicating fields and further reduce protocol.

        For example, some of my nodes sending 5 temperatures from ds18b20 sensors. Packing all 5 temps into single message (2 bytes for temp and 1 byte for sensor id) will reduce traffic 5 times.

        Packing/unpacking can be done at gateway side.

        1 Reply Last reply
        0
        • tbowmoT Offline
          tbowmoT Offline
          tbowmo
          Admin
          wrote on last edited by
          #10

          @robosensor

          the protocol spec is still in very early draft.. That said, I would really like to keep things as simple as possible on the node side, in order to conserve flash / ram space as much as possible..

          But let's see, it might be a year before we have something ready.. And it will probably be mysensors 3.0 that will get the new protocol, as it will probably break compatibility in every way possible :D

          Z 1 Reply Last reply
          0
          • tbowmoT tbowmo

            @robosensor

            the protocol spec is still in very early draft.. That said, I would really like to keep things as simple as possible on the node side, in order to conserve flash / ram space as much as possible..

            But let's see, it might be a year before we have something ready.. And it will probably be mysensors 3.0 that will get the new protocol, as it will probably break compatibility in every way possible :D

            Z Offline
            Z Offline
            Zeph
            Hero Member
            wrote on last edited by
            #11

            @tbowmo I agree with keeping things simple to implement, particularly on the Node & Gateway side. And it doesn't hurt that this would likely also keep things simpler to implement on the Controller side (ie: simpler plug-ins/adapters/drivers to write, which is a positive even when resources are not so tight.).

            We might be able to nevertheless implement some kind of multi-value packet concept tho. I added a comment to the 3.0 doc about a simple and low overhead way to allow homogeneous arrays. That might or might not be worthwhile.

            Robosensors's use case would involve some kind of tagged sub-unit approach, with multiple id/value pairs, yet another concept worth considering.

            1 Reply Last reply
            0
            • martinhjelmareM Offline
              martinhjelmareM Offline
              martinhjelmare
              Plugin Developer
              wrote on last edited by
              #12

              Regarding V_POSITION and using semi-colons inside the payload, that will in my view break the API message structure. At least home assistant/pymysensors will not work with this. I'll build for and recommend users of that controller to use comma instead of semi-colon to split info inside the payload for V_POSITION.

              1 Reply Last reply
              0
              • R Offline
                R Offline
                RWoerz
                wrote on last edited by
                #13

                This is just what I've been looking for. I do however have a suggestion. I'm building a solar heater (water) for my shop and need to keep track of at least 3 temps (solar panel, storage tank, and inside shop), 1 water pressure and 1 water flow meter (for solar panel Pump) . There doesn't seem to be V_ or S_ variables for direct water pressure or flow. Would you please add something for them.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  RWoerz
                  wrote on last edited by
                  #14

                  Sorry I found V_FLOW 34 Flow of water (in meter) S_WATER. What exactly does "in meter" mean?

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    musthafa
                    wrote on last edited by
                    #15

                    Can we have S_SWITCH for Wall switches, door bell switches etc ?

                    mfalkviddM 1 Reply Last reply
                    0
                    • M musthafa

                      Can we have S_SWITCH for Wall switches, door bell switches etc ?

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

                      @musthafa is there a reason S_BINARY can't be used for those cases?

                      M 1 Reply Last reply
                      0
                      • mfalkviddM mfalkvidd

                        @musthafa is there a reason S_BINARY can't be used for those cases?

                        M Offline
                        M Offline
                        musthafa
                        wrote on last edited by
                        #17

                        @mfalkvidd said:

                        @musthafa is there a reason S_BINARY can't be used for those cases?

                        Thanks. Didn't look at it. Solved my problem.

                        mfalkviddM 1 Reply Last reply
                        1
                        • M musthafa

                          @mfalkvidd said:

                          @musthafa is there a reason S_BINARY can't be used for those cases?

                          Thanks. Didn't look at it. Solved my problem.

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

                          @musthafa great! Thanks for reporting back.

                          1 Reply Last reply
                          0
                          • G Offline
                            G Offline
                            gvorster
                            wrote on last edited by
                            #19

                            Where can I find the structure for the payload of the internal command I_LOG_MESSAGE ? e.g. payload "TSF:MSG:SEND,211-0-220-220,s=211,c=1,t=23,pt=2,l=2,sg=0,ft=0,st=OK:69"
                            I know I'm sending a value from node 211 to node 220 with the value 69. What does c=1, t=23, pt=2, l=2, sg=0,ft=0 mean?

                            mfalkviddM 1 Reply Last reply
                            0
                            • G gvorster

                              Where can I find the structure for the payload of the internal command I_LOG_MESSAGE ? e.g. payload "TSF:MSG:SEND,211-0-220-220,s=211,c=1,t=23,pt=2,l=2,sg=0,ft=0,st=OK:69"
                              I know I'm sending a value from node 211 to node 220 with the value 69. What does c=1, t=23, pt=2, l=2, sg=0,ft=0 mean?

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

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

                              G 1 Reply Last reply
                              1
                              • 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
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          19

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          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