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. Bug Reports
  3. Strange value being sent from controller using mixed temp/relay node

Strange value being sent from controller using mixed temp/relay node

Scheduled Pinned Locked Moved Bug Reports
multiple sensormqtterror
42 Posts 6 Posters 16.9k Views 3 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.
  • G Offline
    G Offline
    Gambituk
    wrote on last edited by
    #14

    0;0;3;0;9;read: 25-25-0 s=0,c=0,t=0,pt=0,l=5:1.4.1
    0;0;3;0;9;read: 25-25-0 s=1,c=0,t=0,pt=0,l=5:1.4.1
    0;0;3;0;9;read: 25-25-0 s=2,c=0,t=0,pt=0,l=5:1.4.1
    0;0;3;0;9;read: 25-25-0 s=4,c=0,t=3,pt=0,l=5:1.4.1
    0;0;3;0;9;read: 25-25-0 s=5,c=0,t=3,pt=0,l=5:1.4.1

    So far it seems to create 0,1,2,4,5 but i think that's not going to be a problem, just working my way through to figure what else i need to change for the callback? (and what a callback is :D )

    Thanks for the help so far!

    1 Reply Last reply
    0
    • BulldogLowellB Offline
      BulldogLowellB Offline
      BulldogLowell
      Contest Winner
      wrote on last edited by
      #15

      @Gambituk said:

      what else i need to change for the callback?

      the call back function:

      incomingMessage()
      

      look to get this right:

      digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
      

      so that the command matches the sensor numbers...

      G 1 Reply Last reply
      0
      • BulldogLowellB BulldogLowell

        @Gambituk said:

        what else i need to change for the callback?

        the call back function:

        incomingMessage()
        

        look to get this right:

        digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
        

        so that the command matches the sensor numbers...

        G Offline
        G Offline
        Gambituk
        wrote on last edited by
        #16

        @BulldogLowell

        for (int sensor=1, pin=RELAY_1 ; sensor <= NUMBER_OF_RELAYS ; sensor++ , pin++)
        {
        gw.present(NUMBER_OF_TEMP_SENSORS + sensor, S_LIGHT); // should create 3 and 4

        For the earlier part, should this be "for (int sensor=0" to get 3 and 4?

        I get 4 and 5 ... But either way, i dont suppose it matters that there is a gap of 1 in the sensor child id's.

        1. I change the callback to this:

          digitalWrite(message.sensor - 4 + RELAY_1, message.getBool() ? RELAY_ON : RELAY_OFF);

        and that works.... i can send a message and it activates the relay.. :D

        1. BUT.... :(

           repeater started, id 25
           send: 25-25-0-0 s=255,c=0,t=18,pt=0,l=5,st=ok:1.4.1
           send: 25-25-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
           read: 0-0-25 s=255,c=3,t=6,pt=0,l=1:M
           send: 25-25-0-0 s=255,c=3,t=11,pt=0,l=15,st=ok:Temp and Relays
           send: 25-25-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0
           send: 25-25-0-0 s=0,c=0,t=0,pt=0,l=5,st=ok:1.4.1
           send: 25-25-0-0 s=1,c=0,t=0,pt=0,l=5,st=ok:1.4.1
           send: 25-25-0-0 s=2,c=0,t=0,pt=0,l=5,st=ok:1.4.1
           send: 25-25-0-0 s=4,c=0,t=3,pt=0,l=5,st=ok:1.4.1
           send: 25-25-0-0 s=5,c=0,t=3,pt=0,l=5,st=ok:1.4.1
           send: 25-25-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:19.1
          

        Here i am sending a message with 1 and then 0 to relay id4 and then the same to relay id5 -It works, but i still have the 1.3 and 0.3 values

            read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:1.3r
            Incoming change for sensor:5
            
            Incoming change for sensor:5, New status: 1
            
            read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:0.3r
            Incoming change for sensor:5
            
            Incoming change for sensor:5, New status: 0
        

        And then it starts going even crazier, only seeing the status as 1 and received command is nothing like boolean so it see's 0's and 1's as only 1's

            read: 0-0-25 s=4,c=1,t=2,pt=0,l=4:1.3r
            Incoming change for sensor:4
            
            Incoming change for sensor:4, New status: 1
            
            read: 0-0-25 s=4,c=1,t=2,pt=0,l=4:0.3r
            Incoming change for sensor:4
        
            Incoming change for sensor:5, New status: 1
            
            read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:003r
            Incoming change for sensor:5
            
            Incoming change for sensor:5, New status: 1
            
            read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:003r
            Incoming change for sensor:5
            
            Incoming change for sensor:5, New status: 1
            
            read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:013r
            Incoming change for sensor:5
            
            Incoming change for sensor:5, New status: 1
            
            read: 0-0-25 s=4,c=1,t=2,pt=0,l=4:113r
            Incoming change for sensor:4
            
            Incoming change for sensor:4, New status: 1
            
            read: 0-0-25 s=4,c=1,t=2,pt=0,l=4:013r
            Incoming change for sensor:4
            
            Incoming change for sensor:4, New status: 1
        
        1. So i am thinking it is still a problem with what is sent from gateway somehow... :(

        Any ideas

        BulldogLowellB 1 Reply Last reply
        0
        • G Gambituk

          @BulldogLowell

          for (int sensor=1, pin=RELAY_1 ; sensor <= NUMBER_OF_RELAYS ; sensor++ , pin++)
          {
          gw.present(NUMBER_OF_TEMP_SENSORS + sensor, S_LIGHT); // should create 3 and 4

          For the earlier part, should this be "for (int sensor=0" to get 3 and 4?

          I get 4 and 5 ... But either way, i dont suppose it matters that there is a gap of 1 in the sensor child id's.

          1. I change the callback to this:

            digitalWrite(message.sensor - 4 + RELAY_1, message.getBool() ? RELAY_ON : RELAY_OFF);

          and that works.... i can send a message and it activates the relay.. :D

          1. BUT.... :(

             repeater started, id 25
             send: 25-25-0-0 s=255,c=0,t=18,pt=0,l=5,st=ok:1.4.1
             send: 25-25-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
             read: 0-0-25 s=255,c=3,t=6,pt=0,l=1:M
             send: 25-25-0-0 s=255,c=3,t=11,pt=0,l=15,st=ok:Temp and Relays
             send: 25-25-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0
             send: 25-25-0-0 s=0,c=0,t=0,pt=0,l=5,st=ok:1.4.1
             send: 25-25-0-0 s=1,c=0,t=0,pt=0,l=5,st=ok:1.4.1
             send: 25-25-0-0 s=2,c=0,t=0,pt=0,l=5,st=ok:1.4.1
             send: 25-25-0-0 s=4,c=0,t=3,pt=0,l=5,st=ok:1.4.1
             send: 25-25-0-0 s=5,c=0,t=3,pt=0,l=5,st=ok:1.4.1
             send: 25-25-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:19.1
            

          Here i am sending a message with 1 and then 0 to relay id4 and then the same to relay id5 -It works, but i still have the 1.3 and 0.3 values

              read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:1.3r
              Incoming change for sensor:5
              
              Incoming change for sensor:5, New status: 1
              
              read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:0.3r
              Incoming change for sensor:5
              
              Incoming change for sensor:5, New status: 0
          

          And then it starts going even crazier, only seeing the status as 1 and received command is nothing like boolean so it see's 0's and 1's as only 1's

              read: 0-0-25 s=4,c=1,t=2,pt=0,l=4:1.3r
              Incoming change for sensor:4
              
              Incoming change for sensor:4, New status: 1
              
              read: 0-0-25 s=4,c=1,t=2,pt=0,l=4:0.3r
              Incoming change for sensor:4
          
              Incoming change for sensor:5, New status: 1
              
              read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:003r
              Incoming change for sensor:5
              
              Incoming change for sensor:5, New status: 1
              
              read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:003r
              Incoming change for sensor:5
              
              Incoming change for sensor:5, New status: 1
              
              read: 0-0-25 s=5,c=1,t=2,pt=0,l=4:013r
              Incoming change for sensor:5
              
              Incoming change for sensor:5, New status: 1
              
              read: 0-0-25 s=4,c=1,t=2,pt=0,l=4:113r
              Incoming change for sensor:4
              
              Incoming change for sensor:4, New status: 1
              
              read: 0-0-25 s=4,c=1,t=2,pt=0,l=4:013r
              Incoming change for sensor:4
              
              Incoming change for sensor:4, New status: 1
          
          1. So i am thinking it is still a problem with what is sent from gateway somehow... :(

          Any ideas

          BulldogLowellB Offline
          BulldogLowellB Offline
          BulldogLowell
          Contest Winner
          wrote on last edited by
          #17

          @Gambituk

          would you mind posting your latest (sorta working) code?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            Gambituk
            wrote on last edited by
            #18

            // Running DS temperature sensor(s) and relay(s) on one mysensor arduino node
            // Combines Onewire and Relay code
            // 2014-10-14 Pego: Tested and Running on Uno/Clone and MQTT gateway

                // Example sketch showing how to send in OneWire temperature readings
                // Example sketch showing how to control physical relays.
                // This example will remember relay state even after power failure.
                
                #include <MySensor.h>
                #include <SPI.h>
                #include <DallasTemperature.h>
                #include <OneWire.h>
                
                #define ONE_WIRE_BUS 3 // Pin where dallas sensor is connected 
                #define MAX_ATTACHED_DS18B20 16
                
                #define RELAY_1  4  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
                #define NUMBER_OF_RELAYS 2 // Total number of attached relays
                #define RELAY_ON 1  // GPIO value to write to turn on attached relay
                #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
                #define NUMBER_OF_TEMP_SENSORS 3
                
                unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds) 30000 orig
                OneWire oneWire(ONE_WIRE_BUS);
                DallasTemperature sensors(&oneWire);
                MySensor gw;
                float lastTemperature[MAX_ATTACHED_DS18B20];
                //int numSensors = 0;
                boolean receivedConfig = false;
                boolean metric = true;
                // Initialize temperature message
                MyMessage msg(0, V_TEMP);
                //int offsetforrelays = 5;
                void setup()
                {
                  // Startup OneWire
                  sensors.begin();
                  gw.begin(incomingMessage, AUTO, true);        // Startup and initialize MySensors library. Set callback for incoming messages.
                  gw.sendSketchInfo("Temp and Relays", "1.0");   // Send the sketch version information to the gateway and Controller
                
                  for (int i = 0; i < NUMBER_OF_TEMP_SENSORS ; i++)
                  {
                    gw.present(i, V_TEMP); // creates 0, 1 and 2
                  }
                  for (int sensor = 1, pin = RELAY_1 ; sensor <= NUMBER_OF_RELAYS ; sensor++ , pin++)
                    //   loop from sensor1/pin4 to sensor2/pin5 (numofrelays=2)
                  {
                    gw.present(NUMBER_OF_TEMP_SENSORS + sensor, S_LIGHT); // should create 3 and 4
                    pinMode(pin, OUTPUT);
                    digitalWrite(pin, gw.loadState(sensor) ? RELAY_ON : RELAY_OFF);
                  }
                }
                
                 void loop()
                {
                  // Process incoming messages (like config from server)
                  gw.process();
                
                  // Fetch temperatures from Dallas sensors
                  sensors.requestTemperatures();
                
                  // Read temperatures and send them to controller
                  for (int i = 0; i < NUMBER_OF_TEMP_SENSORS && i < MAX_ATTACHED_DS18B20; i++) {
                
                    // Fetch and round temperature to one decimal
                    float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric ? sensors.getTempCByIndex(i) : sensors.getTempFByIndex(i)) * 10.)) / 10.;
                
                    // Only send data if temperature has changed more then 1 degC and no error
                    if (int(lastTemperature[i]) != int(temperature) && temperature != -127.00) { //added integer
                
                      // Send in the new temperature
                      gw.send(msg.setSensor(i).set(temperature, 1));
                      lastTemperature[i] = temperature;
                    }
                  }
                  //gw.sleep(SLEEP_TIME); //no sleep for relays!!!!
                }
                
                void incomingMessage(const MyMessage &message) {
                  // We only expect one type of message from controller. But we better check anyway.
                  if (message.type == V_LIGHT) {
                    // Change relay state
                    Serial.print("Incoming change for sensor:");
                    Serial.println(message.sensor);
                    digitalWrite(message.sensor - 4 + RELAY_1, message.getBool() ? RELAY_ON : RELAY_OFF);
                    // Store state in eeprom
                    gw.saveState(message.sensor, message.getBool());
                    // Write some debug info
                    Serial.print("Incoming change for sensor:");
                    Serial.print(message.sensor);
                    Serial.print(", New status: ");
                    Serial.println(message.getBool());
                  }
                }
            
            1 Reply Last reply
            0
            • G Offline
              G Offline
              Gambituk
              wrote on last edited by Gambituk
              #19

              @BulldogLowell I just tried uploading a standard vanilla relay node, and i get the same garbled data instead of 1 and 0 (should have tried this at the start, but i am happy with what i have learned in the last 12 hours.) So it seems almost certain that it is an issue with the @gadu version of the mqtt gateway.. which is unaltered from the above post. #2 above

              1 Reply Last reply
              1
              • gaduG Offline
                gaduG Offline
                gadu
                wrote on last edited by
                #20

                Interesting findings, if you find any solution for this in the MQTT gateway I would really appreciate if you post it. I'm about to start implementing relays as well.

                (it's actually not my version, I think @ntruchsess is the one who created it) ;)

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  Gambituk
                  wrote on last edited by
                  #21

                  @gadu if you have a setup running, could you publish a message on your mosquitto server just like this?

                  MyMQTT/25/1/V_LIGHT 1
                  MyMQTT/25/1/V_LIGHT 0
                  

                  I don't think it matters if you have any relays connected or defined, it's just to see what value it tries to send to the node... (assuming you have your gateway connected to a pc to be able to see the serial output)?

                  No problems if this is not possible.

                  gaduG 1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    Gambituk
                    wrote on last edited by
                    #22

                    I cannot see where the issue is coming from, the mqttgateway seems very straightforward, i think the answer might be in the libraries or some kind of conflict with the datatypes? it's a little over my head, but i would really love to get this working. :/

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      Gambituk
                      wrote on last edited by Gambituk
                      #23

                      // NOTE above : Beware to check if there is any length on payload in your incommingMessage code:
                      // Example: if (msg.type==V_LIGHT && strlen(msg.getString())>0) otherwise the code might do strange things.

                      I have a question regarding this line in MyMQTTClient.h that perhaps @hek or @ntruchsess might be able to comment on, Is the above issue that i am seeing linked to this warning? it is beyond my weak coding to grasp the implications... Or anyone who may have a comment, i would really love to get this to work!!!

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

                        Not my code :)

                        I have no idea what does. Especially the special check for V_LIGHT seems a bit peculiar.

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          Gambituk
                          wrote on last edited by
                          #25

                          Ok, well i guess you were listed on the sketch from before it was branched, but thanks for replying.

                          As an update to my struggles ;) i have found a workaround which might hint at a solution..

                          If i publish :

                          MyMQTT/25/5/V_LIGHT 0.0r
                          MyMQTT/25/5/V_LIGHT 1.0r
                          

                          instead of

                          MyMQTT/25/5/V_LIGHT 0
                          MyMQTT/25/5/V_LIGHT 1
                          

                          Then it seems that it overwrites the scraps of the previous temp readings that are causing trouble, and activates the relay everytime.

                          also.. interestingly if i publish 0.00r to my mqtt, then the gateway reads all the following temps with a trailing 0 eg 21.90 instead of 21.9 / or '1.9rr' instead of '1.9r' so it seems like it is storing a value somewhere and only overwriting the parts that are conflicting with the next received value.

                          1 Reply Last reply
                          0
                          • G Gambituk

                            @gadu if you have a setup running, could you publish a message on your mosquitto server just like this?

                            MyMQTT/25/1/V_LIGHT 1
                            MyMQTT/25/1/V_LIGHT 0
                            

                            I don't think it matters if you have any relays connected or defined, it's just to see what value it tries to send to the node... (assuming you have your gateway connected to a pc to be able to see the serial output)?

                            No problems if this is not possible.

                            gaduG Offline
                            gaduG Offline
                            gadu
                            wrote on last edited by
                            #26

                            @Gambituk said:

                            @gadu if you have a setup running, could you publish a message on your mosquitto server just like this?

                            MyMQTT/25/1/V_LIGHT 1
                            MyMQTT/25/1/V_LIGHT 0
                            

                            I don't think it matters if you have any relays connected or defined, it's just to see what value it tries to send to the node... (assuming you have your gateway connected to a pc to be able to see the serial output)?

                            No problems if this is not possible.

                            Actually yes, I have a relay sketch that BulldogLowell helped me with in this thread:
                            http://forum.mysensors.org/topic/901/relaywithbuttonactuator-another-n00b-question/7

                            The idea behind the sketch is written in the thread, but the short story is that I needed two relays and when the button is pressed one goes on for a sec (then off) and the other goes on until i push the button again. So it's actually only controlling one relay, nothing else.
                            By publishing...

                            pi@raspberrypi ~ $ mosquitto_pub -r -t MyMQTT/23/1/V_LIGHT -m "1"
                            pi@raspberrypi ~ $ mosquitto_pub -r -t MyMQTT/23/1/V_LIGHT -m "0"
                            

                            I can see the following...

                            pi@raspberrypi ~ $ mosquitto_sub -v -t MyMQTT/#
                            MyMQTT/23/1/V_LIGHT 1
                            MyMQTT/23/1/V_LIGHT 0
                            
                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              Gambituk
                              wrote on last edited by Gambituk
                              #27

                              ah, sorry, @gadu i dont think i explained clearly... what i wanted to see was what happens in the serial monitor on the gateway when those values are published (what gets sent over nrf to the node). thanks for trying that, i understand if you cant get serial monitor output. but if it was possible, i would really appreciate it

                              1 Reply Last reply
                              0
                              • gaduG Offline
                                gaduG Offline
                                gadu
                                wrote on last edited by
                                #28

                                I'll get tomorrow. No worries :)

                                1 Reply Last reply
                                0
                                • G Offline
                                  G Offline
                                  Gambituk
                                  wrote on last edited by
                                  #29

                                  Thanks! That would be really useful

                                  1 Reply Last reply
                                  0
                                  • gaduG Offline
                                    gaduG Offline
                                    gadu
                                    wrote on last edited by
                                    #30

                                    Here goes...

                                    This is the ProMini output from the monitor when I turn on and off the relay...

                                    send: 23-23-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:1
                                    read: 0-0-23 s=1,c=1,t=2,pt=2,l=2:1
                                    This is an ack from gateway
                                    Incoming change for sensor:1, New status: 1
                                    read: 0-0-23 s=1,c=1,t=2,pt=0,l=4:1.6r
                                    Incoming change for sensor:1, New status: 1
                                    send: 23-23-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:0
                                    read: 0-0-23 s=1,c=1,t=2,pt=2,l=2:0
                                    This is an ack from gateway
                                    Incoming change for sensor:1, New status: 0
                                    read: 0-0-23 s=1,c=1,t=2,pt=0,l=4:0.6r
                                    Incoming change for sensor:1, New status: 0
                                    

                                    This what I see on the gateway when I turn on and off the relay....

                                    publish: MyMQTT/23/1/V_LIGHT 1
                                    0;0;3;0;9;send: 0-0-23-23 s=1,c=1,t=2,pt=0,l=4,st=ok:1sor
                                    0;0;3;0;9;read: 23-23-0 s=1,c=1,t=2,pt=2,l=2:0
                                    0;0;3;0;9;send: 0-0-23-23 s=1,c=1,t=2,pt=2,l=2,st=ok:0
                                    publish: MyMQTT/23/1/V_LIGHT 0
                                    0;0;3;0;9;send: 0-0-23-23 s=1,c=1,t=2,pt=0,l=4,st=ok:0sor
                                    0;0;3;0;9;read: 23-23-0 s=1,c=1,t=2,pt=2,l=2:1
                                    0;0;3;0;9;send: 0-0-23-23 s=1,c=1,t=2,pt=2,l=2,st=ok:1
                                    

                                    I hope it helps.

                                    1 Reply Last reply
                                    0
                                    • G Offline
                                      G Offline
                                      Gambituk
                                      wrote on last edited by Gambituk
                                      #31

                                      That's perfect, that shows clearly that the problem is coming from the gateway sketch. I assume that the r on the end of both your and my output's is a termination character, and everything between the (1/0) and the 'r' in the gateway serial output is 'debris' left over from a previous output.. (for me a previous temp reading, for you something ending in 'so' .

                                      With my workaround from yesterday:- (publishing something like this from openhab or wherever mysensor:MyMQTT/25/4/V_LIGHT:command:ON:1.0r <-1.0r instead of just 1) , my relay reacts really fast and accurately when triggered and continues to work. Before it was very slow and not reliable.

                                      I am not sure if i will find the cause and be able to correct it but at least there is a workaround.

                                      Thanks for your time @gadu

                                      1 Reply Last reply
                                      0
                                      • gaduG Offline
                                        gaduG Offline
                                        gadu
                                        wrote on last edited by
                                        #32

                                        No worries!

                                        1 Reply Last reply
                                        0
                                        • caycoC Offline
                                          caycoC Offline
                                          cayco
                                          wrote on last edited by cayco
                                          #33

                                          Hi! I'm starting to play with relay and I experiencing somethings similar. I have 3 sensors (two of them works great, just temperature, volt, light and humidity) one is relay sensor. First of all it just doesn't react to my commands:

                                          mosquitto_pub -p 1883 -h 10.0.0.11 -t MyMQTT/22/1/V_LIGHT -m "1"
                                          

                                          serial shows just this:

                                          connecting at 115200
                                          repeater started, id 22
                                          send: 22-22-0-0 s=255,c=0,t=18,pt=0,l=3,st=ok:1.4
                                          send: 22-22-0-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0
                                          send: 22-22-0-0 s=255,c=3,t=11,pt=0,l=12,st=ok:Relay sketch
                                          send: 22-22-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0
                                          send: 22-22-0-0 s=1,c=0,t=3,pt=0,l=3,st=ok:1.4
                                          

                                          I'm using stock http://www.mysensors.org/build/relay code, just setting node_id manually to 22.

                                          On the controller I have:

                                          0;0;3;0;9;read: 21-21-0 s=11,c=1,t=0,pt=7,l=5:23.0
                                          publish: MyMQTT/21/11/V_TEMP 23.0
                                          0;0;3;0;9;send: 0-0-21-21 s=11,c=1,t=0,pt=0,l=7,st=fail:23.0001
                                          0;0;3;0;9;send: 0-0-22-22 s=1,c=1,t=2,pt=0,l=7,st=fail:13.0001
                                          

                                          It looks like it tries to send '1' with garbage from last sensor read.

                                          It does this with my humidity sensor:

                                          publish: MyMQTT/21/12/V_VOLTAGE 5001
                                          0;0;3;0;9;send: 0-0-21-21 s=12,c=1,t=38,pt=0,l=4,st=ok:5001
                                          0;0;3;0;9;read: 21-21-0 s=10,c=1,t=1,pt=7,l=5:52.0
                                          publish: MyMQTT/21/10/V_HUM 52.0
                                          0;0;3;0;9;send: 0-0-21-21 s=10,c=1,t=1,pt=0,l=8,st=fail:52.05001
                                          

                                          I am also using MQTT client gateway which @gadu recommended me.

                                          I did not understood how does this workaround @Gambituk mention work. Do you know what is going on above? What am I doing wrong?

                                          P.S. Using standart EthernetGateway code also scrambles messages (please note strange sing after '1'):

                                          0;0;3;0;9;read: 22-22-0 s=255,c=3,t=11,pt=0,l=12:Relay sketch
                                          0;0;3;0;9;read: 22-22-0 s=255,c=3,t=12,pt=0,l=3:1.0
                                          0;0;3;0;9;read: 22-22-0 s=1,c=0,t=3,pt=0,l=3:1.4
                                          0;0;3;0;9;send: 0-0-22-22 s=1,c=1,t=2,pt=0,l=2,st=ok:1à
                                          0;0;3;0;9;read: 0-1-22 s=1,c=1,t=2,pt=0,l=2:1à
                                          0;0;3;0;9;read: 21-21-0 s=12,c=1,t=38,pt=4,l=4:5023
                                          MyMQTT/21/12/V_VOLTAGE
                                          
                                          0;0;3;0;9;send: 0-0-22-22 s=1,c=1,t=2,pt=0,l=2,st=fail:1à
                                          

                                          after this relay node does not accept any message (you can see st=fail on the last line - that was me retrying mosquitto_pub -p 1883 -h 10.0.0.34 -t MyMQTT/22/1/V_LIGHT -m "1").

                                          1 Reply Last reply
                                          0
                                          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