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. Node is not using repeater to talk to gateway

Node is not using repeater to talk to gateway

Scheduled Pinned Locked Moved Troubleshooting
42 Posts 3 Posters 8.0k 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.
  • karl261K karl261

    Hm, somehow I have the impression it depends a bit if I have #define MY_DEBUG in my repeater sketch or not. I had to put it back in, because I want to take some logs, and it is behaving a bit better now. At least single messages. And less fails.

    Daniel OliveiraD Offline
    Daniel OliveiraD Offline
    Daniel Oliveira
    wrote on last edited by
    #8

    Hi @karl261,

    It's a long shot but can you double check your power sources? I had some weird issues like those in the past because of bad quality power sources.

    I recommend adding a 47uF electrolytic capacitor as close as possible to the NRF24 GND and VCC pins, as a 470uF between the GND and the Vin pins of the arduino.

    And keep the external power source on even when connecting the USB cable to read the debug messages.

    Hope you solve this issue soon

    MySensors rules my home :)

    karl261K 1 Reply Last reply
    0
    • karl261K karl261

      Hm, somehow I have the impression it depends a bit if I have #define MY_DEBUG in my repeater sketch or not. I had to put it back in, because I want to take some logs, and it is behaving a bit better now. At least single messages. And less fails.

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

      @karl261 Ok, I need to see the sketches first: can you post the sketch of all nodes, i.e. GW, node 99, node 3, node 4? Also, do you have MYSController installed for a few tests?

      karl261K 1 Reply Last reply
      1
      • karl261K Offline
        karl261K Offline
        karl261
        wrote on last edited by karl261
        #10

        Oki doki, thanks for looking at this:

        Sketch GW:

          /**
         * The MySensors Arduino library handles the wireless radio link and protocol
         * between your home built sensors/actuators and HA controller of choice.
         * The sensors forms a self healing radio network with optional repeaters. Each
         * repeater and gateway builds a routing tables in EEPROM which keeps track of the
         * network topology allowing messages to be routed to nodes.
         *
         * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
         * Copyright (C) 2013-2015 Sensnology AB
         * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
         *
         * Documentation: http://www.mysensors.org
         * Support Forum: http://forum.mysensors.org
         *
         * This program is free software; you can redistribute it and/or
         * modify it under the terms of the GNU General Public License
         * version 2 as published by the Free Software Foundation.
         *
         *******************************
         *
         * DESCRIPTION
         * The ArduinoGateway prints data received from sensors on the serial link. 
         * The gateway accepts input on seral which will be sent out on radio network.
         *
         * The GW code is designed for Arduino Nano 328p / 16MHz
         *
         * Wire connections (OPTIONAL):
         * - Inclusion button should be connected between digital pin 3 and GND  
         * - RX/TX/ERR leds need to be connected between +5V (anode) and digital pin 6/5/4 with resistor 270-330R in a series
         *
         * LEDs (OPTIONAL):
         * - To use the feature, uncomment MY_LEDS_BLINKING_FEATURE in MyConfig.h
         * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
         * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
         * - ERR (red) - fast blink on error during transmission error or recieve crc error 
         * 
         */
        
        // Enable debug prints to serial monitor
        #define MY_DEBUG 
        
        
        // Enable and select radio type attached
        #define MY_RADIO_NRF24
        //#define MY_RADIO_RFM69
        
        // Set LOW transmit power level as default, if you have an amplified NRF-module and
        // power your radio separately with a good regulator you can turn up PA level. 
        //#define MY_RF24_PA_LEVEL RF24_PA_LOW
        
        // Enable serial gateway
        #define MY_GATEWAY_SERIAL
        
        // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
        #if F_CPU == 8000000L
        #define MY_BAUD_RATE 38400
        #endif
        
        // Flash leds on rx/tx/err
        #define MY_LEDS_BLINKING_FEATURE
        // Set blinking period
        #define MY_DEFAULT_LED_BLINK_PERIOD 300
        
        // Inverses the behavior of leds
        //#define MY_WITH_LEDS_BLINKING_INVERSE
        
        // Enable inclusion mode
        #define MY_INCLUSION_MODE_FEATURE
        // Enable Inclusion mode button on gateway
        #define MY_INCLUSION_BUTTON_FEATURE
        
        // Inverses behavior of inclusion button (if using external pullup)
        //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
        
        // Set inclusion mode duration (in seconds)
        #define MY_INCLUSION_MODE_DURATION 60 
        // Digital pin used for inclusion mode button
        #define MY_INCLUSION_MODE_BUTTON_PIN  3 
        
        // Uncomment to override default HW configurations
        //#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
        //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
        //#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
        
        #include <SPI.h>
        #include <MySensor.h>  
        
        void setup() { 
          // Setup locally attached sensors
        }
        
        void presentation() {
         // Present locally attached sensors 
        }
        
        void loop() { 
          // Send locally attached sensor data here 
        }
        

        Sketch 99:

        /**
         * The MySensors Arduino library handles the wireless radio link and protocol
         * between your home built sensors/actuators and HA controller of choice.
         * The sensors forms a self healing radio network with optional repeaters. Each
         * repeater and gateway builds a routing tables in EEPROM which keeps track of the
         * network topology allowing messages to be routed to nodes.
         *
         * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
         * Copyright (C) 2013-2015 Sensnology AB
         * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
         *
         * Documentation: http://www.mysensors.org
         * Support Forum: http://forum.mysensors.org
         *
         * This program is free software; you can redistribute it and/or
         * modify it under the terms of the GNU General Public License
         * version 2 as published by the Free Software Foundation.
         *
         *******************************
         *
         * REVISION HISTORY
         * Version 1.0 - Henrik Ekblad
         * 
         * DESCRIPTION
         * Example sketch showing how to create a node thay repeates messages
         * from nodes far from gateway back to gateway. 
         * It is important that nodes that has enabled repeater mode calls  
         * process() frequently. Repeaters should never sleep. 
         */
        
        // Enable debug prints to serial monitor
        #define MY_DEBUG 
        
        // Enable and select radio type attached
        #define MY_RADIO_NRF24
        //#define MY_RADIO_RFM69
        
        // Enabled repeater feature for this node
        #define MY_REPEATER_FEATURE
        #define MY_NODE_ID 99
        
        #include <SPI.h>
        #include <MySensors.h>
        
        void setup() {
          
        }
        
        void presentation()  
        {  
          //Send the sensor node sketch version information to the gateway
          sendSketchInfo("Repeater Node", "1.0");
        }
        
        void loop() 
        {
        }
        

        Sketch 4:

        /* Sketch with Si7021 and battery monitoring.
        by m26872, 20151109 
        */
        
        // Enable and select radio type attached
        #define MY_RADIO_NRF24
        //#define MY_PARENT_NODE_ID 31
        #define MY_NODE_ID 4
        //#define MY_DEBUG
        
        #define MY_BAUD_RATE 9600
        
        
        #include <MySensors.h>  
        #include <Wire.h>  //This library allows you to communicate with I2C / TWI devices. 
        #include <SPI.h>
        #include <RunningAverage.h>
        
        #include <SparkFunBME280.h>
        
        
        
        //#define DEBUG   // local debug
        
        #ifdef DEBUG
        #define DEBUG_SERIAL(x) Serial.begin(x)
        #define DEBUG_PRINT(x) Serial.print(x)
        #define DEBUG_PRINTLN(x) Serial.println(x)
        #else
        #define DEBUG_SERIAL(x)
        #define DEBUG_PRINT(x) 
        #define DEBUG_PRINTLN(x) 
        #endif
        
        // #define NODE_ID 132             // <<<<<<<<<<<<<<<<<<<<<<<<<<<   Enter Node_ID
        #define CHILD_ID_HUM 0
        #define CHILD_ID_TEMP 1
        #define CHILD_ID_PRES 2
         #define SLEEP_TIME 15000 // 15s for DEBUG
        //#define SLEEP_TIME 300000   // 5 min
        #define FORCE_TRANSMIT_CYCLE 36  // 5min*12=1/hour, 5min*36=1/3hour 
        #define BATTERY_REPORT_CYCLE 2880   // Once per 5min   =>   12*24*7 = 2016 (one report/week)
        #define VMIN 1900
        #define VMAX 3300
        #define HUMI_TRANSMIT_THRESHOLD 3.0  // THRESHOLD tells how much the value should have changed since last time it was transmitted.
        #define TEMP_TRANSMIT_THRESHOLD 0.5
        #define PRES_TRANSMIT_THRESHOLD 1.0
        #define AVERAGES 2
        
        int batteryReportCounter = BATTERY_REPORT_CYCLE - 1;  // to make it report the first time.
        int measureCount = 0;
        float lastTemperature = -100;
        float lastPressure = -100;
        int lastHumidity = -100;
        
        RunningAverage raHum(AVERAGES);
        //SI7021 humiditySensor;
        BME280 mySensor;
        
        
        // MyMessage to controler
        MyMessage msgTemp(CHILD_ID_TEMP,V_TEMP); // Initialize temperature message
        MyMessage msgHum(CHILD_ID_HUM,V_HUM);
        MyMessage msgPres(CHILD_ID_PRES,V_PRESSURE);
        
        void presentation()
        {
          // Send the sketch version information to the gateway and Controller
          sendSketchInfo("OUTSIDE P&T&H", "1.2");
          present(CHILD_ID_TEMP, S_TEMP);
          present(CHILD_ID_PRES, S_BARO);
          present(CHILD_ID_HUM, S_HUM);  
          DEBUG_PRINT("Node and "); DEBUG_PRINTLN("3 children presented.");
        }
        
        void setup() {
          DEBUG_SERIAL(9600);    // <<<<<<<<<<<<<<<<<<<<<<<<<< Note BAUD_RATE in MySensors.h
          DEBUG_PRINTLN("Serial started");
          
          DEBUG_PRINT("Voltage: ");
          DEBUG_PRINT(readVcc()); 
          DEBUG_PRINTLN(" mV");
        /*
          delay(500);
          DEBUG_PRINT("Internal temp: ");
          DEBUG_PRINT(GetInternalTemp()); // Probably not calibrated. Just to print something.
          DEBUG_PRINTLN(" *C");
        */  
        
          mySensor.settings.commInterface = I2C_MODE;
          mySensor.settings.I2CAddress = 0x77;
        
          //runMode can be:
          //  0, Sleep mode
          //  1 or 2, Forced mode
          //  3, Normal mode
          mySensor.settings.runMode = 1;
          mySensor.settings.filter = 0;
          mySensor.settings.tempOverSample = 1;
          mySensor.settings.pressOverSample = 1;
          mySensor.settings.humidOverSample = 1;
          
          delay(500); // Allow time for radio if power used as reset
        
          if (!mySensor.begin())
           {
            Serial.println("BME init failed!");
            while (1);
           }
          else Serial.println("BME init success!");
          
          raHum.clear();
          
        }
        
        void loop() { 
        
          measureCount ++;
          batteryReportCounter ++;
          bool forceTransmit = false;
          
          if (measureCount > FORCE_TRANSMIT_CYCLE) {
            forceTransmit = true; 
          }
          mySensor.begin();
          sendTempHumidityMeasurements(forceTransmit);
        /*
          // Read and print internal temp
          float temperature0 = static_cast<float>(static_cast<int>((GetInternalTemp()+0.5) * 10.)) / 10.;
          DEBUG_PRINT("Internal Temp: "); DEBUG_PRINT(temperature0); DEBUG_PRINTLN(" *C");        
        */
          // Check battery
          if (batteryReportCounter >= BATTERY_REPORT_CYCLE) {
            long batteryVolt = readVcc();
            DEBUG_PRINT("Battery voltage: "); DEBUG_PRINT(batteryVolt); DEBUG_PRINTLN(" mV");
            uint8_t batteryPcnt = constrain(map(batteryVolt,VMIN,VMAX,0,100),0,255);   
            DEBUG_PRINT("Battery percent: "); DEBUG_PRINT(batteryPcnt); DEBUG_PRINTLN(" %");
            sendBatteryLevel(batteryPcnt);
            batteryReportCounter = 0;
          }
          
        //  sleep(SLEEP_TIME);
        if(isTransportOK()){
            sleep(SLEEP_TIME);  // transport is OK, node can sleep
          } 
          else {
            wait(5000); // transport is not operational, allow the transport layer to fix this
          }
        }
        
        // function for reading Vcc by reading 1.1V reference against AVcc. Based from http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/
        // To calibrate reading replace 1125300L with scale_constant = internal1.1Ref * 1023 * 1000, where internal1.1Ref = 1.1 * Vcc1 (per voltmeter) / Vcc2 (per readVcc() function) 
        long readVcc() {
          // set the reference to Vcc and the measurement to the internal 1.1V reference
          ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
          delay(2); // Wait for Vref to settle
          ADCSRA |= _BV(ADSC); // Start conversion
          while (bit_is_set(ADCSRA,ADSC)); // measuring
          uint8_t low  = ADCL; // must read ADCL first - it then locks ADCH  
          uint8_t high = ADCH; // unlocks both
          long result = (high<<8) | low;
          result = 1134738L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000
          return result; // Vcc in millivolts
        }
        // function for reading internal temp. From http://playground.arduino.cc/Main/InternalTemperatureSensor 
        double GetInternalTemp(void) {  // (Both double and float are 4 byte in most arduino implementation)
          unsigned int wADC;
          double t;
          // The internal temperature has to be used with the internal reference of 1.1V. Channel 8 can not be selected with the analogRead function yet.
          ADMUX = (_BV(REFS1) | _BV(REFS0) | _BV(MUX3));   // Set the internal reference and mux.
          ADCSRA |= _BV(ADEN);  // enable the ADC
          delay(20);            // wait for voltages to become stable.
          ADCSRA |= _BV(ADSC);  // Start the ADC
          while (bit_is_set(ADCSRA,ADSC));   // Detect end-of-conversion
          wADC = ADCW;   // Reading register "ADCW" takes care of how to read ADCL and ADCH.
          t = (wADC - 88.0 ) / 1.0;   // The default offset is 324.31.
          return (t);   // The returned temperature in degrees Celcius.
        }
        
        /*********************************************
         * * Sends temperature and humidity from Si7021 sensor
         * Parameters
         * - force : Forces transmission of a value (even if it's the same as previous measurement)
         *********************************************/
        void sendTempHumidityMeasurements(bool force) {
          bool tx = force;
        
          float temperature = mySensor.readTempC();
          DEBUG_PRINT("T: ");DEBUG_PRINTLN(temperature);
          float diffTemp = abs(lastTemperature - temperature);
          DEBUG_PRINT(F("TempDiff :"));DEBUG_PRINTLN(diffTemp);
          if (diffTemp > TEMP_TRANSMIT_THRESHOLD || tx) {
            send(msgTemp.set(temperature,1));
            lastTemperature = temperature;
            measureCount = 0;
            DEBUG_PRINTLN("T sent!");
          }
          
          int humidity = mySensor.readFloatHumidity();
          DEBUG_PRINT("H: ");DEBUG_PRINTLN(humidity);
          raHum.addValue(humidity);
          humidity = raHum.getAverage();  // MA sample imply reasonable fast sample frequency
          float diffHum = abs(lastHumidity - humidity);  
          DEBUG_PRINT(F("HumDiff  :"));DEBUG_PRINTLN(diffHum); 
          if (diffHum > HUMI_TRANSMIT_THRESHOLD || tx) {
            send(msgHum.set(humidity));
            lastHumidity = humidity;
            measureCount = 0;
            DEBUG_PRINTLN("H sent!");
          }
        
          float pressure = mySensor.readFloatPressure()/100.0;
          DEBUG_PRINT("P: ");DEBUG_PRINTLN(pressure);
          float diffPress = abs(lastPressure - pressure);
          DEBUG_PRINT(F("PressDiff :"));DEBUG_PRINTLN(diffPress);
          if (diffPress > PRES_TRANSMIT_THRESHOLD || tx) {
            send(msgPres.set(pressure,1));
            lastPressure = pressure;
            measureCount = 0;
            DEBUG_PRINTLN("P sent!");
          }
        
        }
        

        Sketch Node 30:

        /* Sketch with Si7021 and battery monitoring.
        by m26872, 20151109 
        */
        
        // Enable and select radio type attached
        #define MY_RADIO_NRF24
        //#define MY_DEBUG
        //#define MY_PARENT_NODE_ID 31
        //#define MY_NODE_ID 30
        
        #define MY_BAUD_RATE 9600
        
        
        #include <MySensors.h>  
        #include <Wire.h>  //This library allows you to communicate with I2C / TWI devices. 
        #include <SI7021.h>
        #include <SPI.h>
        #include <RunningAverage.h>
        
        
        #define DEBUG
        
        #ifdef DEBUG
        #define DEBUG_SERIAL(x) Serial.begin(x)
        #define DEBUG_PRINT(x) Serial.print(x)
        #define DEBUG_PRINTLN(x) Serial.println(x)
        #else
        #define DEBUG_SERIAL(x)
        #define DEBUG_PRINT(x) 
        #define DEBUG_PRINTLN(x) 
        #endif
        
        // #define NODE_ID 132             // <<<<<<<<<<<<<<<<<<<<<<<<<<<   Enter Node_ID
        #define CHILD_ID_TEMP 0
        #define CHILD_ID_HUM 1
        // #define SLEEP_TIME 15000 // 15s for DEBUG
        #define SLEEP_TIME 300000   // 5 min
        #define FORCE_TRANSMIT_CYCLE 36  // 5min*12=1/hour, 5min*36=1/3hour 
        #define BATTERY_REPORT_CYCLE 2880   // Once per 5min   =>   12*24*7 = 2016 (one report/week)
        #define VMIN 1900
        #define VMAX 3300
        #define HUMI_TRANSMIT_THRESHOLD 3.0  // THRESHOLD tells how much the value should have changed since last time it was transmitted.
        #define TEMP_TRANSMIT_THRESHOLD 0.5
        #define AVERAGES 2
        
        int batteryReportCounter = BATTERY_REPORT_CYCLE - 1;  // to make it report the first time.
        int measureCount = 0;
        float lastTemperature = -100;
        int lastHumidity = -100;
        
        RunningAverage raHum(AVERAGES);
        SI7021 humiditySensor;
        
        
        MyMessage msgTemp(CHILD_ID_TEMP,V_TEMP); // Initialize temperature message
        MyMessage msgHum(CHILD_ID_HUM,V_HUM);
        
        void presentation()
        {
        sendSketchInfo("EgTmpHumBat5min", "1.0 151106"); 
          present(CHILD_ID_TEMP, S_TEMP);   // Present sensor to controller
          present(CHILD_ID_HUM, S_HUM);
          DEBUG_PRINT("Node and "); DEBUG_PRINTLN("2 children presented.");
        }
        
        void setup() {
          DEBUG_SERIAL(9600);    // <<<<<<<<<<<<<<<<<<<<<<<<<< Note BAUD_RATE in MySensors.h
          DEBUG_PRINTLN("Serial started");
          
          DEBUG_PRINT("Voltage: ");
          DEBUG_PRINT(readVcc()); 
          DEBUG_PRINTLN(" mV");
        /*
          delay(500);
          DEBUG_PRINT("Internal temp: ");
          DEBUG_PRINT(GetInternalTemp()); // Probably not calibrated. Just to print something.
          DEBUG_PRINTLN(" *C");
        */  
          delay(500); // Allow time for radio if power useed as reset
          
          
          
          raHum.clear();
          
        }
        
        void loop() { 
        
          measureCount ++;
          batteryReportCounter ++;
          bool forceTransmit = false;
          
          if (measureCount > FORCE_TRANSMIT_CYCLE) {
            forceTransmit = true; 
          }
          sendTempHumidityMeasurements(forceTransmit);
        /*
          // Read and print internal temp
          float temperature0 = static_cast<float>(static_cast<int>((GetInternalTemp()+0.5) * 10.)) / 10.;
          DEBUG_PRINT("Internal Temp: "); DEBUG_PRINT(temperature0); DEBUG_PRINTLN(" *C");        
        */
          // Check battery
          if (batteryReportCounter >= BATTERY_REPORT_CYCLE) {
            long batteryVolt = readVcc();
            DEBUG_PRINT("Battery voltage: "); DEBUG_PRINT(batteryVolt); DEBUG_PRINTLN(" mV");
            uint8_t batteryPcnt = constrain(map(batteryVolt,VMIN,VMAX,0,100),0,255);   
            DEBUG_PRINT("Battery percent: "); DEBUG_PRINT(batteryPcnt); DEBUG_PRINTLN(" %");
            sendBatteryLevel(batteryPcnt);
            batteryReportCounter = 0;
          }
          
          sleep(SLEEP_TIME);
        }
        
        // function for reading Vcc by reading 1.1V reference against AVcc. Based from http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/
        // To calibrate reading replace 1125300L with scale_constant = internal1.1Ref * 1023 * 1000, where internal1.1Ref = 1.1 * Vcc1 (per voltmeter) / Vcc2 (per readVcc() function) 
        long readVcc() {
          // set the reference to Vcc and the measurement to the internal 1.1V reference
          ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
          delay(2); // Wait for Vref to settle
          ADCSRA |= _BV(ADSC); // Start conversion
          while (bit_is_set(ADCSRA,ADSC)); // measuring
          uint8_t low  = ADCL; // must read ADCL first - it then locks ADCH  
          uint8_t high = ADCH; // unlocks both
          long result = (high<<8) | low;
          result = 1134738L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000
          return result; // Vcc in millivolts
        }
        // function for reading internal temp. From http://playground.arduino.cc/Main/InternalTemperatureSensor 
        double GetInternalTemp(void) {  // (Both double and float are 4 byte in most arduino implementation)
          unsigned int wADC;
          double t;
          // The internal temperature has to be used with the internal reference of 1.1V. Channel 8 can not be selected with the analogRead function yet.
          ADMUX = (_BV(REFS1) | _BV(REFS0) | _BV(MUX3));   // Set the internal reference and mux.
          ADCSRA |= _BV(ADEN);  // enable the ADC
          delay(20);            // wait for voltages to become stable.
          ADCSRA |= _BV(ADSC);  // Start the ADC
          while (bit_is_set(ADCSRA,ADSC));   // Detect end-of-conversion
          wADC = ADCW;   // Reading register "ADCW" takes care of how to read ADCL and ADCH.
          t = (wADC - 88.0 ) / 1.0;   // The default offset is 324.31.
          return (t);   // The returned temperature in degrees Celcius.
        }
        
        /*********************************************
         * * Sends temperature and humidity from Si7021 sensor
         * Parameters
         * - force : Forces transmission of a value (even if it's the same as previous measurement)
         *********************************************/
        void sendTempHumidityMeasurements(bool force) {
          bool tx = force;
        
          si7021_env data = humiditySensor.getHumidityAndTemperature();
          
          float temperature = data.celsiusHundredths / 100.0;
          DEBUG_PRINT("T: ");DEBUG_PRINTLN(temperature);
          float diffTemp = abs(lastTemperature - temperature);
          DEBUG_PRINT(F("TempDiff :"));DEBUG_PRINTLN(diffTemp);
          if (diffTemp > TEMP_TRANSMIT_THRESHOLD || tx) {
            send(msgTemp.set(temperature,1));
            lastTemperature = temperature;
            measureCount = 0;
            DEBUG_PRINTLN("T sent!");
          }
          
          int humidity = data.humidityPercent;
          DEBUG_PRINT("H: ");DEBUG_PRINTLN(humidity);
          raHum.addValue(humidity);
          humidity = raHum.getAverage();  // MA sample imply reasonable fast sample frequency
          float diffHum = abs(lastHumidity - humidity);  
          DEBUG_PRINT(F("HumDiff  :"));DEBUG_PRINTLN(diffHum); 
          if (diffHum > HUMI_TRANSMIT_THRESHOLD || tx) {
            send(msgHum.set(humidity));
            lastHumidity = humidity;
            measureCount = 0;
            DEBUG_PRINTLN("H sent!");
          }
        
        }
        
        1 Reply Last reply
        0
        • Daniel OliveiraD Daniel Oliveira

          Hi @karl261,

          It's a long shot but can you double check your power sources? I had some weird issues like those in the past because of bad quality power sources.

          I recommend adding a 47uF electrolytic capacitor as close as possible to the NRF24 GND and VCC pins, as a 470uF between the GND and the Vin pins of the arduino.

          And keep the external power source on even when connecting the USB cable to read the debug messages.

          Hope you solve this issue soon

          karl261K Offline
          karl261K Offline
          karl261
          wrote on last edited by karl261
          #11

          @Daniel-Oliveira Yeah, I know about these power things. I am pretty sure the power is ok. I use the caps on all my nodes. For the repeater (99) I picked a very stable 5V source and the NRF24+PA+LNA sits behind its own 3.3V regulator that has a high current output. The NRF24+PA+LNA is shielded after @Oitzu's method, so it should not interfere with itself. Actually I tried to implement all the tricks.
          Btw, all is on 2.0.0.
          GW: Nano
          99: Pro mini
          30 + 4: 1Mhz battery nodes after @m26872's "My Slim 2AA Battery Node".

          It all sounds too nice to be true... ;-)

          1 Reply Last reply
          0
          • tekkaT tekka

            @karl261 Ok, I need to see the sketches first: can you post the sketch of all nodes, i.e. GW, node 99, node 3, node 4? Also, do you have MYSController installed for a few tests?

            karl261K Offline
            karl261K Offline
            karl261
            wrote on last edited by karl261
            #12

            @tekka MYSController? No, but if you point me to a link or so I could install of course.

            Edit: Ok, I downloaded your software. It seems it is running well on my PC. I am ready to test.
            Edit2: The 1.0.0beta.

            tekkaT 1 Reply Last reply
            0
            • karl261K karl261

              @tekka MYSController? No, but if you point me to a link or so I could install of course.

              Edit: Ok, I downloaded your software. It seems it is running well on my PC. I am ready to test.
              Edit2: The 1.0.0beta.

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

              @karl261 What version is it saying?

              karl261K 1 Reply Last reply
              0
              • tekkaT tekka

                @karl261 What version is it saying?

                karl261K Offline
                karl261K Offline
                karl261
                wrote on last edited by
                #14

                @tekka 1.0.0beta built 3314

                tekkaT 1 Reply Last reply
                0
                • karl261K karl261

                  @tekka 1.0.0beta built 3314

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

                  @karl261 Ok, then send a C_INTERNAL | I_DEBUG | R message to the GW and node 99 and upload the output.

                  karl261K 1 Reply Last reply
                  0
                  • tekkaT tekka

                    @karl261 Ok, then send a C_INTERNAL | I_DEBUG | R message to the GW and node 99 and upload the output.

                    karl261K Offline
                    karl261K Offline
                    karl261
                    wrote on last edited by
                    #16

                    @tekka So you mean I connect to my serial gateway and then issue the commands? Yes, let's see.

                    1 Reply Last reply
                    0
                    • karl261K Offline
                      karl261K Offline
                      karl261
                      wrote on last edited by
                      #17

                      Here we go:

                      10	22.08.2016 21:49:41	TX	0 - Gateway	N/A	C_INTERNAL	NO	I_DEBUG	R
                      12	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0202
                      14	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0303
                      16	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0463
                      18	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	1E1E
                      20	22.08.2016 21:49:42	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	1F1F
                      22	22.08.2016 21:49:42	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	6363
                      24	22.08.2016 21:49:42	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	8B03
                      25	22.08.2016 21:50:06	TX	99 - Repeater Node	N/A	C_INTERNAL	NO	I_DEBUG	R
                      28	22.08.2016 21:50:06	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0000
                      30	22.08.2016 21:50:06	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0303
                      32	22.08.2016 21:50:07	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0404
                      34	22.08.2016 21:50:07	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	1E1E
                      37	22.08.2016 21:50:23	RX	2	1	C_SET	NO	V_TEMP	20.8
                      39	22.08.2016 21:50:23	RX	2	0	C_SET	NO	V_HUM	76.1
                      
                      tekkaT 1 Reply Last reply
                      0
                      • karl261K karl261

                        Here we go:

                        10	22.08.2016 21:49:41	TX	0 - Gateway	N/A	C_INTERNAL	NO	I_DEBUG	R
                        12	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0202
                        14	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0303
                        16	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0463
                        18	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	1E1E
                        20	22.08.2016 21:49:42	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	1F1F
                        22	22.08.2016 21:49:42	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	6363
                        24	22.08.2016 21:49:42	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	8B03
                        25	22.08.2016 21:50:06	TX	99 - Repeater Node	N/A	C_INTERNAL	NO	I_DEBUG	R
                        28	22.08.2016 21:50:06	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0000
                        30	22.08.2016 21:50:06	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0303
                        32	22.08.2016 21:50:07	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0404
                        34	22.08.2016 21:50:07	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	1E1E
                        37	22.08.2016 21:50:23	RX	2	1	C_SET	NO	V_TEMP	20.8
                        39	22.08.2016 21:50:23	RX	2	0	C_SET	NO	V_HUM	76.1
                        
                        tekkaT Offline
                        tekkaT Offline
                        tekka
                        Admin
                        wrote on last edited by tekka
                        #18

                        @karl261 Ok, and now send C_INTERNAL | I_DEBUG | E - first to node 99, then to the GW and finally, press Discover in MYSController. This should re-establish the routing table.

                        karl261K 1 Reply Last reply
                        0
                        • tekkaT tekka

                          @karl261 Ok, and now send C_INTERNAL | I_DEBUG | E - first to node 99, then to the GW and finally, press Discover in MYSController. This should re-establish the routing table.

                          karl261K Offline
                          karl261K Offline
                          karl261
                          wrote on last edited by
                          #19

                          @tekka I received ok twice back. Now the nano (GW) is blinking like crazy. And so is the pro mini (repeater). I do a power cycle?

                          tekkaT 1 Reply Last reply
                          0
                          • karl261K karl261

                            @tekka I received ok twice back. Now the nano (GW) is blinking like crazy. And so is the pro mini (repeater). I do a power cycle?

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

                            @karl261 yup

                            karl261K 1 Reply Last reply
                            0
                            • tekkaT tekka

                              @karl261 yup

                              karl261K Offline
                              karl261K Offline
                              karl261
                              wrote on last edited by
                              #21

                              @tekka Still weird:
                              99 says 0203 so 02 is going via 03?? Why?
                              0 says 0263 so 02 is going via 99?

                              247	22.08.2016 22:15:24	TX	99 - Repeater Node	N/A	C_INTERNAL	NO	I_DEBUG	R
                              250	22.08.2016 22:15:24	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0000
                              252	22.08.2016 22:15:24	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0203
                              254	22.08.2016 22:15:24	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0404
                              255	22.08.2016 22:15:50	TX	0 - Gateway	N/A	C_INTERNAL	NO	I_DEBUG	R
                              257	22.08.2016 22:15:50	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0263
                              259	22.08.2016 22:15:50	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	6363
                              
                              tekkaT 1 Reply Last reply
                              0
                              • karl261K karl261

                                @tekka Still weird:
                                99 says 0203 so 02 is going via 03?? Why?
                                0 says 0263 so 02 is going via 99?

                                247	22.08.2016 22:15:24	TX	99 - Repeater Node	N/A	C_INTERNAL	NO	I_DEBUG	R
                                250	22.08.2016 22:15:24	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0000
                                252	22.08.2016 22:15:24	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0203
                                254	22.08.2016 22:15:24	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0404
                                255	22.08.2016 22:15:50	TX	0 - Gateway	N/A	C_INTERNAL	NO	I_DEBUG	R
                                257	22.08.2016 22:15:50	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0263
                                259	22.08.2016 22:15:50	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	6363
                                
                                tekkaT Offline
                                tekkaT Offline
                                tekka
                                Admin
                                wrote on last edited by
                                #22

                                @karl261 hmm...indeed, that's weird. Do you have the debug log of node 3?

                                karl261K 1 Reply Last reply
                                0
                                • tekkaT tekka

                                  @karl261 hmm...indeed, that's weird. Do you have the debug log of node 3?

                                  karl261K Offline
                                  karl261K Offline
                                  karl261
                                  wrote on last edited by
                                  #23

                                  @tekka Which log exactly? Node 3 is Mysensors 1.5... It is sitting somewhere hidden...

                                  tekkaT 1 Reply Last reply
                                  0
                                  • karl261K karl261

                                    @tekka Which log exactly? Node 3 is Mysensors 1.5... It is sitting somewhere hidden...

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

                                    @karl261 But you wrote:

                                    Btw, all is on 2.0.0.

                                    mixed setups are not advisable (and not supported). Please update if possible.

                                    karl261K 1 Reply Last reply
                                    0
                                    • tekkaT tekka

                                      @karl261 But you wrote:

                                      Btw, all is on 2.0.0.

                                      mixed setups are not advisable (and not supported). Please update if possible.

                                      karl261K Offline
                                      karl261K Offline
                                      karl261
                                      wrote on last edited by
                                      #25

                                      @tekka Yes, with "all" I meant those being involved in the repeater stuff.

                                      tekkaT 1 Reply Last reply
                                      0
                                      • karl261K karl261

                                        @tekka Yes, with "all" I meant those being involved in the repeater stuff.

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

                                        @karl261 Can you add this to node 4 (this is the relayed one?):

                                        #define MY_PARENT_NODE_ID 99
                                        #define MY_PARENT_NODE_IS_STATIC
                                        
                                        karl261K 2 Replies Last reply
                                        0
                                        • tekkaT tekka

                                          @karl261 Can you add this to node 4 (this is the relayed one?):

                                          #define MY_PARENT_NODE_ID 99
                                          #define MY_PARENT_NODE_IS_STATIC
                                          
                                          karl261K Offline
                                          karl261K Offline
                                          karl261
                                          wrote on last edited by karl261
                                          #27

                                          @tekka I can add it to node 30 right now. It is also supposed to be relayed. In fact this is why I did start this thread in the first place, I had no luck with these two lines. Will try again.

                                          Oooohhh, there is a mistake further up: I am talking about node 30, and wrote node 3. That is incorrect. Let's see if I can edit. That is why you were asking about the 1.5...

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


                                          18

                                          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