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. Strange data sent from sensors

Strange data sent from sensors

Scheduled Pinned Locked Moved Troubleshooting
8 Posts 3 Posters 2.2k Views
  • 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.
  • A Offline
    A Offline
    Aloha
    wrote on last edited by
    #1

    Hi,

    Occasionally I receive strange data from my sensors. This can sometimes happen several times a week and sometimes longer time can pass before it happens again. On average once a week for each sensor I would say. This is messing up my graphs and also don't feel very reliable.

    I've noticed that they all go through my repeater node (106). The repeater node itself has a temperature and humidity sensor.

    Some examples from my controller:

    2015-12-12T14:58:45.8881610+01:00       DEBUG   MySensors                               Read: 106-106-0 s=0,c=1,t=1,pt=5,l=5:1108344832
    2015-12-12T14:58:45.8886540+01:00       INFO    MySensors       N106S0  Sensor.Humidity 1108344832  
    
    2015-12-12T14:49:07.3811900+01:00       DEBUG   MySensors                               Read: 106-106-0 s=1,c=1,t=0,pt=5,l=5:1103626240
    2015-12-12T14:49:07.3816670+01:00       INFO    MySensors       N106S1  Sensor.Temperature      1103626240      -
    
    2015-12-13T18:25:08.2651820+01:00       DEBUG   MySensors                               Read: 105-106-0 s=0,c=1,t=0,pt=5,l=5:2941013193
    2015-12-13T18:25:08.2686200+01:00       INFO    MySensors       N105S0  Sensor.Temperature      2941013193      -
    
    2015-12-12T15:15:21.8491830+01:00       DEBUG   MySensors                               Read: 12-106-0 s=2,c=1,t=0,pt=5,l=5:897581056
    2015-12-12T15:15:21.8496750+01:00       INFO    MySensors       N12S2   Sensor.Temperature      897581056       -
    

    I also don't understand why all sensors seem to go through my repeater node. 1 of the sensors (12) is in the same room as the controller but still go through the repeater node which is in a different room past the controller.

    The repeater node has a 4.7 capacitor on the radio, I have also tried to replace the radio which made no difference.
    Any ideas?

    tekkaT 1 Reply Last reply
    0
    • A Aloha

      Hi,

      Occasionally I receive strange data from my sensors. This can sometimes happen several times a week and sometimes longer time can pass before it happens again. On average once a week for each sensor I would say. This is messing up my graphs and also don't feel very reliable.

      I've noticed that they all go through my repeater node (106). The repeater node itself has a temperature and humidity sensor.

      Some examples from my controller:

      2015-12-12T14:58:45.8881610+01:00       DEBUG   MySensors                               Read: 106-106-0 s=0,c=1,t=1,pt=5,l=5:1108344832
      2015-12-12T14:58:45.8886540+01:00       INFO    MySensors       N106S0  Sensor.Humidity 1108344832  
      
      2015-12-12T14:49:07.3811900+01:00       DEBUG   MySensors                               Read: 106-106-0 s=1,c=1,t=0,pt=5,l=5:1103626240
      2015-12-12T14:49:07.3816670+01:00       INFO    MySensors       N106S1  Sensor.Temperature      1103626240      -
      
      2015-12-13T18:25:08.2651820+01:00       DEBUG   MySensors                               Read: 105-106-0 s=0,c=1,t=0,pt=5,l=5:2941013193
      2015-12-13T18:25:08.2686200+01:00       INFO    MySensors       N105S0  Sensor.Temperature      2941013193      -
      
      2015-12-12T15:15:21.8491830+01:00       DEBUG   MySensors                               Read: 12-106-0 s=2,c=1,t=0,pt=5,l=5:897581056
      2015-12-12T15:15:21.8496750+01:00       INFO    MySensors       N12S2   Sensor.Temperature      897581056       -
      

      I also don't understand why all sensors seem to go through my repeater node. 1 of the sensors (12) is in the same room as the controller but still go through the repeater node which is in a different room past the controller.

      The repeater node has a 4.7 capacitor on the radio, I have also tried to replace the radio which made no difference.
      Any ideas?

      tekkaT Offline
      tekkaT Offline
      tekka
      Admin
      wrote on last edited by
      #2

      @Aloha Please upload the sketch of your repeater.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Aloha
        wrote on last edited by
        #3

        Here it is:

        #include <SPI.h>
        #include <MySensor.h>  
        #include <DHT.h>  
        
        #define CHILD_ID_HUM 0
        #define CHILD_ID_TEMP 1
        #define HUMIDITY_SENSOR_DIGITAL_PIN 3
        unsigned long SLEEP_TIME = 15000; // Sleep time between reads (in milliseconds)
        
        MySensor gw;
        DHT dht;
        float lastTemp;
        float lastHum;
        boolean metric = true; 
        MyMessage msgHum(CHILD_ID_HUM, V_HUM);
        MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
        
        
        void setup()  
        { 
          gw.begin(NULL, 106, true);
          dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
        
          // Send the Sketch Version Information to the Gateway
          gw.sendSketchInfo("Humidity", "1.0");
        
          // Register all sensors to gw (they will be created as child devices)
          gw.present(CHILD_ID_HUM, S_HUM);
          gw.present(CHILD_ID_TEMP, S_TEMP);
          
          metric = gw.getConfig().isMetric;
        }
        
        void loop()      
        {  
          delay(dht.getMinimumSamplingPeriod());
        
          float temperature = dht.getTemperature();
          if (isnan(temperature)) {
              Serial.println("Failed reading temperature from DHT");
          } else if (temperature != lastTemp) {
            lastTemp = temperature;
            if (!metric) {
              temperature = dht.toFahrenheit(temperature);
            }
            gw.send(msgTemp.set(temperature, 1));
            Serial.print("T: ");
            Serial.println(temperature);
          }
          
          float humidity = dht.getHumidity();
          if (isnan(humidity)) {
              Serial.println("Failed reading humidity from DHT");
          } else if (humidity != lastHum) {
              lastHum = humidity;
              gw.send(msgHum.set(humidity, 1));
              Serial.print("H: ");
              Serial.println(humidity);
          }
          gw.process();
          gw.wait(SLEEP_TIME); //sleep a bit
        }
        
        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          You cannot sleep a repeater node.

          My guess is that the DHT sensor is the source of the garbage.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Aloha
            wrote on last edited by
            #5

            Hmm strange.. I must have pasted the wrong sketch, sorry about that. It's not sleeping, it looks like this.

            #include <SPI.h>
            #include <MySensor.h>  
            #include <DHT.h>  
            
            #define CHILD_ID_HUM 0
            #define CHILD_ID_TEMP 1
            #define HUMIDITY_SENSOR_DIGITAL_PIN 3
            unsigned long SLEEP_TIME = 15000; // Sleep time between reads (in milliseconds)
            
            MySensor gw;
            DHT dht;
            float lastTemp;
            float lastHum;
            boolean metric = true; 
            MyMessage msgHum(CHILD_ID_HUM, V_HUM);
            MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
            
            
            void setup()  
            { 
              gw.begin(NULL, 106, true);
              dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
            
              // Send the Sketch Version Information to the Gateway
              gw.sendSketchInfo("Humidity", "1.0");
            
              // Register all sensors to gw (they will be created as child devices)
              gw.present(CHILD_ID_HUM, S_HUM);
              gw.present(CHILD_ID_TEMP, S_TEMP);
              
              metric = gw.getConfig().isMetric;
            }
            
            void loop()      
            {  
              delay(dht.getMinimumSamplingPeriod());
            
              float temperature = dht.getTemperature();
              if (isnan(temperature)) {
                  Serial.println("Failed reading temperature from DHT");
              } else if (temperature != lastTemp) {
                lastTemp = temperature;
                if (!metric) {
                  temperature = dht.toFahrenheit(temperature);
                }
                gw.send(msgTemp.set(temperature, 1));
                Serial.print("T: ");
                Serial.println(temperature);
              }
              
              float humidity = dht.getHumidity();
              if (isnan(humidity)) {
                  Serial.println("Failed reading humidity from DHT");
              } else if (humidity != lastHum) {
                  lastHum = humidity;
                  gw.send(msgHum.set(humidity, 1));
                  Serial.print("H: ");
                  Serial.println(humidity);
              }
              gw.process();
              gw.wait(SLEEP_TIME); //sleep a bit
            }
            

            hek, I'm using the DHTII module. I have a second mysensor network (on a different channel and other controller) which also have the same type of sensor and it's working fine. Are these known to be causing issues?

            Also, why would the data from other nodes gets affected by the DHT sensor on the 106 node? 105 for instance is using a dallas temperature sensor.

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

              It's the same sketch :)

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Aloha
                wrote on last edited by
                #7

                Well, in that case it's probably just me going crazy. :blush:

                It is the correct sketch. But it's not sleeping, it's just waiting?
                gw.wait(SLEEP_TIME); //sleep a bit

                I guess the comment might be a bit missleading and that I should update it, but gw.wait should work with repeaters. Right?

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

                  Yes, wait is totally fine.

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


                  22

                  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