Arduino Relay Node Sensor - Help

I have an Arduino gateway and motion sensor, setup and they have been running for a month without problems. They have been setting within 5 feet of each other. Both are using the latest 1.3b3 (71afb55c) library.

I built an Arduino Relay Node and the MySensors gateway sees it just fine. It is also running the latest 1.3b3 (71afb55c) library. The relay is 4.5 meters from the gateway and has a line of sight with it. The motion sensor was moved around the corner of a wall and is 2.5 meters from the relay node and has a line of sight with it.

I have 4.7uF capacitors on the wireless boards between power and ground. They are the 24L01 board.

I am unable to get the motion sensor to send its signal via the relay node. I have been looking at the relay code, very simple, trying to figure out what I have done wrong. When I look at the vera log I see the following arduino messages.

After restarting the Vera I see this block of message, all looks OK.

[font=courier][size=8pt]09 04/26/14 21:14:33.442 JobHandler_LuaUPnP::Run device 98 Arduino Gateway room 0 type urn:schemas-arduino-cc:device:arduinonode:1 id 1;255 parent 97/0x8f9558 upnp: 0 <0x2ae43000>
09 04/26/14 21:14:33.442 JobHandler_LuaUPnP::Run device 99 Arduino Motion 1:0 room 0 type urn:schemas-micasaverde-com:device:MotionSensor:1 id 1;0 parent 97/0x9001e0 upnp: 0 <0x2ae43000>
09 04/26/14 21:14:33.442 JobHandler_LuaUPnP::Run device 112 Arduino Relay room 0 type urn:schemas-arduino-cc:device:arduinorelay:1 id 3;0 parent 97/0x911a98 upnp: 0 <0x2ae43000>
09 04/26/14 21:14:33.450 JobHandler_LuaUPnP::Run device 97 MySensors Gateway room 0 type urn:schemas-arduino-cc:device:arduino:1 id parent 0/0x8fec18 upnp: 0 <0x2ae43000>
50 04/26/14 21:14:38.912 luup_log:97: Arduino plugin: loading library L_Arduino … <0x2b777680>
50 04/26/14 21:14:38.941 luup_log:97: Arduino plugin: library L_Arduino loaded LEAK this:110592 start:1105920 to 0xf00000 <0x2b777680>
50 04/26/14 21:14:38.942 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduino1,PluginVersion, 1.3, 97 <0x2b777680>
50 04/26/14 21:14:38.942 luup_log:97: Arduino: Using network connection: IP address is 192.168.101.66:5003 <0x2b777680>
50 04/26/14 21:14:39.045 luup_log:97: Arduino: Sending: 0;0;4;4;Get Version LEAK this:16384 start:1122304 to 0xf04000 <0x2b777680>
50 04/26/14 21:14:39.057 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduino1,ArduinoLibVersion, 1.3b3 (7afb55c), 97 <0x2e1ba680>[/size][/font]

However, every time I press the reset button on the arduino board, of the relay node, I see the following three message lines.

[size=8pt][font=courier]50 04/26/14 21:14:54.863 luup_log:97: Arduino: Presentation: 3;255;0;18;1.3b3 (7afb55c) <0x2e1ba680>
02 04/26/14 21:14:54.875 luup_log:97: Arduino: Incoming internal command ‘3;255;4;7;0’ discarded for child: nil <0x2e1ba680>
02 04/26/14 21:14:54.888 luup_log:97: Arduino: Incoming internal command ‘3;255;4;14;Relaying Node’ discarded for child: nil <0x2e1ba680>
02 04/26/14 21:14:54.900 luup_log:97: Arduino: Incoming internal command ‘3;255;4;15;1.1’ discarded for child: nil <0x2e1ba680>[/font][/size]

I believe something is not configured correctly within the Arduino relay node device on the Vera, but I can?t figure out what it is. Could anyone give me any pointers on what I might be doing wrong?

My Vera device configs if it helps

[size=8pt][font=courier]Device #97

