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. Troubleshooting
  3. Serial GW Stops Working Periodically

Serial GW Stops Working Periodically

Scheduled Pinned Locked Moved Troubleshooting
9 Posts 3 Posters 2.4k Views 1 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.
  • joe.kJ Offline
    joe.kJ Offline
    joe.k
    wrote on last edited by
    #1

    Not positive what's going on and hope others could help with troubleshooting. The nano GW locks-up/freezes - it can be seen the Arduino log messages stop in the LuaUPnP.log file on the Veralite. Pushing the "reset" button on the nano clears the condition and everything then works as expected.

    The log messages right prior to the GW not working are shown below. Strange behaviour because the node-2 message is received twice via the "repeater node" (node-3) and the second message value is peculiar as it's showing a floating point with many zero's. All other times the sensor value is only sent once and in the proper format (meaning no zero's added).

    My sketch only sends the value once and with no decimal value, as shown here: gw.send(msgHum.set(humidity, 0));

    50	15:00:14.245	luup_log:107: Arduino: Log: read: 2-3-0 s=0,c=1,t=1,pt=7,l=5:31 <0x2deb4680>
    50	15:00:14.246	luup_log:107: Arduino: Set variable: 2;0;1;0;1;31 <0x2deb4680>
    50	15:00:14.247	luup_log:107: Arduino: Setting variable 'CurrentLevel' to value '31' <0x2deb4680>
    50	15:00:14.247	luup_log:107: Arduino: urn:micasaverde-com:serviceId:HumiditySensor1,CurrentLevel, 31, 119 <0x2deb4680>
    50	15:00:16.255	luup_log:107: Arduino: Log: read: 2-3-0 s=0,c=1,t=1,pt=7,l=5:31.00000000000000000000000 <0x2deb4680>  ==> last log message from GW
    

    Any idea's as why the value received has zero's added, then causing the nano to freeze up? And, why the message was sent twice within 2secs of each other? It works most of the time w/o problems until this condition occurs.

    Regards,
    Joe

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

      Surely looks strange. Is it always zeroes?

      Do you have a powered USB hub around which you could attach your serial gateway to?
      Or try powering the nano externally?

      1 Reply Last reply
      0
      • joe.kJ Offline
        joe.kJ Offline
        joe.k
        wrote on last edited by
        #3

        @hek

        Thanks for your suggestion. I'll work on using a separate power supply on the GW to see if it helps some.

        "Is it always zeroes?"

        No, never - only see zero's when GW freezes. Below is another example from the last freeze. Not sure if the problem is with the GW or node-3 which is a "repeater node"? Thinking maybe the repeater is sending a bad/corrupted message to GW causing it to freeze.

        50  5:21:33.186	luup_log:107: Arduino: Log: read: 3-3-0 s=0,c=1,t=5,pt=7,l=5:148.0002400000000000000000 <0x2e0fe680>
        

        Thanks,
        Joe

        hekH 1 Reply Last reply
        0
        • joe.kJ joe.k

          @hek

          Thanks for your suggestion. I'll work on using a separate power supply on the GW to see if it helps some.

          "Is it always zeroes?"

          No, never - only see zero's when GW freezes. Below is another example from the last freeze. Not sure if the problem is with the GW or node-3 which is a "repeater node"? Thinking maybe the repeater is sending a bad/corrupted message to GW causing it to freeze.

          50  5:21:33.186	luup_log:107: Arduino: Log: read: 3-3-0 s=0,c=1,t=5,pt=7,l=5:148.0002400000000000000000 <0x2e0fe680>
          

          Thanks,
          Joe

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

          @joe.k

          Hmm. I wonder if there might be a buffer overflow error somewhere in the gateway code when the over-the-air transmitted floats is converted back to string.

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

            Buffer seems to be big enough...

            What happens if you send in values with one decimal?

            gw.send(msgHum.set(humidity, 1))

            dtostrf is used to convert float value string. Not sure how it reacts when you specify 0 for precision but I hope it behaves as expected!
            http://www.nongnu.org/avr-libc/user-manual/group__avr__stdlib.html#ga060c998e77fb5fc0d3168b3ce8771d42

            joe.kJ 1 Reply Last reply
            0
            • hekH hek

              Buffer seems to be big enough...

              What happens if you send in values with one decimal?

              gw.send(msgHum.set(humidity, 1))

              dtostrf is used to convert float value string. Not sure how it reacts when you specify 0 for precision but I hope it behaves as expected!
              http://www.nongnu.org/avr-libc/user-manual/group__avr__stdlib.html#ga060c998e77fb5fc0d3168b3ce8771d42

              joe.kJ Offline
              joe.kJ Offline
              joe.k
              wrote on last edited by
              #6

              @hek

              "What happens if you send in values with one decimal?"

              Around my house I have four separate climate nodes that use the DHT22 sensor. Each node uses the same code and reports temperature with one decimal point (ex: 73.8) and humidity reports with no decimal point (ex: 25). I am not seeing problems with 3 of the 4, but node-3 is the only repeater of the bunch and suspect as it's the last node communicating with the GW when it freezes.

              "dtostrf is used to convert float value string. Not sure how it reacts when you specify 0 for precision but I hope it behaves as expected!"

              I'll have to investigate further ... although this code works I now question the round() because it's a double and humidity is a float (single precision). Not sure if there's an occasional problem as a result.

              humidity = dht.getHumidity();
              humidity = round(humidity); 
              if (humidity != lastHum) {      
                  gw.send(msgHum.set(humidity, 0)); 
                  lastHum = humidity;
              }
              

              The purpose of the code is to just use whole numbers when comparing previous reading and reporting back to GW. Greater accuracy isn't needed with humidity.

              Thanks,
              Joe

              BulldogLowellB 1 Reply Last reply
              0
              • joe.kJ joe.k

                @hek

                "What happens if you send in values with one decimal?"

                Around my house I have four separate climate nodes that use the DHT22 sensor. Each node uses the same code and reports temperature with one decimal point (ex: 73.8) and humidity reports with no decimal point (ex: 25). I am not seeing problems with 3 of the 4, but node-3 is the only repeater of the bunch and suspect as it's the last node communicating with the GW when it freezes.

                "dtostrf is used to convert float value string. Not sure how it reacts when you specify 0 for precision but I hope it behaves as expected!"

                I'll have to investigate further ... although this code works I now question the round() because it's a double and humidity is a float (single precision). Not sure if there's an occasional problem as a result.

                humidity = dht.getHumidity();
                humidity = round(humidity); 
                if (humidity != lastHum) {      
                    gw.send(msgHum.set(humidity, 0)); 
                    lastHum = humidity;
                }
                

                The purpose of the code is to just use whole numbers when comparing previous reading and reporting back to GW. Greater accuracy isn't needed with humidity.

                Thanks,
                Joe

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

                @joe.k said:

                The purpose of the code is to just use whole numbers when comparing previous reading and reporting back to GW. Greater accuracy isn't needed with humidity.

                cast the float into an int... rounding doesn't fix the precision issue and you still have a float...

                try it:

                float humidity = 11.321;
                
                void setup()
                {
                  Serial.begin(9600);
                  humidity = round(humidity); 
                  Serial.print(humidity);
                  //
                  humidity = 11.321;
                  humidity += 0.5;
                  humidity = floor(humidity);
                  int myHumidity = (int) humidity;
                  Serial.print(myHumidity);
                }
                void loop()
                {
                  
                }
                
                1 Reply Last reply
                0
                • joe.kJ Offline
                  joe.kJ Offline
                  joe.k
                  wrote on last edited by
                  #8

                  Just to report back my findings .....

                  After reloading the sketch onto node-3 repeater my RF network of sensors have worked flawlessly. No GW freezes. There were no changes made to the GW or any other node except node-3.

                  Node-3 went from code 1.4 to 1.4.1 after the sketch reload, but not aware of any changes in 1.4.1 that would have made a difference(?).

                  So in conclusion the problems were mostly caused by the repeater node-3 and reloading the sketch fixed it.

                  Joe

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

                    A serious bug in communication was fixed in 1.4.1. Could very well be this that caused your problems.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    21

                    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