Skip to content

Commit 3d70560

Browse files
committed
RF24: Implement MY_RF24_INVERTED_ACK hack
This hack allows better nRF24L01<-->SI24R01 interoperability Signed-off-by: Andrew Andrianov <[email protected]>
1 parent 8903b93 commit 3d70560

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

MyConfig.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,48 @@
420420
#define MY_RF24_CHANNEL (76)
421421
#endif
422422

423+
/**
424+
* @def MY_RF24_INVERTED_ACK
425+
* @brief Assume that this node's radio auto-ack bit is reversed
426+
*
427+
* Define this if this node has a wireless chip with AutoACK bit reversed
428+
* compared to wireless chip in the gateway. Read this for more details.
429+
*
430+
* There are a dozen nRF24L01+ clones out there in the wild. A few of them (SI24R01)
431+
* have their AutoACK bit inverted, due to a bug in the original doc they ripped off
432+
*
433+
* If this define doesn't help with your setup (and your clones are even weirder),
434+
* here are a few more tricks:
435+
*
436+
* 1. Assign a static Parent ID and Node ID for your node.
437+
*
438+
* #define MY_NODE_ID 1
439+
* #define MY_PARENT_NODE_ID 0
440+
* #define MY_PARENT_NODE_IS_STATIC
441+
*
442+
* However you loose the automated 'mesh' organisation function of the network.
443+
* That is not fun, but it's okay for some leak sensors that should have this static
444+
* anyway.
445+
*
446+
* 2. Try different speeds. Some of the fakes I got don't play along with genuine
447+
* chips nicely when the speed is 250Kbps. 1Mbps and 2Mbps work fine.
448+
*
449+
* 3. Put your finger on the PCB antenna. If the thing starts working, you are missing
450+
* a 1 pF capacitor on the module. See this post:
451+
*
452+
* https://ncrmnt.org/2021/01/03/nrf24l01-fixing-the-magic-finger-problem/
453+
*
454+
*
455+
* Obligatory reading material:
456+
*
457+
* https://sigrok.org/wiki/Protocol_decoder:Nrf24l01 - A list of clones and their 'features'
458+
* https://hackaday.com/2015/02/23/nordic-nrf24l01-real-vs-fake/ - Hack-a-Day article describing the problem
459+
* https://forum.mysensors.org/topic/9947/nrf24l01-si24r1 - mysensors forum thread
460+
* https://ncrmnt.org/2015/03/13/how-do-i-cost-optimize-nrf24l01/ - Missing components on some COB fakes
461+
*
462+
*/
463+
//#define MY_RF24_INVERTED_ACK
464+
423465
/**
424466
* @def MY_RF24_DATARATE
425467
* @brief RF24 data rate.

hal/transport/RF24/driver/RF24.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,9 @@ LOCAL void RF24_setNodeAddress(const uint8_t address)
385385
// enable node pipe
386386
RF24_setPipe(_BV(RF24_ERX_P0 + RF24_BROADCAST_PIPE) | _BV(RF24_ERX_P0));
387387
// enable autoACK on pipe 0
388+
#ifndef MY_RF24_INVERTED_ACK
388389
RF24_setAutoACK(_BV(RF24_ENAA_P0));
390+
#endif
389391
}
390392
}
391393

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ MY_RF24_BASE_RADIO_ID LITERAL1
158158
MY_RF24_ENABLE_ENCRYPTION LITERAL1
159159
MY_RF24_CE_PIN LITERAL1
160160
MY_RF24_CHANNEL LITERAL1
161+
MY_RF24_INVERTED_ACK LITERAL1
161162
MY_RF24_CS_PIN LITERAL1
162163
MY_RF24_DATARATE LITERAL1
163164
MY_RF24_IRQ_PIN LITERAL1

0 commit comments

Comments
 (0)