name - MySensors Gateway
device_type - urn:schemas-arduino-cc:device:arduino:1
ip - 192.168.101.66:5003
device_file - D_Arduino1.xml
id - 97
room - 0
time_created - 1396490806
local_udn - uuid:4d494342-5342-5645-0061-000002165e68
commUse- rs232
PluginVersion - 1.3
Unit - M
CommFailure - 1
ArduinoLibVersion - 1.3b3 (7afb55c)
LastUpdate - 0
InclusionMode - 0

Device #98

name - Arduino Gateway
device_type - urn:schemas-arduino-cc:device:arduinonode:1
altid - 1;255
id_parent - 97
device_file - D_ArduinoNode1.xml
id - 98
room - 0
time_created - 1396568272
local_udn - uuid:4d494342-5342-5645-0062-000002165e68
LastUpdate - 1398559937
LastUpdateHR - 20:52
ArduinoLibVersion - 1.3b3 (7afb55c)
SketchName - Motion Sensor
SketchVersion - 1.0

Device #99

name - Arduino Motion 1:0
device_type - urn:schemas-micasaverde-com:device:MotionSensor:1
altid - 1;0
id_parent - 97
device_file - D_MotionSensor1.xml
id - 99
room - 0
time_created - 1396568272
category_num - 4
subcategory_num- 3
onDashboard - 1
local_udn - uuid:4d494342-5342-5645-0063-000002165e68
Variables
Tripped- 1
LastTrip - 1398559937
LastUpdate - 1398558862
Armed - 1

Device #112

name - Arduino Relay
device_type - urn:schemas-arduino-cc:device:arduinorelay:1
altid - 3;255
id_parent - 97
device_file - D_ArduinoRelay1.xml
id - 112
room - 0
impl_file
time_created - 1398558171
local_udn - uuid:4d494342-5342-5645-0070-000002165e68
ArduinoLibVersion - 1.3b3 (7afb55c)
SketchName - Relaying Node
SketchVersion 1.0
RelayNode - Refreshing…
LastUpdate - 0[/font][/size]

Thanks
Mike

Hmmm… it does not look like the Relay node has been included correctly. It does not seem to have a RelayNode set (should be 0 == Gateway)

“RelayNode - Refreshing…”

I wonder why the plugin is throwing away the messages from your relay-node… You your perhaps hard reset you vera controller and see what devices is actually there. And re-include the relay-node. Also try peeking in the vera-log while including.

Still no go

  1. Reworked with a Nano in place of a Uno and a new Radio.
  2. Hard restart of Vera.
  3. Same distance setup.
  4. Recompiled all three sensors, with default packages from GitHub.
  5. Enabled debug in config.h

The discard log message have disappeared. However, still no message relaying, via the relay node.

Concerns

  1. Every time the Relay Node presents itself a lu_incoming failed message is logged.
    [size=8pt][font=courier]50 04/27/14 17:33:38.505 luup_log:97: Arduino: Presentation: 2;255;0;18;1.3b3 (7afb55c) <0x2f962680>
    50 04/27/14 17:33:38.505 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,ArduinoLibVersion, 1.3b3 (7afb55c), 112 <0x2f962680>
    01 04/27/14 17:33:38.521 LuaInterface::CallFunction-2 lu_incoming failed [string “module(“L_Arduino”, package.seeall)…”]:252: attempt to call global ‘setVariable’ (a nil value) <0x2f962680>
    50 04/27/14 17:33:38.540 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchName, Relaying Node, 112 <0x2f962680>
    50 04/27/14 17:33:38.557 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchVersion, 1.0, 112 <0x2f962680>[/font][/size]

  2. When watching the serial monitor for the individual sensors (one at a time), I don?t see any weird serial print data that would be a result of an error condition.

  3. On both the Uno and the Nano boards of the Relay Node the L LED light is always orange. Is this correct because it is waiting for a gw.messageAvailable() for a message?

Question.

