After running NRF24L01+ for a few years I recently decided to upgrade to several NRF24L01+PA+LNA (Antenna version) using the link from this page. Initially the performance was worse. Fail to find gateway, fail to send data and lots of NACKs. However eventually I was able to get them working. Below is a summary of tweaks and suggestions from various Mysensor Forum posts that helped stabilize my sensor network.
-
Add 47uf capacitor between 3v and ground pin on the transceiver.
-
Add plastic-wrap then a tinfoil shield as per other threads. Tinfoil needs to to touch the base of the antenna (ground).
-
My 5V switching power supply to the Arduino Nano was causing problems. Some sort of noise on the wire? When I disconnected the transformer and powered the arduino by laptop usb, the signal was much more reliable. So I added a 1000uf capacitor between ground and 5V coming from the transformer which filtered out the noise coming from the power supply. This is probably not applicable to battery powered devices.
-
Use static node addressing for each node - automatic addressing sometimes randomly make bad routing decisions bypassing repeater nodes and choosing far away nodes.
// Far-from-gateway sensor node
#define MY_NODE_ID 2
// Parent is a repeater node
#define MY_PARENT_NODE_ID 1
#define MY_PARENT_NODE_IS_STATIC -
Lower the power on the transceiver. Try each power level reboot the node and pay attention to: Setup speed, how many NACKs.
// RF24_PA_MIN = -18dBm;
// RF24_PA_LOW = -12dBm;
// RF24_PA_HIGH = -6dBm;
// RF24_PA_MAX = 0dBm
#define MY_RF24_PA_LEVEL (RF24_PA_LOW) -
Run the RF24 scanner example for a long time to find a channel that is free from noise. I ran it for a day to pick up neighbourhood noise and loaded the results into a spreadsheet to graph. Set the clearest channel on all my nodes. e.g.
#define MY_RF24_CHANNEL (105) -
In domoticz I lowered the ACK time from 1200 to 400 to avoid broadcast storms/collisions. On the nodes after each send or receive add a "wait(LONG_WAIT);" to allow ACKs to settle between transmissions ( e.g. 500ms).
-
Run a ping-pong test between two battery powered mobile nodes to find optimal locations for your gateway, repeaters and sensors. Find the outer limits and keep the nodes well within those limits. Try not to place a node at the outer range limit, add repeaters. Sometimes moving a few feet in one direction can have a big difference.