last day (63 days later) » 

11:23 AM
0
Q: Rpi SPI nRF24L01+ 2.4GHz Transceiver Module Send Message to Arduino Problem

StevenCellistI have recently bought two nRF24L01+ radio chips for communication between my Raspberry Pi and Arduino. I will be solely using this from Raspberry towards Arduino. The tutorial I followed: https://circuitdigest.com/microcontroller-projects/wireless-rf-communication-between-arduino-and-raspberry-p...

 
Figured my Arduino gives that output even while the Raspberry is turned off...
Also figured that my wireless mouse and keyboard might be interfering but unplugging and turning off those didn't make any difference
 
Hi @StevenCellist, Welcome and nice to meet you. Ah, let me see. If Arduino gives same output even Rpi is turned off, then Arduino is not receiving anything or just rubbish from Rpi, and so the problem is perhaps on the Rpi side. Let us start doing troubleshooting the Rpi side: (1) Make sure the SPI software and hardware wiring is OK, by doing SPI loop back. (2) Make sure nRF24L01 is working, by pinging, ie, read config register 0x00 should read 0x80. Of course you can skip (1) and just do (2) If you read 0x80 from nRF24L01's register 0x00, then SPI is OK. / to continue, ...
(3) Read the tutorial "Wireless RF Communication using nRF24L01 Module -Abhiemanyu Pandit 2019aug01, circuitdigest.com/microcontroller-projects/…, (4) Run the tutorial's python program for Rpi. The statement "radio.printDetails()" should print the "details" does it?
References: (1) nrf24l01 Features - components101 components101.com/wireless/nrf24l01-pinout-features-datashee‌​t (2) nRF24L01+ Single Chip 2.4GHz Transceiver Product Specification v1.0 - Nordic 2008 components101.com/sites/default/files/component_datasheet/…
Ref (1) says the following: "The nRF24L01 module is a bit tricky to use especially since there are many cloned versions in the market. If you are having any problem with getting it work, try adding a 10uF and 0.1uF capacitor in parallel to the Vcc and Ground pins. Also make sure the 3.3V supply is clean and does not have any noise coupled in it."
Then read the GitHub for the bad news: only for "virtual GPIO", no longer supported. nRF24L01 Python Library - BLavery/lib_nrf24 2018 may V0.3 beta, no longer being maintained by the original author github.com/BLavery/lib_nrf24 For Raspberry Pi and virtual-GPIO. NRF24: strictly 3.3V supply!! Although logic pins are 5V tolerant.
Docs says the following: "This is BETA only so far. Everything has worked earlier, send, receive, including two RF24 on one host, and including RPI, virtual-GPIO and regular arduino sketch, all talking to each other. But recent testing has been only LIBRARY plus "example-nrf24-pair.py" on virtual-GPIO, so other parts are yet to be re-verified."
# StevenCellist, So are you using "Virtual GPIO"? Have you found any updated program NOT using virtual GPIO? The Rpi python program looks not that hard. Perhaps you can rewrite it not using virtual GPIO. PS - I NEVER heard of "virtual GPIO", so I asked.
I visited GiHub and found it was 5 years old, tweaked from the BegaBone program. So I don't think it worth your time playing with a Non rpi hardware compatible, tweaked program and NO LONGER supported. Find an updated Rpi program and let me know. Thanks and cheers.
Just now I searched this forum for "nRF24L01" and found 100+ posts. I skimmed and found the follow best for troubleshooting: "Major trouble with nRF24L01+ controllers and the RF24 library - Asked 5 years ago Viewed 8k times" (1) raspberrypi.stackexchange.com/questions/23441/…. Many of the 100+ posts above had not answers, but this very good one by @jhallard summarized the causes of trouble and also gave a good recommendation for testing.
As I said earlier, I have done the following last evening: (1) Used SPI loop back test to make sure that SPI wiring is working, (2) Use a one line python statement to read the nRF24L01's config register at address 0x00 and read successfully the default POR contents of 0x80. Next step is to try any tutorial but NOT your recommended one, for the reasons I gave above. In case you read the the above post @jhallardand and wish to try another tutorial recommend there, and still have problem,s I am happy to reproduce your setup, and see if I overlooked any other causes of trouble. Cheers.
If you read the 100+ old posts on nRF25L01, you might find there a couple of traps for newbies, including the following: (1) If you started your project with 5V Arduino and any Arduino compatible nRF24 modules, you might forget that Rpi is 3V3 only and power for Rpi is indeed 5V, but be WARNED that the nRF24 module for Rpi (but not for Arduino) might not have any 5V to 3V3 step down regulator, so you MUST use 3V3 power for the module, otherwise your nRF24 might FRY IMMEDIATELY!
(This is the reason I suggest you to loopback test SPI and ping (read nRF24 config register to make sure your nRF24 is not fried). (2) As pointed out earlier, there are quite a lot of different nRF25 modules on the market, some have 8 Bit connector, some 12 bit, mine tested OK for Rpi4B has 9 pins, including the antenna pin!, So you to very carefully compare and contrast the version you have to make sure you have wired correctly, beside using 0.1uF, 1/10uF to bypass the power supply fi your nRF is a low quality one without any regulator or bypass/decoupling caps.
Your module, if cheapy module from eBay might not have the necessary pull up resistors on module. For example, the interrupt pin or select module send/or receive mode, if no default pull up/downs, left floating, might be wrongly set to receive mode, instead of send mode which is what you want. Otherwise your nRF might not send, even your program is correct. (3) Some modules have confusing labels CEn, CSn, selectCE etc which might be Arduino friendly, but mislead you to wrongly use the hardwired nrF sen/receive mode pin for the SPI chip slect pin.
You might like to show us a picture of you module showing the SPI and send/receive mode pin and interrupt pin wiring, and I can compare your wiring with mine ( pin version) which has been tested OK. Cheers.
One more thing. I noticed that your question says you are using the "Plus Model" (nrf24L01+, with the "+' at the end.) If you are using the following + model, then you need to be very careful: "NRF24L01+ 2.4G ATMEGA48 wireless data transmission module + NRF24L01 arduino compatible US$3.50" fr.aliexpress.com/item/1976744557.html. ANOTHER WARNING: The module power supply is 5V, but there is NO wrong polarity protection, meaning that if you supply power with the wrong polarity, the module will get very hot and might fry in less than one minute.
 
That's a lot of stuff to work through.. thanks for all the recommendations! Unfortunately I have two test for university coming up next week, so I won't have any time till something like Wednesday. I will let you know once I'm working on it again! And thanks for all the information provided!!
Quick confirmation that I indeed am using the + version, shop link: tinytronics.nl/shop/nl/communicatie/rf/… (I am Dutch). Is it recommended to also buy the Adapter Board? tinytronics.nl/shop/nl/communicatie/rf/…
 
Ah, take your time. We can pause for a couple of days, and resume after your exams. Ah, I don't know nothing about the nRF24 adapter board, I guess it is for Arduino, but only 50% sure. Perhaps you go study for you exam now, and me in the mean time leisurely google around. Good luck to your exam and cheers.
Just now I had a quick look of the adapter thing. I now guess is just a stupid 8 pin to 5 pin or 6 pin conversion board. My three or four modules are straight connectors with 6 or 9 or more pins. Need to check out later. Cheers.
 
 
3 hours later…
2:20 PM
Okay I just did a loopback
I got '0E 00 00 00 ...' as result. (... filled with 00's)
STATUS = 0x07 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=3 TX_FULL=1
RX_ADDR_P0-1 = 0xf0f0f8f8f0 0xe1e1e1e1e1
RX_ADDR_P2-5 = 0xe1 0xe2 0xe2 0xe3
TX_ADDR = 0xf0f0f8f8f0
RX_PW_P0-6 = 0x04 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x1f
EN_RXADDR = 0x01
RF_CH = 0x3b
RF_SETUP = 0x00
CONFIG = 0x06
DYNPD/FEATURE = 0x0f 0x03
Data Rate = 1MBPS
Model = nRF24L01
CRC Length = Disabled
PA Power = PA_MIN
Result of print details
I do not really have a clue of the CONFIG is what you're looking for while trying to read 0x80 from the 0x00 register
 
2:51 PM
Ah, I am sorry to have misled you to try the spi lookback and then read the config register. This test is only a preliminary test or troubleshooting tool to make sure your SPI hardware/software setup is OK, and reading module's config register is sort of ping ing it. But now your python program can print the module registers as you just listed, there is no need to do the spi loopback and read config.
And we can now look into what the python program is doing and if we can try to do some troubleshooting. But I think you need to prepare for your exam now, so I should not bother you by suggesting any plan now. See you after your exam! Good luck. Cheers.
 
Nah I need something to do instead of studying sometimes.. I've got one more hour right now
I do not yet have any capacitors myself, but I just need any communication; reliability is only once I know they are communicating
 
3:32 PM
Alright I've just used the 'scanner' sketch from the library provided on Arduino
Here's the result:
RF24/examples/scanner/
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0xe0e0f1f1e0
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x00 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x00
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP = 0x01
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MIN
000000000000000011111111111111112222222222222222333333333333333344444444444444445555555555555555666666666666666677777777777777
Now somewhere after 16 lines into the scanner procedure, you can see two lines only filled with zeros. That's where I unplugged the nRF module from the Pi, but I connected it only 7 lines from the bottom again
 

  last day (63 days later) »