When wiring the Radio for the Relay Node, I am using the normal sensor radio wiring guide or should I be using the vera network gateway wiring guide?

Thanks

Logs

[size=8pt][font=courier]Reload Vera
09 04/27/14 17:29:48.210 JobHandler_LuaUPnP::Run device 98 Arduino Gateway room 0 type urn:schemas-arduino-cc:device:arduinonode:1 id 1;255 parent 97/0x9e6250 upnp: 0 <0x2b1ec000>
09 04/27/14 17:29:48.211 JobHandler_LuaUPnP::Run device 99 Arduino Motion 1:0 room 0 type urn:schemas-micasaverde-com:device:MotionSensor:1 id 1;0 parent 97/0x9ecf20 upnp: 0 <0x2b1ec000>
09 04/27/14 17:29:48.211 JobHandler_LuaUPnP::Run device 112 Arduino Relay 2 room 0 type urn:schemas-arduino-cc:device:arduinorelay:1 id 2;255 parent 97/0x9fe798 upnp: 0 <0x2b1ec000>

09 04/27/14 17:29:48.219 JobHandler_LuaUPnP::Run device 97 MySensors Gateway room 0 type urn:schemas-arduino-cc:device:arduino:1 id parent 0/0x9eb958 upnp: 0 <0x2b1ec000>

50 04/27/14 17:29:51.278 luup_log:95: (MiosUpdater::Startup) Device #95-MiOS Update Utility <0x2bb1f680>
50 04/27/14 17:29:51.278 luup_log:95: (MiosUpdater::Startup) Too soon since last check. Return <0x2bb1f680>
50 04/27/14 17:29:51.283 luup_log:97: Arduino plugin: loading library L_Arduino … <0x2bb1f680>
50 04/27/14 17:29:51.311 luup_log:97: Arduino plugin: library L_Arduino loaded <0x2bb1f680>
50 04/27/14 17:29:51.312 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduino1,PluginVersion, 1.3, 97 <0x2bb1f680>
50 04/27/14 17:29:51.312 luup_log:97: Arduino: Using network connection: IP address is 192.168.101.66:5003 <0x2bb1f680>

50 04/27/14 17:29:51.415 luup_log:97: Arduino: Sending: 0;0;4;4;Get Version <0x2bb1f680>

50 04/27/14 17:29:51.426 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduino1,ArduinoLibVersion, 1.3b3 (7afb55c), 97 <0x2f962680>

50 04/27/14 17:30:15.928 luup_log:97: Arduino: Presentation: 2;255;0;18;1.3b3 (7afb55c) <0x2f962680>
50 04/27/14 17:30:15.929 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,ArduinoLibVersion, 1.3b3 (7afb55c), 112 <0x2f962680>
01 04/27/14 17:30:15.945 LuaInterface::CallFunction-2 lu_incoming failed [string “module(“L_Arduino”, package.seeall)…”]:252: attempt to call global ‘setVariable’ (a nil value) <0x2f962680>
50 04/27/14 17:30:15.964 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchName, Relaying Node, 112 <0x2f962680>
50 04/27/14 17:30:15.981 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchVersion, 1.0, 112 <0x2f962680>

Relay Node Reset Button Pressed
50 04/27/14 17:31:01.902 luup_log:97: Arduino: Presentation: 2;255;0;18;1.3b3 (7afb55c) <0x2f962680>
50 04/27/14 17:31:01.902 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,ArduinoLibVersion, 1.3b3 (7afb55c), 112 <0x2f962680>
01 04/27/14 17:31:01.918 LuaInterface::CallFunction-2 lu_incoming failed [string “module(“L_Arduino”, package.seeall)…”]:252: attempt to call global ‘setVariable’ (a nil value) <0x2f962680>
50 04/27/14 17:31:01.937 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchName, Relaying Node, 112 <0x2f962680>
50 04/27/14 17:31:01.954 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchVersion, 1.0, 112 <0x2f962680>

