Greetings!
I am putting a gateway and sensor together for the first time (about a week in). Long time user of Vera Plus and I have written my own code for it. Vera Plus is my controller. So far the MySensors experience has gone well with only a few things I had to figure out. But I do have an issue I haven't been able to solve.
In short, for a sensor node, which is an Arduino Nano w/ NRF24 radio (NRF24L01+), when it communicates to a gateway that is an Arduino Uno w/ a W5100 Ethernet shield and NRF24 radio, I see some NACK errors, especially at startup. The errors are enough to disrupt the proper operation of the node.
But, I also have a gateway which is a RPi (a B+ 1.2 I think) also with a NRF24 radio. The RPi runs the latest (as of this writing) 2017-11-29-raspbian-stretch. With the RPi acting as the gateway to the controller, the sensor node works perfectly with no NACK errors.
Both controllers and the sensor node are running the latest MySensors development version 2.2.0 rc2. The node itself simply provides a basic simulated door sensor. Basically it's a non-blocking loop that opens and closes the door every 10 seconds. The door sensor ID is 123 in the logs.
This is the log from the sensor node running with the Uno/Ethernet gateway. The NACK errors are evident.
__ __ ____
| \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___
| |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
| | | | |_| |___| | __/ | | \__ \ _ | | \__ \
|_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/
|___/ 2.2.0-rc.2
17 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.2.0-rc.2
26 MCO:BGN:BFR
27 TSM:INIT
29 TSF:WUR:MS=0
35 TSM:INIT:TSP OK
37 TSF:SID:OK,ID=1
39 TSM:FPAR
75 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
1081 TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
1086 TSF:MSG:FPAR OK,ID=0,D=1
2082 TSM:FPAR:OK
2083 TSM:ID
2084 TSM:ID:OK
2086 TSM:UPL
2092 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
2101 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
2106 TSF:MSG:PONG RECV,HP=1
2108 TSM:UPL:OK
2110 TSM:READY:ID=1,PAR=0,DIS=1
2125 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
2132 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
2142 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.2.0-rc.2
2182 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
2226 TSF:MSG:READ,0-0-1,s=255,c=3,t=6,pt=0,l=1,sg=0:M
2275 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=11,pt=0,l=17,sg=0,ft=0,st=NACK:ArduinoDoorSensor
2323 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=12,pt=0,l=11,sg=0,ft=1,st=NACK:Version 1.x
2332 TSF:MSG:SEND,1-1-0-0,s=123,c=0,t=0,pt=0,l=0,sg=0,ft=2,st=OK:
2338 MCO:REG:REQ
2376 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=NACK:2
4397 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=OK:2
4403 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
4408 MCO:PIM:NODE REG=1
4410 MCO:BGN:STP
4412 MCO:BGN:INIT OK,TSP=1
14418 TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
24463 !TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=NACK:0
34471 TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=1,st=OK:1
The log above continues with the events happening every 10 seconds. Roughly every 5 to 20 messages will result in a NACK, each an apparent a lost message or event.
This is the sensor node log running with the RPi/Ethernet gateway. There are no errors.
__ __ ____
| \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___
| |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
| | | | |_| |___| | __/ | | \__ \ _ | | \__ \
|_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/
|___/ 2.2.0-rc.2
17 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.2.0-rc.2
26 MCO:BGN:BFR
27 TSM:INIT
29 TSF:WUR:MS=0
35 TSM:INIT:TSP OK
37 TSF:SID:OK,ID=1
39 TSM:FPAR
75 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
1064 TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
1070 TSF:MSG:FPAR OK,ID=0,D=1
2082 TSM:FPAR:OK
2083 TSM:ID
2084 TSM:ID:OK
2086 TSM:UPL
2089 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
2104 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
2109 TSF:MSG:PONG RECV,HP=1
2111 TSM:UPL:OK
2113 TSM:READY:ID=1,PAR=0,DIS=1
2117 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
2127 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
2135 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.2.0-rc.2
2144 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
2162 TSF:MSG:READ,0-0-1,s=255,c=3,t=6,pt=0,l=1,sg=0:I
2172 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=11,pt=0,l=17,sg=0,ft=0,st=OK:ArduinoDoorSensor
2183 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=12,pt=0,l=11,sg=0,ft=0,st=OK:Version 1.x
2192 TSF:MSG:SEND,1-1-0-0,s=123,c=0,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
2198 MCO:REG:REQ
2201 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
2209 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
2214 MCO:PIM:NODE REG=1
2216 MCO:BGN:STP
2219 MCO:BGN:INIT OK,TSP=1
12223 TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
22231 TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
32239 TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
42247 TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
52255 TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
62263 TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:0
72271 TSF:MSG:SEND,1-1-0-0,s=123,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
This will run for hours without a single NACK.
Of course I do a complete reset of everything between tests, including repointing the controller to the gateway. Has been 100% repeatable so far. The code I'm using is almost entirely vanilla from the examples. Just enough code to simulate detecting and reporting opening and closing a door.
Some may want to see the gateway logs also. This is the log from the Arduino/Ethernet gateway.
0 MCO:BGN:INIT GW,CP=RNNGA---,VER=2.2.0-rc.2
3 MCO:BGN:BFR
5 TSM:INIT
6 TSF:WUR:MS=0
12 TSM:INIT:TSP OK
14 TSM:INIT:GW MODE
16 TSM:READY:ID=0,PAR=0,DIS=0
19 MCO:REG:NOT NEEDED
321 GWT:TIN:IP=192.168.1.34
1324 MCO:BGN:STP
1326 MCO:BGN:INIT OK,TSP=1
5899 TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:1
15734 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
15739 TSF:MSG:BC
15740 TSF:MSG:FPAR REQ,ID=1
15744 TSF:PNG:SEND,TO=0
15746 TSF:CKU:OK
15747 TSF:MSG:GWL OK
16149 TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
17761 TSF:MSG:READ,1-1-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
17766 TSF:MSG:PINGED,ID=1,HP=1
17771 TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
17804 TSF:MSG:READ,1-1-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
17845 !TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0100
17852 TSF:MSG:READ,1-1-0,s=255,c=0,t=17,pt=0,l=10,sg=0:2.2.0-rc.2
17859 TSF:MSG:READ,1-1-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
19880 TSF:MSG:READ,1-1-0,s=255,c=3,t=11,pt=0,l=17,sg=0:ArduinoDoorSensor
19938 TSF:MSG:READ,1-1-0,s=123,c=0,t=0,pt=0,l=0,sg=0:
19953 TSF:MSG:READ,1-1-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
19962 TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
39989 TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:0
49986 TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:1
59982 TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:0
69984 TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:1
80000 TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:0
And from the RPi/Ethernet gateway.
Jan 14 17:46:39 raspberrypi systemd[1]: Started MySensors Gateway daemon.
Jan 14 17:46:40 raspberrypi mysgw: Starting gateway...
Jan 14 17:46:40 raspberrypi mysgw: Protocol version - 2.2.0-rc.2
Jan 14 17:46:40 raspberrypi mysgw: MCO:BGN:INIT GW,CP=RNNGL-Q-,VER=2.2.0-rc.2
Jan 14 17:46:40 raspberrypi mysgw: TSF:LRT:OK
Jan 14 17:46:40 raspberrypi mysgw: TSM:INIT
Jan 14 17:46:40 raspberrypi mysgw: TSF:WUR:MS=0
Jan 14 17:46:40 raspberrypi mysgw: TSM:INIT:TSP OK
Jan 14 17:46:40 raspberrypi mysgw: TSM:INIT:GW MODE
Jan 14 17:46:40 raspberrypi mysgw: TSM:READY:ID=0,PAR=0,DIS=0
Jan 14 17:46:40 raspberrypi mysgw: MCO:REG:NOT NEEDED
Jan 14 17:46:40 raspberrypi mysgw: Listening for connections on 0.0.0.0:5003
Jan 14 17:46:40 raspberrypi mysgw: MCO:BGN:STP
Jan 14 17:46:40 raspberrypi mysgw: MCO:BGN:INIT OK,TSP=1
Jan 14 17:46:44 raspberrypi mysgw: New connection from 192.168.1.31
Jan 14 17:46:44 raspberrypi mysgw: GWT:TSA:C=0,CONNECTED
Jan 14 17:46:49 raspberrypi mysgw: TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
Jan 14 17:46:49 raspberrypi mysgw: TSF:MSG:BC
Jan 14 17:46:49 raspberrypi mysgw: TSF:MSG:FPAR REQ,ID=1
Jan 14 17:46:49 raspberrypi mysgw: TSF:CKU:OK,FCTRL
Jan 14 17:46:49 raspberrypi mysgw: TSF:MSG:GWL OK
Jan 14 17:46:49 raspberrypi mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:PINGED,ID=1,HP=1
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=255,c=0,t=17,pt=0,l=10,sg=0:2.2.0-rc.2
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
Jan 14 17:46:51 raspberrypi mysgw: GWT:RFC:C=0,MSG=1;255;3;0;6;I
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=6,pt=0,l=1,sg=0,ft=0,st=OK:I
Jan 14 17:46:51 raspberrypi mysgw: GWT:RFC:C=0,MSG=
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=11,pt=0,l=17,sg=0:ArduinoDoorSensor
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=12,pt=0,l=11,sg=0:Version 1.x
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=123,c=0,t=0,pt=0,l=0,sg=0:
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
Jan 14 17:46:51 raspberrypi mysgw: TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
Jan 14 17:47:01 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:1
Jan 14 17:47:11 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:0
Jan 14 17:47:21 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:1
Jan 14 17:47:31 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:0
Jan 14 17:47:41 raspberrypi mysgw: TSF:MSG:READ,1-1-0,s=123,c=1,t=16,pt=2,l=2,sg=0:1
I have tried multiple combinations. I have many spare radios. Swapped out the Arduino and Ethernet. Also tried a W5500 Ethernet module w/ the Ethernet2 library. (that didn't work but it was before I switched to the 2.2 software--maybe I should try that again). The RPi combo worked right away (almost) but I was already on the 2.2 software.
The only connection difference between the radios on the gateways is the RPi uses the IRQ connection while the Arduino Uno does not.
I haven't spelunked the code enough to know what all these messages mean, but I can follow the basics. Really just the high-level messages.
My Arduino IDE is at 1.8.1. My understanding is the latest version 1.8.5 requires Win8 or Win10. I'm on Win7. So I'm standing pat for now. As far as 1.8.1 goes I am up to date on libraries and boards.
I'm open to any comments, thoughts, suggestions, help.
First post. And by the way, Hi! Cool stuff here. Congrats to all.
--d