Author Topic: Arduino Relay Node Sensor - Help  (Read 10361 times)

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 872
  • Karma: +66/-8
Re: Arduino Relay Node Sensor - Help
« Reply #15 on: April 30, 2014, 03:28:37 am »
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: [Select]
// ---------- 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.

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Relay Node Sensor - Help
« Reply #16 on: April 30, 2014, 04:16:00 am »
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?

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Relay Node Sensor - Help
« Reply #17 on: May 02, 2014, 08:02:58 am »
I will do some tests using a new RF24 fork and setup a relay node myself the coming days to verify everything again.

Offline lininger

  • Newbie
  • *
  • Posts: 18
  • Karma: +1/-0
Re: Arduino Relay Node Sensor - Help
« Reply #18 on: May 02, 2014, 11:48:30 am »
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

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Relay Node Sensor - Help
« Reply #19 on: May 02, 2014, 12:24:13 pm »
yes, GW will disappear and relay-radio-id will show instead.

Offline lininger

  • Newbie
  • *
  • Posts: 18
  • Karma: +1/-0
Re: Arduino Relay Node Sensor - Help
« Reply #20 on: May 02, 2014, 08:39:15 pm »
Observations


Have patience with the remote sensor, adjusting to the relying node.  I read a message, I believe from Hek, about the magic 20 attempts before the HELP-ME route my message.  In my case I turned down the pots on my motions sensor and tripped it 20 times, by watching the TX light on trip (1) and trip expire (0) messages.  Around the 20th event I saw it send the HELP message TX light went on for an extended period of time. Then all started working, just like magic.

Great job guys with the new RF24 library, works great in my estimation.

I am currently running the 1.3b3 (18848a2) build with the new RF24 library.

One note the Parent node: GW never changes.  Does not bother me know I know it is working.

--------------------------------------------------
Example debug messages from a running relying node
--------------------------------------------------

---------------------------
--         Start Up      --
---------------------------
Relay=0, distance=1
Radio id stored in EEPROM was: 2
Relaying message back to gateway.
Tx: fr=2,to=0,la=2,ne=0,ci=255,mt=0,ty=18,cr=113: 1.3b3 (18848a2)
Ack: received OK
Relaying message back to gateway.
Tx: fr=2,to=0,la=2,ne=0,ci=255,mt=4,ty=7,cr=14: 0
Ack: received OK
Relaying message back to gateway.
Tx: fr=2,to=0,la=2,ne=0,ci=255,mt=4,ty=14,cr=46: Relaying Node
Ack: received OK
Relaying message back to gateway.
Tx: fr=2,to=0,la=2,ne=0,ci=255,mt=4,ty=15,cr=133: 1.0
Ack: received OK

----------------------------
--   VERA FETCH Button    --
----------------------------
Message available on pipe 1
Sent ack msg to 0
Rx: fr=0,to=2,la=0,ci=255,mt=4,t=12,cr=104(ok): F
Route command receivedSend child info to sensor gateway.
rt:0, 255
rt:1, 255
rt:2, 255
rt:3, 3
rt:4, 4
rt:5, 255
rt:6, 255
rt:7, 255
rt:8, 255
rt:9, 255

----------------------------
--    VERA CLEAR Button   --
----------------------------
Message available on pipe 1
Sent ack msg to 0
Rx: fr=0,to=2,la=0,ci=255,mt=4,t=12,cr=138(ok): C
Route command receivedClear child routing data
Relaying message back to gateway.
Tx: fr=2,to=0,la=2,ne=0,ci=255,mt=4,ty=12,cr=40:
Ack: received OK

----------------------------
--   VERA FETCH Button    --
----------------------------
Message available on pipe 1
Sent ack msg to 0
Rx: fr=0,to=2,la=0,ci=255,mt=4,t=12,cr=104(ok): F
Route command receivedSend child info to sensor gateway.
rt:0, 255
rt:1, 255
rt:2, 255
rt:3, 3
rt:4, 255
rt:5, 255
rt:6, 255
rt:7, 255
rt:8, 255
rt:9, 255

---------------------------------------------------------------------------
--                      Sensor sending temperature                       --
---------------------------------------------------------------------------
Note:  This sensor has an external antenna and was reaching Gateway without
       assistence.  Looks like is now using the relying node shortest path.
---------------------------------------------------------------------------
Message available on pipe 1
Sent ack msg to 3
Rx: fr=3,to=0,la=3,ci=0,mt=1,t=0,cr=144(ok): 71.6
Routing message to relay.
Tx: fr=3,to=0,la=2,ne=0,ci=0,mt=1,ty=0,cr=233: 71.6
Ack: received OK