Relay Node Reset Button Pressed
50 04/27/14 17:31:09.953 luup_log:97: Arduino: Presentation: 1;255;0;17;1.3b3 (7afb55c) <0x2f962680>
50 04/27/14 17:31:09.953 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,ArduinoLibVersion, 1.3b3 (7afb55c), 98 <0x2f962680>
01 04/27/14 17:31:09.969 LuaInterface::CallFunction-2 lu_incoming failed [string “module(“L_Arduino”, package.seeall)…”]:252: attempt to call global ‘setVariable’ (a nil value) <0x2f962680>

Moved Motion Sensor within Gateway Range and reset button was pressed
50 04/27/14 17:31:09.988 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchName, Motion Sensor, 98 <0x2f962680>
50 04/27/14 17:31:10.005 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchVersion, 1.0, 98 <0x2f962680>
50 04/27/14 17:31:10.029 luup_log:97: Arduino: Presentation: 1;0;0;1;1.3b3 (7afb55c) <0x2f962680>
50 04/27/14 17:31:10.048 luup_log:97: Arduino: Set Var: 1;0;1;16;1 <0x2f962680>
50 04/27/14 17:31:10.048 luup_log:97: Arduino: Setting variable ‘Tripped’ to value ‘1’ <0x2f962680>
50 04/27/14 17:31:10.048 luup_log:97: Arduino: urn:micasaverde-com:serviceId:SecuritySensor1,Tripped, 1, 99 <0x2f962680>
50 04/27/14 17:31:10.049 luup_log:97: Arduino: urn:micasaverde-com:serviceId:SecuritySensor1,LastTrip, 1398634270, 99 <0x2f962680>
06 04/27/14 17:31:10.049 Device_Variable::m_szValue_set device: 99 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: LastTrip was: 1398633163 now: 1398634270 #hooks: 0 upnp: 0 v:0xa2ac30/NONE duplicate:0 <0x2f962680>
50 04/27/14 17:31:10.070 luup_log:97: Arduino: urn:micasaverde-com:serviceId:HaDevice1,LastUpdate, 1398634270, 98 <0x2f962680>
06 04/27/14 17:31:10.071 Device_Variable::m_szValue_set device: 98 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1398633163 now: 1398634270 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2f962680>
50 04/27/14 17:31:10.072 luup_log:97: Arduino: urn:micasaverde-com:serviceId:HaDevice1,LastUpdateHR, 17:31, 98 <0x2f962680>
06 04/27/14 17:31:10.072 Device_Variable::m_szValue_set device: 98 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdateHR was: 17:12 now: 17:31 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2f962680>

Relay Node Reset Button Pressed
50 04/27/14 17:31:42.216 luup_log:97: Arduino: Presentation: 2;255;0;18;1.3b3 (7afb55c) <0x2f962680>
50 04/27/14 17:31:42.216 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,ArduinoLibVersion, 1.3b3 (7afb55c), 112 <0x2f962680>
01 04/27/14 17:31:42.232 LuaInterface::CallFunction-2 lu_incoming failed [string “module(“L_Arduino”, package.seeall)…”]:252: attempt to call global ‘setVariable’ (a nil value) <0x2f962680>
04 04/27/14 17:31:42.241 <0x2b91f680>
50 04/27/14 17:31:42.252 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchName, Relaying Node, 112 <0x2f962680>

Relay Node Reset Button Pressed
50 04/27/14 17:33:38.505 luup_log:97: Arduino: Presentation: 2;255;0;18;1.3b3 (7afb55c) <0x2f962680>
50 04/27/14 17:33:38.505 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,ArduinoLibVersion, 1.3b3 (7afb55c), 112 <0x2f962680>
01 04/27/14 17:33:38.521 LuaInterface::CallFunction-2 lu_incoming failed [string “module(“L_Arduino”, package.seeall)…”]:252: attempt to call global ‘setVariable’ (a nil value) <0x2f962680>
50 04/27/14 17:33:38.540 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchName, Relaying Node, 112 <0x2f962680>
50 04/27/14 17:33:38.557 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchVersion, 1.0, 112 <0x2f962680>

