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. 1.4 Beta

1.4 Beta

Scheduled Pinned Locked Moved Announcements
1.4betahelp
129 Posts 18 Posters 87.1k Views 4 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.
  • MisterEM Offline
    MisterEM Offline
    MisterE
    wrote on last edited by
    #4
    This post is deleted!
    1 Reply Last reply
    0
    • BSoftB BSoft

      While server was down, I've used a recent tab from this post. This file represent the mhl backup

      Due to server upload limits, removed one photo and zipped the mhl file. It is like it never happened. :)

      Arduino Library 1_4b1_ Call for beta testers_ MySensors Forum.zip

      MisterEM Offline
      MisterEM Offline
      MisterE
      wrote on last edited by
      #5

      @BSoft

      Crowd Backup (TM)

      1 Reply Last reply
      0
      • DammeD Offline
        DammeD Offline
        Damme
        Code Contributor
        wrote on last edited by
        #6

        Hello

        I'm using serialgateway and trying to interface with a linux machine.

        I setup serial with a simple stty -F /dev/ttyUSB0 cs8 115200 -onlcr -icrnl
        cat /dev/ttyUSB0 works fine;
        0;0;3;9;Arduino startup complete.
        0;0;3;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,cr=ok:
        255;255;3;3;

        but I am unable to send data from the gateway
        echo -n -e "255;255;3;4;1\n" > /dev/ttyUSB0

        Nothing happens, not even in perl I can get it to work.
        $port->write("255;255;3;4;1\n");

        what am I doing wrong?

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

          @Damme said:

          $port->write("255;255;3;4;1\n");

          Try
          $port->write("255;255;3;0;4;1\n");

          DammeD 1 Reply Last reply
          0
          • hekH hek

            @Damme said:

            $port->write("255;255;3;4;1\n");

            Try
            $port->write("255;255;3;0;4;1\n");

            DammeD Offline
            DammeD Offline
            Damme
            Code Contributor
            wrote on last edited by
            #8

            @hek

            Thanks, that worked. I thought I understood the message layout.. never seen that 0 before:)

            hekH 1 Reply Last reply
            0
            • DammeD Damme

              @hek

              Thanks, that worked. I thought I understood the message layout.. never seen that 0 before:)

              hekH Offline
              hekH Offline
              hek
              Admin
              wrote on last edited by
              #9

              @Damme said:

              Thanks, that worked. I thought I understood the message layout.. never seen that 0 before:)

              It's a change in the serial protocol for 1.4.
              1 = request ack back from destination node.
              0 = no ack.

              1 Reply Last reply
              0
              • jendrushJ Offline
                jendrushJ Offline
                jendrush
                wrote on last edited by jendrush
                #10

                @hek said:

                It's a change in the serial protocol for 1.4.

                Could you describe it better keeping in mind my problem with Relay? How the message should look like to turn on Relay? Previously message like this worked ok - 11;1;1;2;1.

                DammeD 1 Reply Last reply
                0
                • jendrushJ jendrush

                  @hek said:

                  It's a change in the serial protocol for 1.4.

                  Could you describe it better keeping in mind my problem with Relay? How the message should look like to turn on Relay? Previously message like this worked ok - 11;1;1;2;1.

                  DammeD Offline
                  DammeD Offline
                  Damme
                  Code Contributor
                  wrote on last edited by
                  #11

                  @jendrush I suppose it should be 11:1:1:0:2:1 then

                  @hek what about C_STREAM ? Didnt find much about it.

                  hekH jendrushJ 2 Replies Last reply
                  0
                  • DammeD Damme

                    @jendrush I suppose it should be 11:1:1:0:2:1 then

                    @hek what about C_STREAM ? Didnt find much about it.

                    hekH Offline
                    hekH Offline
                    hek
                    Admin
                    wrote on last edited by
                    #12

                    @Damme

                    It will be used for firmware updates.

                    DammeD 1 Reply Last reply
                    1
                    • DammeD Damme

                      @jendrush I suppose it should be 11:1:1:0:2:1 then

                      @hek what about C_STREAM ? Didnt find much about it.

                      jendrushJ Offline
                      jendrushJ Offline
                      jendrush
                      wrote on last edited by
                      #13

                      @Damme said:

                      I suppose it should be 11:1:1:0:2:1 then

                      I fugured it out yesterday, but thanx!

                      1 Reply Last reply
                      0
                      • hekH hek

                        @Damme

                        It will be used for firmware updates.

                        DammeD Offline
                        DammeD Offline
                        Damme
                        Code Contributor
                        wrote on last edited by Damme
                        #14

                        @hek

                        I just tried to send myself a picture over the network. real ugly code but it worked.. thought if I put a small cam and someone rings on the doorbell or something.. :) (Right now I just read the data from SPI flash)

                        hekH 1 Reply Last reply
                        1
                        • DammeD Damme

                          @hek

                          I just tried to send myself a picture over the network. real ugly code but it worked.. thought if I put a small cam and someone rings on the doorbell or something.. :) (Right now I just read the data from SPI flash)

                          hekH Offline
                          hekH Offline
                          hek
                          Admin
                          wrote on last edited by
                          #15

                          @Damme

                          great

                          1 Reply Last reply
                          0
                          • MisterEM Offline
                            MisterEM Offline
                            MisterE
                            wrote on last edited by
                            #16
                            This post is deleted!
                            1 Reply Last reply
                            0
                            • DammeD Offline
                              DammeD Offline
                              Damme
                              Code Contributor
                              wrote on last edited by Damme
                              #17

                              I've tried the lib for a while now and found the following:

                              Then using ack=1 the returned message is exacly the one I sent. No way of knowing if its a request or an ACK.

                              example:
                              Client sends
                              3;255;3;6;0 (Give me configuration 0 (btw, why not leave config as a byte 0-255 instead of hardcoing it? I could have plenty of uses for configuration-values.)
                              Gateway responds: 3;255;3;6;M and requests ack
                              client sends
                              3;255;3;6;M
                              my software tried to lookup config id 'M' (Not a big deal for letter, but what if its a number?)
                              maybe ACK should be some sort of incremental number in return in special message type. I dont really know what is best.
                              It would be great if GW resends the messsage automatically a couple of times (configurable) if ACK = 1.

                              I've also noticed during DEBUG enabled that the message gets overwritten by old one, i.e.

                              send: 3-3-0-0 s=255,c=0,t=18,pt=0,l=15,st=fail:1.4b1 (18848a2)
                              send: 3-3-0-0 s=255,c=3,t=11,pt=0,l=4,st=ok:test1 (18848a2)
                              send: 3-3-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:2.0t1 (18848a2)
                              (message 2: test1, message 3: 2.0)

                              Edit; One more thing
                              Do I really need one gw.process(); before each gw.send(..); in the loop? I seam to loose messages if I dont do like that.

                              void loop()
                              {
                              delay(dht.getMinimumSamplingPeriod());

                              gw.process();
                              float temperature = dht.getTemperature();
                              gw.send(msgTemp.set(temperature, 1));

                              gw.process();
                              float humidity = dht.getHumidity();
                              gw.send(msgHum.set(humidity, 1));

                              // gw.sleep(SLEEP_TIME); //Seems to break recieing message, loosing ~75%

                              }

                              YveauxY DammeD 2 Replies Last reply
                              0
                              • DammeD Damme

                                I've tried the lib for a while now and found the following:

                                Then using ack=1 the returned message is exacly the one I sent. No way of knowing if its a request or an ACK.

                                example:
                                Client sends
                                3;255;3;6;0 (Give me configuration 0 (btw, why not leave config as a byte 0-255 instead of hardcoing it? I could have plenty of uses for configuration-values.)
                                Gateway responds: 3;255;3;6;M and requests ack
                                client sends
                                3;255;3;6;M
                                my software tried to lookup config id 'M' (Not a big deal for letter, but what if its a number?)
                                maybe ACK should be some sort of incremental number in return in special message type. I dont really know what is best.
                                It would be great if GW resends the messsage automatically a couple of times (configurable) if ACK = 1.

                                I've also noticed during DEBUG enabled that the message gets overwritten by old one, i.e.

                                send: 3-3-0-0 s=255,c=0,t=18,pt=0,l=15,st=fail:1.4b1 (18848a2)
                                send: 3-3-0-0 s=255,c=3,t=11,pt=0,l=4,st=ok:test1 (18848a2)
                                send: 3-3-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:2.0t1 (18848a2)
                                (message 2: test1, message 3: 2.0)

                                Edit; One more thing
                                Do I really need one gw.process(); before each gw.send(..); in the loop? I seam to loose messages if I dont do like that.

                                void loop()
                                {
                                delay(dht.getMinimumSamplingPeriod());

                                gw.process();
                                float temperature = dht.getTemperature();
                                gw.send(msgTemp.set(temperature, 1));

                                gw.process();
                                float humidity = dht.getHumidity();
                                gw.send(msgHum.set(humidity, 1));

                                // gw.sleep(SLEEP_TIME); //Seems to break recieing message, loosing ~75%

                                }

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

                                @Damme Other wireless protocols usually have a counter which is increased with each message. Returning the counter as an ack would be sufficient to correlate the ack and the original message.
                                Returning the whole message seems like overkill indeed...

                                The send-methods could e.g. return the Id counter of the message sent, and an app waiting for an ack on that message should check for this value in any ack received (using some timeout)

                                http://yveaux.blogspot.nl

                                hekH 1 Reply Last reply
                                0
                                • DammeD Offline
                                  DammeD Offline
                                  Damme
                                  Code Contributor
                                  wrote on last edited by Damme
                                  #19

                                  Additional comment on config;
                                  I think it should be request config, response config messages.

                                  I also think its a bit odd that the actuator reports as
                                  gw.present(2, S_LIGHT);
                                  but requests as
                                  if (message.type==V_LIGHT) {

                                  V_LIGHT != S_LIGHT (2 vs 3)
                                  I think the def should follow as much as possible.

                                  hope any of my thoughts are somewhat useful

                                  YveauxY 1 Reply Last reply
                                  0
                                  • DammeD Damme

                                    Additional comment on config;
                                    I think it should be request config, response config messages.

                                    I also think its a bit odd that the actuator reports as
                                    gw.present(2, S_LIGHT);
                                    but requests as
                                    if (message.type==V_LIGHT) {

                                    V_LIGHT != S_LIGHT (2 vs 3)
                                    I think the def should follow as much as possible.

                                    hope any of my thoughts are somewhat useful

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

                                    @Damme there's a lot of Vera legacy in there... This forum had a discussion going on about decoupling from Vera, but I'm afraid that got lost in the crash...

                                    http://yveaux.blogspot.nl

                                    1 Reply Last reply
                                    0
                                    • DammeD Damme

                                      I've tried the lib for a while now and found the following:

                                      Then using ack=1 the returned message is exacly the one I sent. No way of knowing if its a request or an ACK.

                                      example:
                                      Client sends
                                      3;255;3;6;0 (Give me configuration 0 (btw, why not leave config as a byte 0-255 instead of hardcoing it? I could have plenty of uses for configuration-values.)
                                      Gateway responds: 3;255;3;6;M and requests ack
                                      client sends
                                      3;255;3;6;M
                                      my software tried to lookup config id 'M' (Not a big deal for letter, but what if its a number?)
                                      maybe ACK should be some sort of incremental number in return in special message type. I dont really know what is best.
                                      It would be great if GW resends the messsage automatically a couple of times (configurable) if ACK = 1.

                                      I've also noticed during DEBUG enabled that the message gets overwritten by old one, i.e.

                                      send: 3-3-0-0 s=255,c=0,t=18,pt=0,l=15,st=fail:1.4b1 (18848a2)
                                      send: 3-3-0-0 s=255,c=3,t=11,pt=0,l=4,st=ok:test1 (18848a2)
                                      send: 3-3-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:2.0t1 (18848a2)
                                      (message 2: test1, message 3: 2.0)

                                      Edit; One more thing
                                      Do I really need one gw.process(); before each gw.send(..); in the loop? I seam to loose messages if I dont do like that.

                                      void loop()
                                      {
                                      delay(dht.getMinimumSamplingPeriod());

                                      gw.process();
                                      float temperature = dht.getTemperature();
                                      gw.send(msgTemp.set(temperature, 1));

                                      gw.process();
                                      float humidity = dht.getHumidity();
                                      gw.send(msgHum.set(humidity, 1));

                                      // gw.sleep(SLEEP_TIME); //Seems to break recieing message, loosing ~75%

                                      }

                                      DammeD Offline
                                      DammeD Offline
                                      Damme
                                      Code Contributor
                                      wrote on last edited by
                                      #21

                                      @Damme said:

                                      // gw.sleep(SLEEP_TIME); //Seems to break recieing message, loosing ~75%

                                      me just dumb here, delay(SLEEP_TIME); works. gw.sleep puts radio in sleep I guess.

                                      hekH 1 Reply Last reply
                                      1
                                      • DammeD Damme

                                        @Damme said:

                                        // gw.sleep(SLEEP_TIME); //Seems to break recieing message, loosing ~75%

                                        me just dumb here, delay(SLEEP_TIME); works. gw.sleep puts radio in sleep I guess.

                                        hekH Offline
                                        hekH Offline
                                        hek
                                        Admin
                                        wrote on last edited by
                                        #22

                                        @Damme said:

                                        me just dumb here, delay(SLEEP_TIME); works. gw.sleep puts radio in sleep I guess.

                                        gw.sleep() puts both Arduino and radio to sleep.

                                        1 Reply Last reply
                                        0
                                        • YveauxY Yveaux

                                          @Damme Other wireless protocols usually have a counter which is increased with each message. Returning the counter as an ack would be sufficient to correlate the ack and the original message.
                                          Returning the whole message seems like overkill indeed...

                                          The send-methods could e.g. return the Id counter of the message sent, and an app waiting for an ack on that message should check for this value in any ack received (using some timeout)

                                          hekH Offline
                                          hekH Offline
                                          hek
                                          Admin
                                          wrote on last edited by
                                          #23

                                          @Yveaux said:

                                          The send-methods could e.g. return the Id counter of the message sent, and an app waiting for an ack on that message should check for this value in any ack received (using some timeout)

                                          That mean you might have to rememeber the original message. The idea is to have all the information necessary in the callback.
                                          In my example sketches (e.g. RelayActuator) the ack message actually changes the relay status when the ack comes back from gateway. If not full message came in you would have to keep buffers with sent messages and start matching counter-values. Much more complicated.

                                          But a message counter will probably be necessary if/when we start encrypting messages to prohibit replay attacks.

                                          @Damme
                                          I actually thought about having a bit in the message header which says if the message is an ack or not. With that implemented you would just call a msg.isAck() to determine if the incoming message is an ack message. Would that be ok?

                                          You shouldn't need to call gw.process() after each send. It is only necessary in the loop() section if you expect incoming messages or have enabled repeater mode.

                                          I don't understand what you mean with messages getting overwritten with DEBUG enabled. Could you explain it a bit more (with an example?).

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


                                          8

                                          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