[SOLVED] I use serial GW 2.1.1 and my sensor node won't connect
-
I too had problems with my GW resetting.
I use custom designed PCBs with Atmega328p-au using the internal oscillator. With some nodes the GW will reset when I turn them on. Sometimes changing to another NRF-module solved it but this time none of my NRF-modules worked so I searched and found this thread. Flashed the GW with v2.2.0-rc.2 and now all my problems are gone. -
Hi,
I've got across similar problem. What works for you doesn't solve problem in my case.
Decreasing power to PA_LEVEL_LOW or switching to MySensors v2.2.0-rc.2 gives no positive result.I have some experience with Arduino, but it is my first try with MySensors and Domoticz.
If someone could advice how to cope with, thank you in advance.
My Hardware:
Arduino Nano, NRF21+ for GW & Node,
the node is simple actuator: relay with button.GW output on Serial monitor:
0;255;3;0;9;TSM:INIT 0;255;3;0;9;TSF:WUR:MS=0 0;255;3;0;9;TSM:INIT:TSP OK 0;255;3;0;9;TSM:INIT:GW MODE 0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0 0;255;3;0;9;MCO:REG:NOT NEEDED 0;255;3;0;14;Gateway startup complete. 0;255;0;0;18;2.1.1 0;255;3;0;9;MCO:BGN:STP 0;255;3;0;9;MCO:BGN:INIT OK,TSNode output on Serial Monitor:
0 MCO:BGN:INIT REPEATER,CP=RNNRA--,VER=2.1.1 3 TSM:INIT 4 TSF:WUR:MS=0 11 TSM:INIT:TSP OK 13 TSM:FPAR 15 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2023 !TSM:FPAR:NO REPLY 2025 TSM:FPAR 2027 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4035 !TSM:FPAR:NO REPLY 4037 TSM:FPAR 4039 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6047 !TSM:FPAR:NO REPLY 6049 TSM:FPAR 6051 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 8060 !TSM:FPAR:FAIL 8061 TSM:FAIL:CNT=1 8064 TSM:FAIL:PDT 18067 TSM:FAIL:RE-INIT 18069 TSM:INIT 18076 TSM:INIT:TSP OK 18078 TSM:FPAR 18080 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 20088 !TSM:FPAR:NO REPLY 20090 TSM:FPAR 20092 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 22102 !TSM:FPAR:NO REPLY 22104 TSM:FPAR 22106 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 24114 !TSM:FPAR:NO REPLY 24116 TSM:FPAR 24118 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 26126 !TSM:FPAR:FAIL 26127 TSM:FAIL:CNT=2 26129 TSM:FAIL:PDT etc...Scratches:
//Gateway #define MY_DEBUG #define MY_RADIO_NRF24 #define MY_RF24_PA_LEVEL RF24_PA_LOW #define MY_GATEWAY_SERIAL #define MY_INCLUSION_MODE_FEATURE #define MY_INCLUSION_MODE_DURATION 120 #define MY_DEFAULT_LED_BLINK_PERIOD 300 #include <MySensors.h> void setup() { } void presentation() { } void loop() { }Node:
#define MY_DEBUG #define MY_RADIO_NRF24 #define MY_REPEATER_FEATURE #include <SPI.h> #include <MyConfig.h> #include <MySensors.h> #include <Bounce2.h> #define RELAY_PIN 4 // Arduino Digital I/O pin number for relay #define BUTTON_PIN 5 // Arduino Digital I/O pin number for button #define CHILD_ID 10 // Id of the sensor (child) #define RELAY_ON 1 #define RELAY_OFF 0 Bounce debouncer = Bounce(); int oldValue=0; bool state; MyMessage msg(CHILD_ID,V_LIGHT); void setup() { // Setup the button pinMode(BUTTON_PIN,INPUT); // Setup debouncer debouncer.attach(BUTTON_PIN); debouncer.interval(5); // set relay on when starting up pinMode(RELAY_PIN, OUTPUT); state=true; digitalWrite(RELAY_PIN, RELAY_ON); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Relay & Button", "1.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID, S_LIGHT); } void loop() { debouncer.update(); // Get the update value int value = debouncer.read(); if (value != oldValue && value==0) { send(msg.set(state?false:true), true); // Send new state and request ack back Serial.println("zmiana value na 0"); // Change relay state localy, anyway state = !state; digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF); Serial.print("state = "); Serial.println(state); } oldValue = value; } void receive(const MyMessage &message) { if (message.isAck()) { Serial.println("This is an ack from gateway"); } if (message.type == V_LIGHT) { // Change relay state state = message.getBool(); digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } } -
Hi,
I've got across similar problem. What works for you doesn't solve problem in my case.
Decreasing power to PA_LEVEL_LOW or switching to MySensors v2.2.0-rc.2 gives no positive result.I have some experience with Arduino, but it is my first try with MySensors and Domoticz.
If someone could advice how to cope with, thank you in advance.
My Hardware:
Arduino Nano, NRF21+ for GW & Node,
the node is simple actuator: relay with button.GW output on Serial monitor:
0;255;3;0;9;TSM:INIT 0;255;3;0;9;TSF:WUR:MS=0 0;255;3;0;9;TSM:INIT:TSP OK 0;255;3;0;9;TSM:INIT:GW MODE 0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0 0;255;3;0;9;MCO:REG:NOT NEEDED 0;255;3;0;14;Gateway startup complete. 0;255;0;0;18;2.1.1 0;255;3;0;9;MCO:BGN:STP 0;255;3;0;9;MCO:BGN:INIT OK,TSNode output on Serial Monitor:
0 MCO:BGN:INIT REPEATER,CP=RNNRA--,VER=2.1.1 3 TSM:INIT 4 TSF:WUR:MS=0 11 TSM:INIT:TSP OK 13 TSM:FPAR 15 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2023 !TSM:FPAR:NO REPLY 2025 TSM:FPAR 2027 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4035 !TSM:FPAR:NO REPLY 4037 TSM:FPAR 4039 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6047 !TSM:FPAR:NO REPLY 6049 TSM:FPAR 6051 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 8060 !TSM:FPAR:FAIL 8061 TSM:FAIL:CNT=1 8064 TSM:FAIL:PDT 18067 TSM:FAIL:RE-INIT 18069 TSM:INIT 18076 TSM:INIT:TSP OK 18078 TSM:FPAR 18080 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 20088 !TSM:FPAR:NO REPLY 20090 TSM:FPAR 20092 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 22102 !TSM:FPAR:NO REPLY 22104 TSM:FPAR 22106 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 24114 !TSM:FPAR:NO REPLY 24116 TSM:FPAR 24118 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 26126 !TSM:FPAR:FAIL 26127 TSM:FAIL:CNT=2 26129 TSM:FAIL:PDT etc...Scratches:
//Gateway #define MY_DEBUG #define MY_RADIO_NRF24 #define MY_RF24_PA_LEVEL RF24_PA_LOW #define MY_GATEWAY_SERIAL #define MY_INCLUSION_MODE_FEATURE #define MY_INCLUSION_MODE_DURATION 120 #define MY_DEFAULT_LED_BLINK_PERIOD 300 #include <MySensors.h> void setup() { } void presentation() { } void loop() { }Node:
#define MY_DEBUG #define MY_RADIO_NRF24 #define MY_REPEATER_FEATURE #include <SPI.h> #include <MyConfig.h> #include <MySensors.h> #include <Bounce2.h> #define RELAY_PIN 4 // Arduino Digital I/O pin number for relay #define BUTTON_PIN 5 // Arduino Digital I/O pin number for button #define CHILD_ID 10 // Id of the sensor (child) #define RELAY_ON 1 #define RELAY_OFF 0 Bounce debouncer = Bounce(); int oldValue=0; bool state; MyMessage msg(CHILD_ID,V_LIGHT); void setup() { // Setup the button pinMode(BUTTON_PIN,INPUT); // Setup debouncer debouncer.attach(BUTTON_PIN); debouncer.interval(5); // set relay on when starting up pinMode(RELAY_PIN, OUTPUT); state=true; digitalWrite(RELAY_PIN, RELAY_ON); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Relay & Button", "1.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID, S_LIGHT); } void loop() { debouncer.update(); // Get the update value int value = debouncer.read(); if (value != oldValue && value==0) { send(msg.set(state?false:true), true); // Send new state and request ack back Serial.println("zmiana value na 0"); // Change relay state localy, anyway state = !state; digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF); Serial.print("state = "); Serial.println(state); } oldValue = value; } void receive(const MyMessage &message) { if (message.isAck()) { Serial.println("This is an ack from gateway"); } if (message.type == V_LIGHT) { // Change relay state state = message.getBool(); digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } } -
@mario64
Which home automation system are you using?
If using domoticz, then it's vital to accept new sensors, you find it setup->settings
Hardware/Devices:
Accept new Hardware Devicesif this is disabled, no sensors are allowed to be created
Hi @bjacobse,
thank you for answer. I'm back to my project after e few days.
Actually, the "Accept new Hardware Devices" switch is on. I also used the "Alow for 5 minutes" button. Let me share more details:- pls find log of Domoticz:
2018-01-22 09:55:34.871 MySensors: retrying in 30 seconds... 2018-01-22 09:56:00.874 MySensors: Serial Worker stopped... 2018-01-22 09:56:11.130 New sensors allowed for 5 minutes... 2018-01-22 09:56:43.077 MySensors: Using serial port: /dev/ttyUSB0 2018-01-22 10:02:38.123 MySensors: Serial Worker stopped... 2018-01-22 10:02:39.134 MySensors: Using serial port: /dev/ttyUSB0 2018-01-22 10:03:38.156 New sensors allowed for 5 minutes... 2018-01-22 10:04:00.048 Error: Gwx hardware (2) nothing received for more than 1 Minute!.... 2018-01-22 10:04:01.049 Error: Restarting: Gwx 2018-01-22 10:04:01.146 MySensors: Serial Worker stopped... 2018-01-22 10:04:02.157 MySensors: Using serial port: /dev/ttyUSB0 2018-01-22 10:05:30.219 Error: Gwx hardware (2) nothing received for more than 1 Minute!.... 2018-01-22 10:05:31.220 Error: Restarting: Gwx 2018-01-22 10:05:32.170 MySensors: Serial Worker stopped... 2018-01-22 10:05:33.181 MySensors: Using serial port: /dev/ttyUSB0 2018-01-22 10:07:00.204 Error: Gwx hardware (2) nothing received for more than 1 Minute!.... etc- screen shots:
-
list itemSetup->Hardware:
![Gateway settings]https://drive.google.com/file/d/1NjJZMlaM98XaZ-UCY93pyeHcKbT7ZZoh/view?usp=sharing -
list itemSetup->Hardware Gwx setup:
![Gwx Setup]https://drive.google.com/file/d/1vDVDcLGaGK_g3-uYQrl_DnlHlbvjq87Z/view?usp=sharing -
list itemSetup->Settings:
![Domoticz Settings]https://drive.google.com/file/d/15bkfnHx6rEcqRnTvLVOydwPK63dy83xe/view?usp=sharing
-
Hi @bjacobse,
thank you for answer. I'm back to my project after e few days.
Actually, the "Accept new Hardware Devices" switch is on. I also used the "Alow for 5 minutes" button. Let me share more details:- pls find log of Domoticz:
2018-01-22 09:55:34.871 MySensors: retrying in 30 seconds... 2018-01-22 09:56:00.874 MySensors: Serial Worker stopped... 2018-01-22 09:56:11.130 New sensors allowed for 5 minutes... 2018-01-22 09:56:43.077 MySensors: Using serial port: /dev/ttyUSB0 2018-01-22 10:02:38.123 MySensors: Serial Worker stopped... 2018-01-22 10:02:39.134 MySensors: Using serial port: /dev/ttyUSB0 2018-01-22 10:03:38.156 New sensors allowed for 5 minutes... 2018-01-22 10:04:00.048 Error: Gwx hardware (2) nothing received for more than 1 Minute!.... 2018-01-22 10:04:01.049 Error: Restarting: Gwx 2018-01-22 10:04:01.146 MySensors: Serial Worker stopped... 2018-01-22 10:04:02.157 MySensors: Using serial port: /dev/ttyUSB0 2018-01-22 10:05:30.219 Error: Gwx hardware (2) nothing received for more than 1 Minute!.... 2018-01-22 10:05:31.220 Error: Restarting: Gwx 2018-01-22 10:05:32.170 MySensors: Serial Worker stopped... 2018-01-22 10:05:33.181 MySensors: Using serial port: /dev/ttyUSB0 2018-01-22 10:07:00.204 Error: Gwx hardware (2) nothing received for more than 1 Minute!.... etc- screen shots:
-
list itemSetup->Hardware:
![Gateway settings]https://drive.google.com/file/d/1NjJZMlaM98XaZ-UCY93pyeHcKbT7ZZoh/view?usp=sharing -
list itemSetup->Hardware Gwx setup:
![Gwx Setup]https://drive.google.com/file/d/1vDVDcLGaGK_g3-uYQrl_DnlHlbvjq87Z/view?usp=sharing -
list itemSetup->Settings:
![Domoticz Settings]https://drive.google.com/file/d/15bkfnHx6rEcqRnTvLVOydwPK63dy83xe/view?usp=sharing
@mario64
one update information (Gateway)
when I press reset button on Arduino Nano board, I get one additional line on serial monitor:
0;255;3;0;2;2.1.1and on domoticz HW setup screen, I get one children of node with name: S_ARDUINO_REPEATER_NODE. see screenshot:
![ ]https://drive.google.com/file/d/1Pjqy7XKA5V9nZYmP90V8hR-pfDy26hc8/view?usp=sharing -
@mario64
one update information (Gateway)
when I press reset button on Arduino Nano board, I get one additional line on serial monitor:
0;255;3;0;2;2.1.1and on domoticz HW setup screen, I get one children of node with name: S_ARDUINO_REPEATER_NODE. see screenshot:
![ ]https://drive.google.com/file/d/1Pjqy7XKA5V9nZYmP90V8hR-pfDy26hc8/view?usp=sharing@mario64
That is normal, if you use the Log Parser (Search) you will understand the message...
Domoticz does that with nodes "S_ARDUINO_REPEATER_NODE", no need to worry.... -
maybe trying to use an "older" version for BOTH serial gateway and node. remember for the node to use the special sketch that erases/clear eeprom, as it contains the node id given from the gateway.
I
m out of good ideas -
@mario64
That is normal, if you use the Log Parser (Search) you will understand the message...
Domoticz does that with nodes "S_ARDUINO_REPEATER_NODE", no need to worry....@zboblamont
So, gateway works as repeater by default? I also expected that on reset, whole initial sequence should appear, not just 0;255;3;0;2;2.1.1. -
@zboblamont
So, gateway works as repeater by default? I also expected that on reset, whole initial sequence should appear, not just 0;255;3;0;2;2.1.1.@mario64 It does not work as a repeater, it registers via Domoticz as a node with a child ID of 255 (Internal effectively) under Setup/Hardware/Nodes, sometimes listed as a Repeater.
It baffled me originally as I have no repeaters nor a need for them, but that is what Domoticz does. Since you can activate which child sensors are active under Domoticz, you can simply ignore them anyway.
Not sure if you have figured this out yet without reading back to confirm it, but until you send a sensor reading after presentation the device will not show up within Domoticz and remains in the background....