Moved Motion Sensor within Gateway Range and reset button was pressed
50 04/27/14 17:34:23.405 luup_log:97: Arduino: Set Var: 1;0;1;16;1 <0x2f962680>
50 04/27/14 17:34:23.405 luup_log:97: Arduino: Setting variable ‘Tripped’ to value ‘1’ <0x2f962680>
50 04/27/14 17:34:23.406 luup_log:97: Arduino: urn:micasaverde-com:serviceId:SecuritySensor1,Tripped, 1, 99 <0x2f962680>
50 04/27/14 17:34:23.406 luup_log:97: Arduino: urn:micasaverde-com:serviceId:SecuritySensor1,LastTrip, 1398634463, 99 <0x2f962680>
06 04/27/14 17:34:23.406 Device_Variable::m_szValue_set device: 99 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: LastTrip was: 1398634270 now: 1398634463 #hooks: 0 upnp: 0 v:0xa2ac30/NONE duplicate:0 <0x2f962680>
50 04/27/14 17:34:23.407 luup_log:97: Arduino: urn:micasaverde-com:serviceId:HaDevice1,LastUpdate, 1398634463, 98 <0x2f962680>
06 04/27/14 17:34:23.408 Device_Variable::m_szValue_set device: 98 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1398634270 now: 1398634463 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2f962680>
50 04/27/14 17:34:23.408 luup_log:97: Arduino: urn:micasaverde-com:serviceId:HaDevice1,LastUpdateHR, 17:34, 98 <0x2f962680>
06 04/27/14 17:34:23.409 Device_Variable::m_szValue_set device: 98 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdateHR was: 17:31 now: 17:34 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2f962680>

50 04/27/14 17:34:28.064 luup_log:97: Arduino: Presentation: 1;255;0;17;1.3b3 (7afb55c) <0x2f962680>
50 04/27/14 17:34:28.064 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,ArduinoLibVersion, 1.3b3 (7afb55c), 98 <0x2f962680>

50 04/27/14 17:34:28.132 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchName, Motion Sensor, 98 <0x2f962680>
50 04/27/14 17:34:28.148 luup_log:97: Arduino: urn:upnp-arduino-cc:serviceId:arduinonode1,SketchVersion, 1.0, 98 <0x2f962680>
50 04/27/14 17:34:28.171 luup_log:97: Arduino: Presentation: 1;0;0;1;1.3b3 (7afb55c) <0x2f962680>

[/font][/size]

@lininger

can you post your sketch?

// Example sketch showing how to create a node thay relays messages
// from nodes far from gateway back to gateway.
// Important here is that node uses Relay-class and calls
// gw.messageAvailable() frequently. This sketch should not
// sleep.

#include <Relay.h>
#include <SPI.h>
#include <EEPROM.h>
#include <RF24.h>

Relay gw;

void setup()
{
gw.begin();

//Send the sensor node sketch version information to the gateway
gw.sendSketchInfo(“Relaying Node”, “1.0”);
}

void loop()
{
// By calling this regularely you route messages in the background
if (gw.messageAvailable()) {
// Handleincoming message for this node here…
}

}

I think you need to define what to do if you see the message. You have an IF test without a consequence.

void loop() 
{
  // By calling this regularely you route messages in the background
  if (gw.messageAvailable()) {  
    // Handleincoming message for this node here... 
  }

}

you need to replace the comment // Handleincoming message for this node here... with instructions.

it seems to me that the sketch posted on github is not complete for your application.

[quote=“Bulldoglowell, post:6, topic:180897”]you need to replace the comment // Handleincoming message for this node here... with instructions.

it seems to me that the sketch posted on github is not complete for your application.[/quote]

It is complete for a node that just should relay messages from other nodes.

I’m scratching my head trying to understand that one. Would you mind to explain how this sketch works to telegraph a message from node to node?

