1

I have a new Raspberry Pi 3 B+ model. I also bought a few nrf24l01+ modules.

I hooked up one of the nrf24l01+ modules to my RPi with these connections:

RPi    | nrf24l01+
-------|----------
3.3    |  VCC
GND    |  GND
GPIO8  |  CSN
GPIO17 |  CE
GPIO10 |  MOSI
GPIO09 |  MISO
GPIO11 |  SCK

I downloaded the BLavery library for RPi from here: https://github.com/BLavery/lib_nrf24 . I then moved the file lib_nrf24.py to my working directory at ~/projects/helloworld/lib_nrf24.py.

I then created a file called ~/projects/helloworld/receiver.py and placed the following code:

import RPi.GPIO as GPIO
from lib_nrf24 import NRF24
import time
import spidev

GPIO.setmode(GPIO.BCM)

pipes = [[0xE8, 0xE8, 0xF0, 0xF0, 0xE1],[0xF0, 0xF0, 0xF0, 0xF0, 0xE1]]

radio = NRF24(GPIO, spidev.SpiDev())
radio.begin(0,17)

radio.setPayloadSize(32)
radio.setChannel(0x76)
radio.setDataRate(NRF24.BR_1MBPS)
radio.setPALevel(NRF24.PA_MIN)

radio.setAutoAck(True)
radio.enableDynamicPayloads()
radio.enableAckPayload()

radio.openReadingPipe(1,pipes[1])
radio.printDetails()
radio.startListening()

When I run the command python3 ~/projects/helloworld/receiver.py, I get this output:

STATUS   = 0x03 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=1 TX_FULL=1
RX_ADDR_P0-1     =
 0xfdfdfdfdfd 0xfefefefefc
RX_ADDR_P2-5     =
0xf8
0xf9
0xf9
0xf9

TX_ADDR          =
 0xfdfdfdfdfd
RX_PW_P0-6       =
0x00
0x0c
0x00
0x00
0x00
0x00

EN_AA            =
0x0f

EN_RXADDR        =
0x00

RF_CH            =
0x1f

RF_SETUP         =
0x00

CONFIG           =
0x03

DYNPD/FEATURE    =
0x03
0x01

Data Rate        = 1MBPS
Model            = nRF24L01
CRC Length       = Disabled
PA Power         = PA_MIN

My question is why does the output show RX_ADDR_P0-1 = 0xfdfdfdfdfd 0xfefefefefc when I wrote [0xF0, 0xF0, 0xF0, 0xF0, 0xE1], and why does the output show RF_CH = 0x1f when I wrote radio.setChannel(0x76)?

I noticed that BLavery stopped supporting the lib_nrf24 library a few months before my RPi 3 B+ was released. Would this have anything to do with my problem? Is there another practical way to use the nrf24l01 module with my RPi 3 B+?

Note: this is part of my investigation into why the RPi 3 B + is not receiving any payload from my arduinos that are transmitting with an nrf24l01 module. I got two arduinos to talk to each other with nrf24l01. So my next step is to get arduino to RPi working.

  • Can you please consider this tutorial: forum.mysensors.org/topic/1151/… – Shubhendu Feb 18 '19 at 5:40
  • Thanks, I'm stuck on step 4 where it asks to enter the directory Raspberry/librf24-bcm/. I don't see that directory in the tmrh20 library or the Raspberry-master that I downloaded in Step 3. – John Feb 18 '19 at 14:14
  • You unziped it!? – Shubhendu Feb 18 '19 at 14:19
  • That's correct, I unzipped https://github.com/mysensors/Raspberry/archive/master.zip and don't see any librf24-bcm – John Feb 18 '19 at 14:21
  • github.com/mysensors/Raspberry can you follow instructions from here for nrf they added other things – Shubhendu Feb 18 '19 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.