-------------------------------
--Motion Sensor sending trips--
-------------------------------
Message available on pipe 1
Sent ack msg to 4
Rx: fr=4,to=0,la=4,ci=0,mt=1,t=16,cr=51(ok): 1
Routing message to relay.
Tx: fr=4,to=0,la=2,ne=0,ci=0,mt=1,ty=16,cr=60: 1
Ack: received OK
Message available on pipe 1
Sent ack msg to 4
Rx: fr=4,to=0,la=4,ci=0,mt=1,t=16,cr=84(ok): 0
Routing message to relay.
Tx: fr=4,to=0,la=2,ne=0,ci=0,mt=1,ty=16,cr=91: 0
Ack: received OK


Offline BulldogLowell

  • Hero Member
  • *****
  • Posts: 1576
  • Karma: +191/-85
Re: Arduino Relay Node Sensor - Help
« Reply #21 on: May 02, 2014, 09:30:07 pm »
can someone assist me in updating the Lib Version.  I updated the plugin but the update package on GitHub didn't include the library?


Offline lininger

  • Newbie
  • *
  • Posts: 18
  • Karma: +1/-0
Re: Arduino Relay Node Sensor - Help
« Reply #22 on: May 02, 2014, 11:52:21 pm »
Here is what I did for updated version 1.3b3 (18848a2)

zip up your original adruino project folder (so you have a backup)

https://github.com/mysensors/Arduino
Click download zip button
unzip Arduino-master.zip
Copy and replace everything in your \arduino\ folder

https://github.com/mysensors/RF24
Click download zip button
unzip RF24-master.zip
Copy everything into your \arduino\libaries\RF24\ folder

https://github.com/mysensors/Vera
Click download zip button
unzip vera-master.zip
and upload the 10 luup files via the apps->Develop Apps->luup files section on the vera unit.

Update the EthernetGateway.ino with your local IP, ethernet card type and settings

Recompile and upload all the sensors.

Offline BulldogLowell

  • Hero Member
  • *****
  • Posts: 1576
  • Karma: +191/-85
Re: Arduino Relay Node Sensor - Help
« Reply #23 on: May 03, 2014, 07:38:14 am »
Here is what I did for updated version 1.3b3 (18848a2)

zip up your original adruino project folder (so you have a backup)

https://github.com/mysensors/Arduino
Click download zip button
unzip Arduino-master.zip
Copy and replace everything in your \arduino\ folder

https://github.com/mysensors/RF24
Click download zip button
unzip RF24-master.zip
Copy everything into your \arduino\libaries\RF24\ folder

https://github.com/mysensors/Vera
Click download zip button
unzip vera-master.zip
and upload the 10 luup files via the apps->Develop Apps->luup files section on the vera unit.

Update the EthernetGateway.ino with your local IP, ethernet card type and settings

Recompile and upload all the sensors.

Thank you.

Successfully upgraded.

Best Regards!

« Last Edit: May 03, 2014, 07:52:41 am by Bulldoglowell »

Offline kandlg

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
Re: Arduino Relay Node Sensor - Help
« Reply #24 on: August 20, 2014, 09:59:01 pm »

https://github.com/mysensors/RF24
Click download zip button
unzip RF24-master.zip
Copy everything into your \arduino\libaries\RF24\ folder


This link is broken.  Are the new RF-24 files now in the 1.3b3 repository, are they somewhere else, or are they essentially part of the new 1.4 beta?

Offline lininger

  • Newbie
  • *
  • Posts: 18
  • Karma: +1/-0
Re: Arduino Relay Node Sensor - Help
« Reply #25 on: August 20, 2014, 10:27:00 pm »
I am not sure of the final state of 1.3b3. I have been on the 1.4b1 for some time now and I know the RF24 has been moved under the Arduino / libraries / MySensors / utility /  folder in the 1.4 development version.

http://forum.mysensors.org/topic/168/1-4-beta covers all the changes in 1.4b.



Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: Arduino Relay Node Sensor - Help
« Reply #26 on: August 21, 2014, 01:35:49 am »

https://github.com/mysensors/RF24
Click download zip button
unzip RF24-master.zip
Copy everything into your \arduino\libaries\RF24\ folder


This link is broken.  Are the new RF-24 files now in the 1.3b3 repository, are they somewhere else, or are they essentially part of the new 1.4 beta?

In 1.3 the RF24 library is included in the library folder.
https://github.com/henrikekblad/Arduino/tree/master/libraries/RF24

Offline kandlg

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
Re: Arduino Relay Node Sensor - Help
« Reply #27 on: August 21, 2014, 06:01:00 am »
Thank you.  I wasn't sure because the file dates in that repository are dated March 26 which is actually before you had the discussion here.  I have built a relay node and am waiting to see if an intermittent motion sensor will re-route.

I am having a difficult time converting a dallas temperature sensor node to a repeating sensor node.  When I make the changes to the sketch shown here
http://www.mysensors.org/build/sensor_api#relaying-nodes
I cannot get it to send the temperature properly.  It sends an initial value which is incorrect and then never updates.  I am deleting the nodes and adding them again to vera.  It is not the hardware because it will work fine as a temperature node only so it must be the sketch.  Can someone post what the proper sketch should be?