Programmatically, is it in RF24.h or one of the other library files?

@lininger

Yes, you should do the normal wiring of radio for Relaying nodes.

[code]01 04/27/14 17:30:15.945 LuaInterface::CallFunction-2 lu_incoming failed [string "module("L_Arduino", package.seeall)..."]:252: attempt to call global 'setVariable' (a nil value) <0x2f962680>[/code]

Which means this line fails

setVariable(incomingData, iChildId, incomingNodeId) -- This will set relay node variable and update LAST_UPDATE for node device

So it looks like incomingNodeId somehow is nil. Will have to check with Bruce… but I doubt this explains why you arean’t receiving data through you relay node.

@Bulldoglowell
Yes, the logic is in Relay.cpp. You can read more in the sourcecode.

Behind the scene gw.messageAvailable() checks if there is any new messages in the radio queue. If message was addressed for some other node it forwards it using an internal routing table. And finally If the message was addressed for the relay-node itself the function returns true.

got it, thanks!

I just built a quick temperature sensor, using the same 24L01 board I was trying to get the Relay Node to work with. It works perfectly. I just can?t get the relayingNode.ino to work. Has anyone else successfully built and is using a relaying node, successfully? I added a ton of debug prints and best I can tell no messages are arrive at the messageAvailable()in the Relay.ccp module.

Pipe IS AWAYS 224 which is odd because it looks for pipe<7
boolean available = RF24::available(&pipe); IS ALWAYS 0

After adding the temperature sensor I noticed both the temperature and motion sensor have two panels in the Vera devices window, while the non-functional Relaying Node only has one. Should it also have a second panel as well? Might it be something is amiss within the D_ArduinoRelay1.json or D_ArduinoRelay1.xml Luup files? See attached image.

[quote=“hek, post:9, topic:180897”]@lininger

Yes, you should do the normal wiring of radio for Relaying nodes.

[code]01 04/27/14 17:30:15.945 LuaInterface::CallFunction-2 lu_incoming failed [string "module("L_Arduino", package.seeall)..."]:252: attempt to call global 'setVariable' (a nil value) <0x2f962680>[/code]

Which means this line fails

setVariable(incomingData, iChildId, incomingNodeId) -- This will set relay node variable and update LAST_UPDATE for node device

So it looks like incomingNodeId somehow is nil. Will have to check with Bruce… but I doubt this explains why you arean’t receiving data through you relay node.[/quote]

The root cause for the exception is that we didn’t define the local function setVariable() before we attempted to call it so Lua complains that we tried to call a nil global function. I just submitted a fix in a pull request that Henrik will commit once he peer reviews the code.

@llinger, if you are game, please regress your Relay Node tests to see if this resolves the issue you reported.

Sure, will wait for the next GitHub update.

Thanks

Blacey,

Thanks for the fast solution and update to the code.

I grabbed the latest from GitHub (541cd43) and recompiled all the sensors. Also replaced the L_Arduino.lua file (actually I replaced all of them just to be safe).

The sensor presentation in the Vera now shows Parent Node: GW: and all the Last Update: are filled in.

Questions (just for my understanding as I delve into this)

  1. What does the Parent node: GW represent? (I know it is gateway), but does it mean the device communicated directly with the Gateway Sensor, bypassing the relaying node? Or is it representing something totally different? Will it show anything other than GW or Nothing?
  2. When the Last Update: on the relaying node panel changes time does that mean info was relayed to the gateway?
  3. Is there a way to tell if the relaying node is doing its job visually without hooking up a PC to it and serial monitoring with prints?

Again thanks for taking the time to look into this.

ML

  1. Yes, it looks like your sensor is bypassing the relay node. When sensor detects that it is unable to communicate through its “Parent Node” (20 missed messages) it will try to find a new parent. When searching for nodes your relay-node might answer and the sensor uses this as parent.

  2. No, Last update on relay node will update when relay is restarted or any physically attached sensors reports a value. Relayed messages does not count.

  3. Hooking up a pc is the easiest option to see what is happening in the relaying node. Turn on debug prints in Config.h.

