When you say the nodes lost connectivity, what that actually you mean? Have a look on some question/points below. It might help you debugging the issue:
- The nodes stop transmitting AND receiving? How are you checking it?
-- I have an LED connected to PIN 9 of Arduino which is turned on during RX/TX and turned off at the start of the loop() function.
- How do you recover the connectivity? If you simply restart the whole Arduino + RFM69 it might be something else, like Out-of-memory behavior in the Arduino. Any way you can prove the Arduino still happy and haven't stopped/restarted as well?
-- My sketch uses 7,448 bytes (24%) of program storage space. Maximum is 30,720 bytes.
- Does it happens to all nodes at same time? - if yes the gateway might be the problem ;)
-- As mention in my initial post, it only happens to the action nodes and that too, not at the same time.
- How often it happens? Have you noticed if there's something to do with the nodes uptime, number of exchanged messages or
it's completely random?
-- Its mostly random, It will stay up for couple of hours, I have noticed minimum 10 to 12 hours.
- Why do you pointed it to be a RFM69 power supply failure? Have you checked if it actually restarts? - You might be able to check it by looking one of the RFM69 registers. Change the register value to something else and keep "printing" it. If it suddenly change to the default value at same time your node losts connectivity, yes, it's restarting.
-- I don't think it is restarting as the RX/TX LED at pin 9 remains on until I restart. Every 10min, gateway is pulling RSSI from all the nodes. All 3 sensor nodes will respond to the gateway, but for both action nodes, gateway will report as connection lost and at the same time if I go and press the push button on the action node, the relay associate to the respective push button will turn on/off the AC lights, but the TX LED at pin 9 remains on always and it prints "Trying again" message. This message is printed if radio.sendWithRetry returns false.
I am using the default registers values, which I guess it is 0x1A, 0x0B.
- Do you have any other device connected to the Arduino SPI? If yes, you need to make sure you use atomic SPI transactions.
- What RFM69 driver are you using, if any?
-- RFM69 library at: https://github.com/LowPowerLab/
Please post as much details you can so it'll make easier to think what might be going wrong? From my experience Arduino running out of memory is a common problem, and many times difficult to diagnose. One idea is to keep sending the "free memory" to your gateway from time to time... if it's continualy decreasing you have a memory leak.
As indicated by @Arctic_Eddie, I too suspected it as current issue, but I was not sure. Last night I did the changes as suggested by @Arctic_Eddie.
I have 2 channel relay module (SRD-05VDC-SL-C) to turn on/off AC lights and TIP121 to turn on/off 12v 2A LED strip.
I think SRD-05VDC-SL-C need 100mA and Arduino can supply only 40mA. This is why I suspected it is current issue, but was not sure. Thanks @Arctic_Eddie for the hint. I have done the change as you have suggested
Thank you Mike for your help. I will update the status after monitoring for the whole day.