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. Connection Problems

Connection Problems

Scheduled Pinned Locked Moved Troubleshooting
13 Posts 5 Posters 3.9k Views 2 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.
  • Stephan NollerS Offline
    Stephan NollerS Offline
    Stephan Noller
    wrote on last edited by
    #3

    Well - in cases when my sensor are disappearing there is also nothing to see in the log of the Repeater...

    1 Reply Last reply
    0
    • Stephan NollerS Stephan Noller

      I have an installation up and running (1.4 serial gw, fhem as controller) and am trying to install a soil/humidity sensor in my garden. But it always loses connection to the gateway or repeater once i put it on the ground (it can send if i put it on a chair or so in roughly the same spot). Other nodes in the house are working fine. I am using the extended range + antenna tranceiver on the gateway already, but also tried to work with an additional repeater (and forced sensors to use it). Tried different dBm Levels on both gw and sensors, tried different sensors (all on battery), added caps, changed the power-source of repeater (gw is powered through serial cable on the Raspberry). The strange thing is - none of these options had an influence on the behavior of that node on the ground. Any idea what is going wrong here? The other observation is: once a sensor loses connection it will never reconnect, even if put very close to the gw/repeater. Always have to reset - is that a normal behavior? Thanks in advance.

      SparkmanS Offline
      SparkmanS Offline
      Sparkman
      Hero Member
      wrote on last edited by Sparkman
      #4

      @Stephan-Noller said:

      The other observation is: once a sensor loses connection it will never reconnect, even if put very close to the gw/repeater. Always have to reset - is that a normal behavior?

      From what I've seen it's not normal behavior as the communication is really stateless. Can you post your sketch to see if something jumps out? I've shut down my controller and gateway and the sensors always keep communicating, even if they have moved out of range and back in range. Might be worth trying with MYSController rather than FHEM to see if you see the same behavior with it.

      For your other issue, I would move the radio as far back from the ground as possible and use wires to extend the actual sensor from the node. Some ground is really good at absorbing RF.

      Cheers
      Al

      Stephan NollerS 1 Reply Last reply
      0
      • T Offline
        T Offline
        TechIsCool
        wrote on last edited by
        #5

        I am experiences the same issues where the devices fail to reconnect. But I am using the RF24 Library not the MySensors Library right now.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          TechIsCool
          wrote on last edited by
          #6

          Alright so I have been tinkering and finally read something that fixed the problem for me. I saw a note about power issues and needed more current then the trace could source quickly. So I grabbed my scope and checked. I was seeing a .6v drop when the TX started. I have now added a 22uf cap between ground and VCC and everything including reboot is functioning correctly. I hope this helps.

          -Tech

          Stephan NollerS 1 Reply Last reply
          0
          • SparkmanS Sparkman

            @Stephan-Noller said:

            The other observation is: once a sensor loses connection it will never reconnect, even if put very close to the gw/repeater. Always have to reset - is that a normal behavior?

            From what I've seen it's not normal behavior as the communication is really stateless. Can you post your sketch to see if something jumps out? I've shut down my controller and gateway and the sensors always keep communicating, even if they have moved out of range and back in range. Might be worth trying with MYSController rather than FHEM to see if you see the same behavior with it.

            For your other issue, I would move the radio as far back from the ground as possible and use wires to extend the actual sensor from the node. Some ground is really good at absorbing RF.

            Cheers
            Al

            Stephan NollerS Offline
            Stephan NollerS Offline
            Stephan Noller
            wrote on last edited by
            #7

            @Sparkman sure, the code is attached below, but it's pretty much the standard example (derived from light sensor). Your suggestion regarding distance to the ground is a good point, will try my best (as i am measuring humidity of the soil it's not trivial...).
            Regarding stateless communication: is that really the case? I thought there is some routing including routing tables somewhere which would indicate a kind of state or am i wrong?

            #include <SPI.h>
            #include <MySensor.h>  
            
            #define CHILD_ID_LIGHT 0
            #define CHILD_ID_BAT 1
            #define LIGHT_SENSOR_ANALOG_PIN 0
            #define trigger 6
            #define led A2
            
            int BATTERY_SENSE_PIN = A1;
            
            unsigned long SLEEP_TIME = 1*60000; // Sleep time between reads (in milliseconds)
            
            MySensor gw;
            MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
            MyMessage msgBatt(CHILD_ID_BAT, V_VOLTAGE);
            
            int lastLightLevel;
            
            void setup()  
            { 
              gw.begin(NULL,3,false,0);
              //gw.begin();
              pinMode(trigger, INPUT);
              pinMode(led, OUTPUT);
              pinMode(11, OUTPUT);
            
              // Send the sketch version information to the gateway and Controller
              gw.sendSketchInfo("Moisture Sensor", "1.0");
            
              // Register all sensors to gateway (they will be created as child devices)
              gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
              gw.present(CHILD_ID_BAT, S_POWER);
              Serial.println("Setup ok");
            }
            
            void loop()      
            { 
               pinMode(trigger, INPUT);
               digitalWrite(led, HIGH);
               delay(1000);  
               
               int lightLevel = analogRead(LIGHT_SENSOR_ANALOG_PIN);
               int batLevel = analogRead(BATTERY_SENSE_PIN);
               float batteryV  = batLevel * 0.003363075;
               int batteryPcnt = batLevel / 10;
               Serial.println(lightLevel);
               delay(100);
               gw.send(msg.set(lightLevel));
               gw.sendBatteryLevel(batteryPcnt);
               
               lastLightLevel = lightLevel;
            
               delay(1000);
               pinMode(trigger, OUTPUT);
               digitalWrite(led, LOW);
               gw.sleep(SLEEP_TIME);
            }
            
            
            
            SparkmanS 1 Reply Last reply
            0
            • T TechIsCool

              Alright so I have been tinkering and finally read something that fixed the problem for me. I saw a note about power issues and needed more current then the trace could source quickly. So I grabbed my scope and checked. I was seeing a .6v drop when the TX started. I have now added a 22uf cap between ground and VCC and everything including reboot is functioning correctly. I hope this helps.

              -Tech

              Stephan NollerS Offline
              Stephan NollerS Offline
              Stephan Noller
              wrote on last edited by
              #8

              @TechIsCool thanks for your suggestion, unfortunately i already have caps on all my sensors (because it is also suggested on the mysensors page)

              1 Reply Last reply
              0
              • Stephan NollerS Stephan Noller

                @Sparkman sure, the code is attached below, but it's pretty much the standard example (derived from light sensor). Your suggestion regarding distance to the ground is a good point, will try my best (as i am measuring humidity of the soil it's not trivial...).
                Regarding stateless communication: is that really the case? I thought there is some routing including routing tables somewhere which would indicate a kind of state or am i wrong?

                #include <SPI.h>
                #include <MySensor.h>  
                
                #define CHILD_ID_LIGHT 0
                #define CHILD_ID_BAT 1
                #define LIGHT_SENSOR_ANALOG_PIN 0
                #define trigger 6
                #define led A2
                
                int BATTERY_SENSE_PIN = A1;
                
                unsigned long SLEEP_TIME = 1*60000; // Sleep time between reads (in milliseconds)
                
                MySensor gw;
                MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
                MyMessage msgBatt(CHILD_ID_BAT, V_VOLTAGE);
                
                int lastLightLevel;
                
                void setup()  
                { 
                  gw.begin(NULL,3,false,0);
                  //gw.begin();
                  pinMode(trigger, INPUT);
                  pinMode(led, OUTPUT);
                  pinMode(11, OUTPUT);
                
                  // Send the sketch version information to the gateway and Controller
                  gw.sendSketchInfo("Moisture Sensor", "1.0");
                
                  // Register all sensors to gateway (they will be created as child devices)
                  gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
                  gw.present(CHILD_ID_BAT, S_POWER);
                  Serial.println("Setup ok");
                }
                
                void loop()      
                { 
                   pinMode(trigger, INPUT);
                   digitalWrite(led, HIGH);
                   delay(1000);  
                   
                   int lightLevel = analogRead(LIGHT_SENSOR_ANALOG_PIN);
                   int batLevel = analogRead(BATTERY_SENSE_PIN);
                   float batteryV  = batLevel * 0.003363075;
                   int batteryPcnt = batLevel / 10;
                   Serial.println(lightLevel);
                   delay(100);
                   gw.send(msg.set(lightLevel));
                   gw.sendBatteryLevel(batteryPcnt);
                   
                   lastLightLevel = lightLevel;
                
                   delay(1000);
                   pinMode(trigger, OUTPUT);
                   digitalWrite(led, LOW);
                   gw.sleep(SLEEP_TIME);
                }
                
                
                
                SparkmanS Offline
                SparkmanS Offline
                Sparkman
                Hero Member
                wrote on last edited by
                #9

                @Stephan-Noller What I meant by stateless was that there's no connection established/maintained between a sensor and the gateway. I believe a node maintains the parent ID which is either a repeater or the gateway. If the node has a repeater as it's parent ID and it can no longer talk to the repeater, then it may need to be reset to get the new parent ID. Not sure if a node can get a new parent ID without a reset. @hek, can you clarify?

                Cheers
                Al

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

                  It should search for a new parent by itself after a few failed transmissions.

                  SparkmanS 1 Reply Last reply
                  0
                  • hekH hek

                    It should search for a new parent by itself after a few failed transmissions.

                    SparkmanS Offline
                    SparkmanS Offline
                    Sparkman
                    Hero Member
                    wrote on last edited by Sparkman
                    #11

                    @hek Thanks for clarifying. @Stephan-Noller, have you tried replicating this with serial monitors hooked up to see what happens with the transmissions? It should provide a clue as to what is going on.

                    Cheer
                    Al

                    1 Reply Last reply
                    0
                    • Stephan NollerS Offline
                      Stephan NollerS Offline
                      Stephan Noller
                      wrote on last edited by
                      #12

                      As i said @Sparkman i see nothing in the serial logs of repeater/gw in these cases. The only thing i did not yet check is the serial output of the sensors that fail to connect (it's currently raining all the time here...). But the good news is: i kinda solved the problem by simply exchanging hardware from gw and repeater. Now the repeater is using the amplified RF and the gw the standard module. Now all sensors are measuring from their intended location on the ground with just a few exceptions (btw also interesting: in many cases only one of the two sensor-values is being transmitted).

                      SparkmanS 1 Reply Last reply
                      0
                      • Stephan NollerS Stephan Noller

                        As i said @Sparkman i see nothing in the serial logs of repeater/gw in these cases. The only thing i did not yet check is the serial output of the sensors that fail to connect (it's currently raining all the time here...). But the good news is: i kinda solved the problem by simply exchanging hardware from gw and repeater. Now the repeater is using the amplified RF and the gw the standard module. Now all sensors are measuring from their intended location on the ground with just a few exceptions (btw also interesting: in many cases only one of the two sensor-values is being transmitted).

                        SparkmanS Offline
                        SparkmanS Offline
                        Sparkman
                        Hero Member
                        wrote on last edited by
                        #13

                        @Stephan-Noller If there's nothing in the repeater or gateway, then that indicates that the sensor is not transmitting or transmitting to the wrong parent, so hooking up a serial monitor to it should provide some clues. Of course the serial monitor has to be connected ahead of time otherwise as it will reset the Arduino once you connect. You could also try the NRF24 Sniffer.

                        Try putting a small delay between the sends as that may resolve the issue where only one value is being transmitted.

                        Cheers
                        Al

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


                        15

                        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