Hek - I’m not sure if your previous post is fully documented anywhere but it would be good to have it generously explained.

The following may relate, in some tests I was doing. Set up: just a gateway and one slave device that just measures it’s battery percentage and local temperature - software ver 1.3b3 (7afb55c). The debug messages have been expanded a little and may not be familiar. The debug is from the slave device. This is how I got this to occur:

  1. With everything running OK. Turn off gateway and wait an hour or so. In my case, this is long enough for the slave to start the search for a relay node (which does not exist in the physical setup). Start of log below shows the continual search.

  2. Turn gateway back on. The slave finds the gateway and reestablishes (part) communication.

The problem: the slave can send its battery percentage (the 65 to 75 figures) back to the gateway (and Vera) but the temperature message is ignored by the gateway resulting in a comms fail for all the sent temperatures - refer log. It appears the parent is in communication but the message(s) for the parent’s children are ignored.

I could reset the slave any number of times and got the same outcome. To get things going again I had to restart Vera.

Just by the way the continual search for a relay node, will result in a battery device having a flat battery. So turning off the gateway flattens all the slave batteries! May need perhaps a “I’m a battery powered device” flag that can alter how the relay search is handled?

[code]
// ---------- Gateway is powered off

No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.
Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
No relay nodes was found. Trying again in 10 seconds.

// ---------- Gateway powered back on

Tx: fr=1,to=255,la=1,ne=255,ci=255,mt=4,ty=9,cr=6:
Sent successfully
Message available on pipe 1
Sent ack msg to 0
Sent ack msg

// ---------- Note the CRC error

Rx: fr=0,to=255,la=0,ci=255,mt=4,t=9,cr=0(ec):
Not this node
Message available on pipe 1
Rx: fr=0,to=1,la=0,ci=255,mt=4,t=10,cr=186(ok): 0
Message addressed for this node.
Using relay 0. Distance is 0
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=126: 18.5
Ack: receive timeout
Ack: receive timeout: 11282327
Send failed.
Battery Voltage: 2.31 V
Battery percent: 68 %
CPU Voltage: 3319 mV
CPU percent: 101 %
Temperature: 20.50 C

// ---------- Battery Voltage sent OK to gateway an Vera parent node

Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=7: 68
4
Ack: received OK
Sent successfully

// ---------- Temperature is considered an error by gateway - Vera child node is not updated.

Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=117: 20.5
Ack: receive timeout
Ack: receive timeout: 11283310
Send failed.
Battery Voltage: 2.40 V
Battery percent: 71 %
CPU Voltage: 3329 mV
CPU percent: 102 %
Temperature: 20.50 C
Battery Voltage: 2.49 V
Battery percent: 74 %
CPU Voltage: 3319 mV
CPU percent: 101 %
Temperature: 20.60 C

