I 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-pi-using-nrf24l01
My problem is: I don’t receive anything. The Raspberry seems to send everything properly (i.e. “H”, “i”, “0”, … etc) Serial output is listed below. Can someone please help me?
The code I am using for Raspberry:
import RPi.GPIO as GPIO
import time
import spidev
from lib_nrf24 import NRF24
GPIO.setmode(GPIO.BCM)
pipes = [[0xE0, 0xE0, 0xF1, 0xF1, 0xE0], [0xF1, 0xF1, 0xF0, 0xF0, 0xE0]]
radio = NRF24(GPIO, spidev.SpiDev())
radio.begin(0,25)
radio.setPayloadSize(8)
radio.setChannel(0x76)
radio.setDataRate(NRF24.BR_1MBPS)
radio.setPALevel(NRF24.PA_MIN)
radio.setAutoAck(True)
radio.enableDynamicPayloads()
radio.enableAckPayload()
radio.openWritingPipe(pipes[0])
radio.printDetails()
sendMessage = list(" Hi")
while len(sendMessage) < 8:
sendMessage.append(0)
while True:
start = time.time()
radio.write(sendMessage)
print("Sent the message: {}".format(sendMessage))
radio.startListening()
while not radio.available(0):
time.sleep(1/100)
if time.time() - start > 2:
print("Timed out.")
break
radio.stopListening()
time.sleep(3)
The code for my Arduino:
#include<SPI.h> // spi library for connecting nrf
#include<RF24.h> // nrf library
RF24 radio(9, 10) ; // ce, csn pins
void setup() {
Serial.begin(9600) ; // start serial monitor baud rate
Serial.println("Starting.. Setting Up.. Radio on..") ; // debug message
radio.begin(); // start radio at ce csn pin 9 and 10
radio.setPALevel(RF24_PA_MIN) ; // set power level
radio.setChannel(0x76) ; // set chanel at 76
const uint64_t pipe = 0xE0E0F1F1E0LL ; // pipe address same as sender i.e. raspberry pi
radio.openReadingPipe(1, pipe) ; // start reading pipe
radio.enableDynamicPayloads() ;
radio.powerUp() ;
}
void loop() {
radio.startListening() ; // start listening forever
char receivedMessage[8] = {0} ; // set incmng message for 32 bytes
if (radio.available()) { // check if message is coming
radio.read(receivedMessage, sizeof(receivedMessage)); // read the message and save
Serial.println(receivedMessage) ; // print message on serial monitor
Serial.println("Turning off the radio.") ; // print message on serial monitor
radio.stopListening() ; // stop listening radio
String stringMessage(receivedMessage) ; // change char to string
delay(1000); // delay of 1 second
Serial.print(stringMessage); // print received mesage
}
delay(10);
}
Output: just a loop of
Turning off the radio.
Turning off the radio.
Turning off the radio.
I have checked my wiring three times over…
-
1Comments are not for extended discussion; this conversation has been moved to chat. – Ghanima♦ Jan 24 at 11:23
This fixed my issues with Raspberry Pi 3 B+ and Raspberry Pi 4 In lib_nrf24.py in function:
def begin(self, csn_pin … after self.spidev.openadd:
self.spidev.max_speed_hz = 4000000
Did you find out an other solution?
I 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: circuitdigest.com/……


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

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


invent.module143.com/…
(2) Rpi3 Tutorial 14 – Pi to Arduino Python Communication with NRF24L01+ – Sushant Narang Module 143 2016jun14
invent.module143.com/….

penzu link: penzu.com/p/23fef382.



(4) Check received power detector (Reg 9, bit 0), (5) max power setup RF-PWR = 11 0dBm (6) Config reg setup bit 1 pwr_up = 1, PRIM_RX = 0.




¥7 a piece): item.taobao.com/…. I guess my toy would arrive before this weekend. Then we can cross check each other’s setup and testing, sort of “pairing programming/development) and make troubleshooting more efficient.


Received: []
Translating the receivedMessage into unicode characters
Loaded payload reply of [1]
And those three lines continuously looped















raspberrypi.stackexchange.com/….








tomshardware.com/news/…
(2) New Linux 5.5 – Supports Raspberry Pi 4! By yida 9 hours ago
seeedstudio.com/blog/2020/02/…





Q1. If Win32Image Manager V1.0 gives error message when trying to flash a buster image, what should I do?
A1. Use SD Formatter V4.0 to “Overwrite mode” format the SD card (yes, “Quick format mode” won’t do), then the SD card will now be flashable.
Q2. If after SD Formatter V4.0 has “overwrite formatted” the previously Win32ImageManager unflashable SD card, it is now indeed flashable, but





And as the saying goes, eat the big elephant bite by bite – First bite is SPI setup, Second, nRF24 initiatization, third, nrF24 configuration, …
This way you taste each bite slowly, understand and enjoy, …
I am a huge fan of the mad electrical engineer Oliver Heaviside, and agree very much what he is saying: “Shall I refuse my dinner because…



howtomechatronics.com/…

youtube.com/… After watching this video modules: Which radio module? NRF24, LoRa, CC1101, HC12, 433MHz, HC05 – 2019jun 30
youtube.com/… After watching this video I more what is going on with other modules such as Lora, and BlueTooth.



I myself am working on an escaperoom.. needs to be finished by Friday so I’m still in no need to hurry this project!




(1) Nordic nrf52840 Datasheet – Nordic Semi
infocenter.nordicsemi.com/pdf/…
(2) AliExpress nrf52840 Dongle Catalog
aliexpress.com/w/…
(3) AliExpress NRF52840 NRF BLE5.0 dongle with shell – US$15
fr.aliexpress.com/item/…

Categories: Uncategorized