Wireless RF Communication using nRF24L01 Module

Submitted by Steve on

hi,

in your description of connecting Raspery pi with Arduino Uno you connect in the picture CSN Pin of nRF24 module to GPIO Pin 8 of Raspberry and CE Pin of nRF24 module to Pin GPIO Pin 25 of Raspberry pi. But in the Python code of Raspberry pi you change this to:

your code:

Begin the radio using GPIO08 as CE and GPIO25 as CSN pins.

radio.begin(0, 25)  

I cannot establish comunication between Rasp pi and Arduino even if I change these 2 pins.
Can you please explain this problem.

Circuit-Diagram-for-Interfacing-nRF24L01-with-Raspberry-Pi.png

hi,

I solved the problem - the picture is ok, the only bug was that in your description you say:

radio.begin(0, 25) # start the radio and set the ce,csn pin ce= GPIO08, csn= GPIO25

This is not true. CSN is on GPIO08 and CE is on GPIO 25
 

I found two other problems why it did not work.
I have an Rasperry pi 4 and by default SPI master driver is disabled by default on Raspberry Pi OS.

To enable:

ensure the line dtparam=spi=on isn't commented out in /boot/config.txt, and reboot. If the SPI driver was loaded, you should see the device /dev/spidev0.0.
https://circuitdigest.com/microcontroller-projects/wireless-rf-communication-between-arduino-and-raspberry-pi-using-nrf24l01

and the second problem was that CRC length was disabled:

to enable:

The problem is that I use Python to access the bus and it is not evident how, when and where I should set the speed of the SPI bus.
EDIT: I found it: In lib_nrf24.py in function:

def begin(self, csn_pin ... after self.spidev.open add:
self.spidev.max_speed_hz = 4000000
(in my case 5 MHz did not work)

found here: https://raspberrypi.stackexchange.com/questions/71730/possible-spi-issues-around-nrf24-operations-post-rpi-system-update

Now it works fine - thanks a lot

 

  Joined June 13, 2020      2
Saturday at 07:48 PM