// ---------- From now on the battery msg is sent OK but not the temperature msg

Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=147: 74
5
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=218: 20.6
Ack: receive timeout
Ack: receive timeout: 11285149
Send failed.
Battery Voltage: 2.42 V
Battery percent: 72 %
CPU Voltage: 3319 mV
CPU percent: 101 %
Temperature: 20.50 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=102: 72
4
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=117: 20.5
Ack: receive timeout
Ack: receive timeout: 11286134
Send failed.
Battery Voltage: 2.43 V
Battery percent: 72 %
CPU Voltage: 3309 mV
CPU percent: 100 %
Temperature: 20.50 C
Battery Voltage: 2.51 V
Battery percent: 74 %
CPU Voltage: 3329 mV
CPU percent: 102 %
Temperature: 20.50 C
Battery Voltage: 2.52 V
Battery percent: 74 %
CPU Voltage: 3309 mV
CPU percent: 100 %
Temperature: 20.50 C
Battery Voltage: 2.52 V
Battery percent: 75 %
CPU Voltage: 3319 mV
CPU percent: 101 %
Temperature: 20.60 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=193: 75
5
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=218: 20.6
Ack: receive timeout
Ack: receive timeout: 11289675
Send failed.
Battery Voltage: 2.45 V
Battery percent: 72 %
CPU Voltage: 3319 mV
CPU percent: 101 %
Temperature: 20.50 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=102: 72
4
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=117: 20.5
Ack: receive timeout
Ack: receive timeout: 11290660
Send failed.
Battery Voltage: 2.46 V
Battery percent: 73 %
CPU Voltage: 3319 mV
CPU percent: 101 %
Temperature: 20.50 C
Battery Voltage: 2.53 V
Battery percent: 75 %
CPU Voltage: 3319 mV
CPU percent: 101 %
Temperature: 20.40 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=193: 75
4
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=231: 20.4
Ack: receive timeout
Ack: receive timeout: 11292499
Send failed.
Battery Voltage: 2.46 V
Battery percent: 73 %
CPU Voltage: 3329 mV
CPU percent: 102 %
Temperature: 20.40 C
Battery Voltage: 2.54 V
Battery percent: 75 %
CPU Voltage: 3329 mV
CPU percent: 102 %
Temperature: 20.30 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=193: 75
4
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=50: 20.3
Ack: receive timeout
Ack: receive timeout: 11294337
Send failed.
Battery Voltage: 2.47 V
Battery percent: 73 %
CPU Voltage: 3309 mV
CPU percent: 100 %
Temperature: 20.30 C
Battery Voltage: 2.54 V
Battery percent: 75 %
CPU Voltage: 3309 mV
CPU percent: 100 %
Temperature: 20.20 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=193: 75
4
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=160: 20.2
Ack: receive timeout
Ack: receive timeout: 11296172
Send failed.
Battery Voltage: 2.47 V
Battery percent: 73 %
CPU Voltage: 3329 mV
CPU percent: 102 %
Temperature: 20.10 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=52: 73
4
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=15: 20.1
Ack: receive timeout
Ack: receive timeout: 11297157
Send failed.
Battery Voltage: 2.48 V
Battery percent: 73 %
CPU Voltage: 3309 mV
CPU percent: 100 %
Temperature: 20.00 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=52: 73
4
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=157: 20.0
Ack: receive timeout
Ack: receive timeout: 11298140
Send failed.
Battery Voltage: 2.47 V
Battery percent: 73 %
CPU Voltage: 3319 mV
CPU percent: 101 %
Temperature: 20.00 C
Battery Voltage: 2.55 V
Battery percent: 75 %
CPU Voltage: 3309 mV
CPU percent: 100 %
Temperature: 20.10 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=193: 75
4
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=15: 20.1
Ack: receive timeout
Ack: receive timeout: 11299973
Send failed.
Battery Voltage: 2.48 V
Battery percent: 73 %
CPU Voltage: 3309 mV
CPU percent: 100 %
Temperature: 19.80 C
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=255,mt=4,ty=0,cr=52: 73
4
Ack: received OK
Sent successfully
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=0,cr=48: 19.8
Ack: receive timeout
Ack: receive timeout: 11300958
Send failed.[/code]

Thanks a-lurker.

Found the cause for the crc error (I think) as the readMessage should ignore sending ack on I_PING instead of I_PING_ACK.

But this does not explain the failed second transmission you are seeing. Does it help waiting some uSec before sending temp? Have you tested the same with the updated RF24 package?

What is seen on the receiving side? Does the message reach this side at all?

I will do some tests using a new RF24 fork and setup a relay node myself the coming days to verify everything again.

I recompiled last night after your to two RF24 tweaks (18848a2) . Right now all the sensors are next to each other. Will try the test again tonight and see if I can get one of the sensors to rely.

If a sensor does relay should the GW disappear form the senor being passed on?

Thanks

yes, GW will disappear and relay-radio-id will show instead.