Repeater drops nodes
-
@tekka well, unfortunately i had the same problem. The far away node connected to the Repeater but after aprox 1h working ok, it stopped being updated at Domoticz with transportCheckUplink() false.
You changed a timing setting, right? With the normal version the node stopped being updated at about 15-16 min and now it changed to about 1 hour…
I have a node connected directly to the gateway with the nrf24L01+ PA+LNA working without problems, so it seems to be some kind of problem with the Repeater code and timings... -
@titvs It would be helpful if you could post the debug log showing what you describe + the sketch you are using.
-
@tekka well, unfortunately i had the same problem. The far away node connected to the Repeater but after aprox 1h working ok, it stopped being updated at Domoticz with transportCheckUplink() false.
You changed a timing setting, right? With the normal version the node stopped being updated at about 15-16 min and now it changed to about 1 hour…
I have a node connected directly to the gateway with the nrf24L01+ PA+LNA working without problems, so it seems to be some kind of problem with the Repeater code and timings... -
@titvs I have tested a repeater and it is still working ok after 48 hours using the CE timing modified code.
-
@tekka the debug log (MY_DEBUG)/sketch from the node that gets disconnected or the repeater?
-
@tekka Well, im running your beta code and like @itbeyond it seems to be working for 24h now. Uploaded the new compiles with the lib from the RF24Fix branch to all the nodes, gateway and repeater and it seems the drops stopped.
Built a couple of Relay nodes, one of which is connected to the repeater and they also seem to be working correctly.Im linking the ZIP to the node log file with the RF24 verbose debug (its a tad big), if you want to take a look:
And this is my TEMP+HUM node sketch:
// Enable debug prints //#define MY_DEBUG //#define MY_DEBUG_VERBOSE_RF24 // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 //#define MY_RS485 #define MY_RF24_CHANNEL 1 ////////////// #define MY_RF24_PA_LEVEL RF24_PA_HIGH // ONLY IF USING FIXED ID REPEATER //#define MY_PARENT_NODE_ID 0 // REPEATER NODE ID //#define MY_PARENT_NODE_IS_STATIC // this will force your node to use only the repeater // #define MY_REPEATER_FEATURE #include <SPI.h> #include <MySensors.h> #include <DHT.h> #include <U8g2lib.h> ////////////////////// #include <Wire.h> ///////////////////////// U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, A5, A4); // U8G2 Constructor (A5 - Clock SCL ; A4 - Data SDA) #define DHT_DATA_PIN 3 #define SENSOR_TEMP_OFFSET 0 static const uint64_t UPDATE_INTERVAL = 60000; static const uint8_t FORCE_UPDATE_N_READS = 10; #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 float lastTemp; float lastHum; uint8_t nNoUpdatesTemp; uint8_t nNoUpdatesHum; bool metric = true; MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); DHT dht; void before(){ u8g2.begin(); u8g2.firstPage(); do { u8g2.setFont(u8g2_font_helvR14_tf); u8g2.drawStr(38,15,"OLED"); u8g2.drawStr(15,35,"Temp+Hum"); u8g2.drawStr(46,60,"v1.2"); } while ( u8g2.nextPage() ); delay(3000); u8g2.clear(); u8g2.firstPage(); do { u8g2.drawStr(3, 32, "Connecting..."); } while ( u8g2.nextPage() ); } void presentation() { // Send the sketch version information to the gateway sendSketchInfo("TEMPHUM_OLED", "1.2"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_HUM, S_HUM); present(CHILD_ID_TEMP, S_TEMP); metric = getControllerConfig().isMetric; } void setup() { u8g2.clear(); dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) { u8g2.firstPage(); do { u8g2.setFont(u8g2_font_haxrcorp4089_tr); // 7 PIXEL HIGHT u8g2.drawStr(1,12,"WARNING: UPDATE_INTERVAL"); u8g2.drawStr(1,24,"is smaller than supported by"); u8g2.drawStr(1,36,"the sensor!"); } while ( u8g2.nextPage() ); delay(4000); } sleep(dht.getMinimumSamplingPeriod()); } void loop() { while (transportCheckUplink() == false){ u8g2.firstPage(); do { u8g2.setFont(u8g2_font_helvR14_tf); // 14 px height u8g2.drawStr(3, 32, "Disconnected!"); } while ( u8g2.nextPage() ); } dht.readSensor(true); float temperature = dht.getTemperature(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT!"); } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) { // Only send temperature if it changed since the last measurement or if we didn't send an update for n times lastTemp = temperature; // apply the offset before converting to something different than Celsius degrees temperature += SENSOR_TEMP_OFFSET; if (!metric) { temperature = dht.toFahrenheit(temperature); } // Reset no updates counter nNoUpdatesTemp = 0; send(msgTemp.set(temperature, 1)); #ifdef MY_DEBUG Serial.print("T: "); Serial.println(temperature); #endif } else { // Increase no update counter if the temperature stayed the same nNoUpdatesTemp++; } // Get humidity from DHT library float humidity = dht.getHumidity(); if (isnan(humidity)) { Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum || nNoUpdatesHum == FORCE_UPDATE_N_READS) { // Only send humidity if it changed since the last measurement or if we didn't send an update for n times lastHum = humidity; // Reset no updates counter nNoUpdatesHum = 0; send(msgHum.set(humidity, 1)); #ifdef MY_DEBUG Serial.print("H: "); Serial.println(humidity); #endif } else { // Increase no update counter if the humidity stayed the same nNoUpdatesHum++; } u8g2.firstPage(); do { u8g2.setFont(u8g2_font_fub30_tn); u8g2.setCursor(2, 35); u8g2.print(temperature, 1); u8g2.setFont(u8g2_font_inb16_mf); u8g2.drawGlyph(88, 35, 0x00b0); // degree u8g2.drawStr(100, 35, "C"); u8g2.setCursor(70, 60); u8g2.print(humidity, 0); u8g2.drawStr(100, 60, "%"); u8g2.setFont(u8g2_font_open_iconic_thing_2x_t); // 16 pix height u8g2.drawGlyph(45, 60, 0x0048); // drop } while ( u8g2.nextPage() ); // Sleep for a while to save energy //sleep(UPDATE_INTERVAL); delay(UPDATE_INTERVAL); // POWERED NODE } -
@tekka Well, im running your beta code and like @itbeyond it seems to be working for 24h now. Uploaded the new compiles with the lib from the RF24Fix branch to all the nodes, gateway and repeater and it seems the drops stopped.
Built a couple of Relay nodes, one of which is connected to the repeater and they also seem to be working correctly.Im linking the ZIP to the node log file with the RF24 verbose debug (its a tad big), if you want to take a look:
And this is my TEMP+HUM node sketch:
// Enable debug prints //#define MY_DEBUG //#define MY_DEBUG_VERBOSE_RF24 // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 //#define MY_RS485 #define MY_RF24_CHANNEL 1 ////////////// #define MY_RF24_PA_LEVEL RF24_PA_HIGH // ONLY IF USING FIXED ID REPEATER //#define MY_PARENT_NODE_ID 0 // REPEATER NODE ID //#define MY_PARENT_NODE_IS_STATIC // this will force your node to use only the repeater // #define MY_REPEATER_FEATURE #include <SPI.h> #include <MySensors.h> #include <DHT.h> #include <U8g2lib.h> ////////////////////// #include <Wire.h> ///////////////////////// U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, A5, A4); // U8G2 Constructor (A5 - Clock SCL ; A4 - Data SDA) #define DHT_DATA_PIN 3 #define SENSOR_TEMP_OFFSET 0 static const uint64_t UPDATE_INTERVAL = 60000; static const uint8_t FORCE_UPDATE_N_READS = 10; #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 float lastTemp; float lastHum; uint8_t nNoUpdatesTemp; uint8_t nNoUpdatesHum; bool metric = true; MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); DHT dht; void before(){ u8g2.begin(); u8g2.firstPage(); do { u8g2.setFont(u8g2_font_helvR14_tf); u8g2.drawStr(38,15,"OLED"); u8g2.drawStr(15,35,"Temp+Hum"); u8g2.drawStr(46,60,"v1.2"); } while ( u8g2.nextPage() ); delay(3000); u8g2.clear(); u8g2.firstPage(); do { u8g2.drawStr(3, 32, "Connecting..."); } while ( u8g2.nextPage() ); } void presentation() { // Send the sketch version information to the gateway sendSketchInfo("TEMPHUM_OLED", "1.2"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_HUM, S_HUM); present(CHILD_ID_TEMP, S_TEMP); metric = getControllerConfig().isMetric; } void setup() { u8g2.clear(); dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) { u8g2.firstPage(); do { u8g2.setFont(u8g2_font_haxrcorp4089_tr); // 7 PIXEL HIGHT u8g2.drawStr(1,12,"WARNING: UPDATE_INTERVAL"); u8g2.drawStr(1,24,"is smaller than supported by"); u8g2.drawStr(1,36,"the sensor!"); } while ( u8g2.nextPage() ); delay(4000); } sleep(dht.getMinimumSamplingPeriod()); } void loop() { while (transportCheckUplink() == false){ u8g2.firstPage(); do { u8g2.setFont(u8g2_font_helvR14_tf); // 14 px height u8g2.drawStr(3, 32, "Disconnected!"); } while ( u8g2.nextPage() ); } dht.readSensor(true); float temperature = dht.getTemperature(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT!"); } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) { // Only send temperature if it changed since the last measurement or if we didn't send an update for n times lastTemp = temperature; // apply the offset before converting to something different than Celsius degrees temperature += SENSOR_TEMP_OFFSET; if (!metric) { temperature = dht.toFahrenheit(temperature); } // Reset no updates counter nNoUpdatesTemp = 0; send(msgTemp.set(temperature, 1)); #ifdef MY_DEBUG Serial.print("T: "); Serial.println(temperature); #endif } else { // Increase no update counter if the temperature stayed the same nNoUpdatesTemp++; } // Get humidity from DHT library float humidity = dht.getHumidity(); if (isnan(humidity)) { Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum || nNoUpdatesHum == FORCE_UPDATE_N_READS) { // Only send humidity if it changed since the last measurement or if we didn't send an update for n times lastHum = humidity; // Reset no updates counter nNoUpdatesHum = 0; send(msgHum.set(humidity, 1)); #ifdef MY_DEBUG Serial.print("H: "); Serial.println(humidity); #endif } else { // Increase no update counter if the humidity stayed the same nNoUpdatesHum++; } u8g2.firstPage(); do { u8g2.setFont(u8g2_font_fub30_tn); u8g2.setCursor(2, 35); u8g2.print(temperature, 1); u8g2.setFont(u8g2_font_inb16_mf); u8g2.drawGlyph(88, 35, 0x00b0); // degree u8g2.drawStr(100, 35, "C"); u8g2.setCursor(70, 60); u8g2.print(humidity, 0); u8g2.drawStr(100, 60, "%"); u8g2.setFont(u8g2_font_open_iconic_thing_2x_t); // 16 pix height u8g2.drawGlyph(45, 60, 0x0048); // drop } while ( u8g2.nextPage() ); // Sleep for a while to save energy //sleep(UPDATE_INTERVAL); delay(UPDATE_INTERVAL); // POWERED NODE } -
@titvs ok, do you also have the repeater log + sketch? btw, for powered nodes I'd recommend using wait() instead of delay() - this ensures a proper functionality of the communcation stack.
@tekka i didnt save the log from the Repeater but if it helps i'm going to collect it. As for the Repeater sketch, its the default:
// Enable debug prints to serial monitor //#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #define MY_NODE_ID 51 // FIXED NODE ID #define MY_PARENT_NODE_ID 0 #define MY_PARENT_NODE_IS_STATIC #define MY_RF24_CHANNEL 1 #define MY_RF24_PA_LEVEL RF24_PA_HIGH // Enabled repeater feature for this node #define MY_REPEATER_FEATURE #include <MySensors.h> void setup() { } void presentation() { //Send the sensor node sketch version information to the gateway sendSketchInfo("Repeater Node", "1.0"); } void loop() { }``` -
@tekka i didnt save the log from the Repeater but if it helps i'm going to collect it. As for the Repeater sketch, its the default:
// Enable debug prints to serial monitor //#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #define MY_NODE_ID 51 // FIXED NODE ID #define MY_PARENT_NODE_ID 0 #define MY_PARENT_NODE_IS_STATIC #define MY_RF24_CHANNEL 1 #define MY_RF24_PA_LEVEL RF24_PA_HIGH // Enabled repeater feature for this node #define MY_REPEATER_FEATURE #include <MySensors.h> void setup() { } void presentation() { //Send the sensor node sketch version information to the gateway sendSketchInfo("Repeater Node", "1.0"); } void loop() { }``` -
@titvs Would be great if you collect the debug log of the repeater, especially when the NACKs happen - this may help to understand the origin of the issue