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. Converting a sketch from 1.5.x to 2.0.x

Converting a sketch from 1.5.x to 2.0.x

Scheduled Pinned Locked Moved Announcements
52 Posts 21 Posters 31.9k Views 26 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.
  • M Offline
    M Offline
    moskovskiy82
    wrote on last edited by
    #23

    Little bit confused. reading through the release notes...

    Deprecated variables: V_DIMMER (use V_PERCENTAGE), V_HEATER (use V_HVAC_FLOW_STATE), V_LIGHT (use V_STATUS)
    

    Now back to the API page for 2.0...

    S_DIMMER	4	Dimmable device of some kind	V_STATUS (on/off), V_DIMMER (dimmer level 0-100), V_WATT
    

    WHICH ONE TRUST?!

    YveauxY 1 Reply Last reply
    0
    • M Offline
      M Offline
      moskovskiy82
      wrote on last edited by
      #24

      And if my loop statement consists only of

      void loop() 
      { gw.process(); }
      

      Rewrite like
      void loop() { }

      or exclude loop completely?

      YveauxY 1 Reply Last reply
      0
      • M moskovskiy82

        And if my loop statement consists only of

        void loop() 
        { gw.process(); }
        

        Rewrite like
        void loop() { }

        or exclude loop completely?

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

        @moskovskiy82 said:

        Rewrite like
        void loop() { }

        That's correct

        http://yveaux.blogspot.nl

        1 Reply Last reply
        0
        • M moskovskiy82

          Little bit confused. reading through the release notes...

          Deprecated variables: V_DIMMER (use V_PERCENTAGE), V_HEATER (use V_HVAC_FLOW_STATE), V_LIGHT (use V_STATUS)
          

          Now back to the API page for 2.0...

          S_DIMMER	4	Dimmable device of some kind	V_STATUS (on/off), V_DIMMER (dimmer level 0-100), V_WATT
          

          WHICH ONE TRUST?!

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

          @moskovskiy82 said:

          WHICH ONE TRUST?!

          The release notes (as I added this statement ;-) )

          http://yveaux.blogspot.nl

          1 Reply Last reply
          0
          • Maurizio ColluM Offline
            Maurizio ColluM Offline
            Maurizio Collu
            wrote on last edited by
            #27

            Dear all, I'm a bit lost.
            I upgraded the library in Arduino to 2.0.0 and now I am having big problems.

            I downloaded the sketch for the relay from the MySensors website:
            https://www.mysensors.org/build/relay
            but I suppose this is still for 1.5

            I tried to modify the sketch as suggested - I do not receive any compiling error, but the skectch simply does not do anything. If I use the "monitor" in Arduino IDE, I do not see anything 0_1469262004446_RelayActuator2.ino

            There must be something fundamentally wrong in my code, can anyone help?

            mfalkviddM Boots33B 2 Replies Last reply
            0
            • Maurizio ColluM Maurizio Collu

              Dear all, I'm a bit lost.
              I upgraded the library in Arduino to 2.0.0 and now I am having big problems.

              I downloaded the sketch for the relay from the MySensors website:
              https://www.mysensors.org/build/relay
              but I suppose this is still for 1.5

              I tried to modify the sketch as suggested - I do not receive any compiling error, but the skectch simply does not do anything. If I use the "monitor" in Arduino IDE, I do not see anything 0_1469262004446_RelayActuator2.ino

              There must be something fundamentally wrong in my code, can anyone help?

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

              @Maurizio-Collu the examples for 2.0 are included in the library. They can be opened directly fromthe Examples menu in the Arduino IDE. It is also possible to fetch the examples from github, see https://github.com/mysensors/MySensors/tree/development/examples/RelayActuator For the relay example.

              Maurizio ColluM 1 Reply Last reply
              0
              • Maurizio ColluM Maurizio Collu

                Dear all, I'm a bit lost.
                I upgraded the library in Arduino to 2.0.0 and now I am having big problems.

                I downloaded the sketch for the relay from the MySensors website:
                https://www.mysensors.org/build/relay
                but I suppose this is still for 1.5

                I tried to modify the sketch as suggested - I do not receive any compiling error, but the skectch simply does not do anything. If I use the "monitor" in Arduino IDE, I do not see anything 0_1469262004446_RelayActuator2.ino

                There must be something fundamentally wrong in my code, can anyone help?

                Boots33B Offline
                Boots33B Offline
                Boots33
                Hero Member
                wrote on last edited by
                #29

                @Maurizio-Collu

                You have a few mistakes in your sketch, Download the V2 sketch that @mfalkvidd has pointed you to and compare the two side by side. you will soon see where you have gone wrong. don't forget you will need to update your gateway to V2 as well, a version 1.5 gateway will not connect with a version 2 node.

                1 Reply Last reply
                0
                • mfalkviddM mfalkvidd

                  @Maurizio-Collu the examples for 2.0 are included in the library. They can be opened directly fromthe Examples menu in the Arduino IDE. It is also possible to fetch the examples from github, see https://github.com/mysensors/MySensors/tree/development/examples/RelayActuator For the relay example.

                  Maurizio ColluM Offline
                  Maurizio ColluM Offline
                  Maurizio Collu
                  wrote on last edited by
                  #30

                  @mfalkvidd @Boots33

                  Thanks a lot, I knew I was missing something basic. For the newbies like me, it would be good to mention this somewhere (if you have not done so already and I missed it).

                  In the Home Assistant website it is mentioned that they only support 1.4 and 1.5. I'm trying with 2.0.

                  Thanks Again

                  martinhjelmareM 1 Reply Last reply
                  0
                  • Maurizio ColluM Maurizio Collu

                    @mfalkvidd @Boots33

                    Thanks a lot, I knew I was missing something basic. For the newbies like me, it would be good to mention this somewhere (if you have not done so already and I missed it).

                    In the Home Assistant website it is mentioned that they only support 1.4 and 1.5. I'm trying with 2.0.

                    Thanks Again

                    martinhjelmareM Offline
                    martinhjelmareM Offline
                    martinhjelmare
                    Plugin Developer
                    wrote on last edited by
                    #31

                    @Maurizio-Collu

                    2.0 should work with home assistant, but all new features of 2.0 are not supported yet. WIP.

                    Maurizio ColluM 1 Reply Last reply
                    1
                    • rchampR Offline
                      rchampR Offline
                      rchamp
                      wrote on last edited by rchamp
                      #32

                      I'm trying to upgrade my gateway to 2.0, but every time I go to upload, I get a 'error' not in sync.

                      I'm using just a standard nano w/ NRF24.

                      Note, my hardware profile is set properly to nano, 328p and proper com.

                      I restart app, and switched to my APM hardware profile and loaded my new 2.0 sensor code into my new APM node (DHT11 + motion) and was able to upload no problem.

                      Is there something i'm missing for the gateway?

                      Idon'tunderstandwhatwouldcauseittostopbeingabletocommunicate,

                      1 Reply Last reply
                      0
                      • hekH Offline
                        hekH Offline
                        hek
                        Admin
                        wrote on last edited by
                        #33

                        Are you able to upload some other sketch to the nano?
                        Or has something bad happen to the FTDI chip on your nano perhaps?

                        rchampR 1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          moskovskiy82
                          wrote on last edited by
                          #34

                          Just for clarification. V2.0 gateway (MQTT client esp8266) - will it work with the 1.5/1.6 sensors? Or everything needs to be flashed as soon as possible?

                          1 Reply Last reply
                          0
                          • hekH hek

                            Are you able to upload some other sketch to the nano?
                            Or has something bad happen to the FTDI chip on your nano perhaps?

                            rchampR Offline
                            rchampR Offline
                            rchamp
                            wrote on last edited by
                            #35

                            @hek it's actually a close nano with an FTDI board connected via serial inputs. I had this directly connected to my Vera, and communication with my old sensors was working just fine.

                            EDIT: Fixed. All in all, it was user error. I was trying to connect through FTDI adapter. I unplugged FTDI board, connected USB directly to nano clone, and upload worked fine.

                            Do I need to update mysensors plugin as well on Vera UI5?

                            1 Reply Last reply
                            0
                            • hekH Offline
                              hekH Offline
                              hek
                              Admin
                              wrote on last edited by
                              #36

                              @rchamp said:

                              Do I need to update mysensors plugin as well on Vera UI5?

                              No, shouldn't be necessary.

                              1 Reply Last reply
                              0
                              • hekH Offline
                                hekH Offline
                                hek
                                Admin
                                wrote on last edited by
                                #37

                                @moskovskiy82 said:

                                Just for clarification. V2.0 gateway (MQTT client esp8266) - will it work with the 1.5/1.6 sensors?

                                You could try, but the recommendation is to update the nodes as well.

                                1 Reply Last reply
                                0
                                • martinhjelmareM martinhjelmare

                                  @Maurizio-Collu

                                  2.0 should work with home assistant, but all new features of 2.0 are not supported yet. WIP.

                                  Maurizio ColluM Offline
                                  Maurizio ColluM Offline
                                  Maurizio Collu
                                  wrote on last edited by
                                  #38

                                  @martinhjelmare
                                  Thanks Martin.

                                  I uploaded the GatewaySerial to the arduino working as gateway, but if I upload the sketch and I open the monitor, I obtain this error:

                                  0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
                                  0;255;3;0;9;TSM:INIT
                                  0;255;3;0;9;!TSM:RADIO:FAIL
                                  0;255;3;0;9;!TSM:FAILURE
                                  0;255;3;0;9;TSM:PDT

                                  What does it mean?

                                  Maurizio ColluM martinhjelmareM 2 Replies Last reply
                                  0
                                  • Maurizio ColluM Maurizio Collu

                                    @martinhjelmare
                                    Thanks Martin.

                                    I uploaded the GatewaySerial to the arduino working as gateway, but if I upload the sketch and I open the monitor, I obtain this error:

                                    0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
                                    0;255;3;0;9;TSM:INIT
                                    0;255;3;0;9;!TSM:RADIO:FAIL
                                    0;255;3;0;9;!TSM:FAILURE
                                    0;255;3;0;9;TSM:PDT

                                    What does it mean?

                                    Maurizio ColluM Offline
                                    Maurizio ColluM Offline
                                    Maurizio Collu
                                    wrote on last edited by
                                    #39

                                    @martinhjelmare
                                    Plus, when starting home assistant, I get this error

                                    16-07-26 23:03:44 homeassistant.bootstrap: Error during setup of component mysensors
                                    Traceback (most recent call last):
                                    File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 62, in setup_gateway
                                    socket.inet_aton(device)
                                    OSError: illegal IP address string passed to inet_aton

                                    During handling of the above exception, another exception occurred:

                                    Traceback (most recent call last):
                                    File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 150, in _setup_component
                                    if not component.setup(hass, config):
                                    File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 109, in setup
                                    device, persistence_file, baud_rate, tcp_port)
                                    File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 73, in setup_gateway
                                    baud=baud_rate)
                                    File "/home/pi/.homeassistant/deps/mysensors/mysensors.py", line 326, in init
                                    persistence_file, protocol_version)
                                    File "/home/pi/.homeassistant/deps/mysensors/mysensors.py", line 40, in init
                                    self.const = _const
                                    UnboundLocalError: local variable '_const' referenced before assignment

                                    martinhjelmareM 1 Reply Last reply
                                    0
                                    • Maurizio ColluM Maurizio Collu

                                      @martinhjelmare
                                      Plus, when starting home assistant, I get this error

                                      16-07-26 23:03:44 homeassistant.bootstrap: Error during setup of component mysensors
                                      Traceback (most recent call last):
                                      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 62, in setup_gateway
                                      socket.inet_aton(device)
                                      OSError: illegal IP address string passed to inet_aton

                                      During handling of the above exception, another exception occurred:

                                      Traceback (most recent call last):
                                      File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 150, in _setup_component
                                      if not component.setup(hass, config):
                                      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 109, in setup
                                      device, persistence_file, baud_rate, tcp_port)
                                      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 73, in setup_gateway
                                      baud=baud_rate)
                                      File "/home/pi/.homeassistant/deps/mysensors/mysensors.py", line 326, in init
                                      persistence_file, protocol_version)
                                      File "/home/pi/.homeassistant/deps/mysensors/mysensors.py", line 40, in init
                                      self.const = _const
                                      UnboundLocalError: local variable '_const' referenced before assignment

                                      martinhjelmareM Offline
                                      martinhjelmareM Offline
                                      martinhjelmare
                                      Plugin Developer
                                      wrote on last edited by martinhjelmare
                                      #40

                                      @Maurizio-Collu

                                      Regarding the error in home assistant, that's a bug, due to specifying mysensors version other than 1.4 or 1.5. Use 1.5 and you should be fine. The bug is fixed in the dev branch of pymysensors and will be fixed in home assistant when real mysensors 2.0 support is merged. WIP.

                                      Please post home assistant topics in the home assistant category under controllers. This is off topic in this thread.

                                      1 Reply Last reply
                                      0
                                      • Maurizio ColluM Maurizio Collu

                                        @martinhjelmare
                                        Thanks Martin.

                                        I uploaded the GatewaySerial to the arduino working as gateway, but if I upload the sketch and I open the monitor, I obtain this error:

                                        0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
                                        0;255;3;0;9;TSM:INIT
                                        0;255;3;0;9;!TSM:RADIO:FAIL
                                        0;255;3;0;9;!TSM:FAILURE
                                        0;255;3;0;9;TSM:PDT

                                        What does it mean?

                                        martinhjelmareM Offline
                                        martinhjelmareM Offline
                                        martinhjelmare
                                        Plugin Developer
                                        wrote on last edited by
                                        #41

                                        @Maurizio-Collu said:

                                        @martinhjelmare
                                        Thanks Martin.

                                        I uploaded the GatewaySerial to the arduino working as gateway, but if I upload the sketch and I open the monitor, I obtain this error:

                                        0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
                                        0;255;3;0;9;TSM:INIT
                                        0;255;3;0;9;!TSM:RADIO:FAIL
                                        0;255;3;0;9;!TSM:FAILURE
                                        0;255;3;0;9;TSM:PDT

                                        What does it mean?

                                        @tekka knows this best, and he wrote a post explaining some of those messages here:
                                        https://forum.mysensors.org/topic/4347/can-t-get-sensors-talking/3

                                        Maurizio ColluM 1 Reply Last reply
                                        0
                                        • martinhjelmareM martinhjelmare

                                          @Maurizio-Collu said:

                                          @martinhjelmare
                                          Thanks Martin.

                                          I uploaded the GatewaySerial to the arduino working as gateway, but if I upload the sketch and I open the monitor, I obtain this error:

                                          0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
                                          0;255;3;0;9;TSM:INIT
                                          0;255;3;0;9;!TSM:RADIO:FAIL
                                          0;255;3;0;9;!TSM:FAILURE
                                          0;255;3;0;9;TSM:PDT

                                          What does it mean?

                                          @tekka knows this best, and he wrote a post explaining some of those messages here:
                                          https://forum.mysensors.org/topic/4347/can-t-get-sensors-talking/3

                                          Maurizio ColluM Offline
                                          Maurizio ColluM Offline
                                          Maurizio Collu
                                          wrote on last edited by
                                          #42

                                          @martinhjelmare Thanks a ot.
                                          Is there any guide/manual where all these messages are explained?

                                          Plus, is there anywhere written what all these terms mean?

                                          TSP:MSG:SEND 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=ok:

                                          Kind Regards

                                          mfalkviddM tekkaT 2 Replies Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          10

                                          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