2

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.

jsotola
  • 322
  • 1
  • 3
  • 10
learningtech
  • 337
  • 3
  • 10
  • Can you please consider this tutorial: https://forum.mysensors.org/topic/1151/tutorial-raspberry-pi-nrf24l01-direct-connection –  Feb 18 '19 at 05: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. – learningtech Feb 18 '19 at 14:14
  • You unziped it!? –  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 – learningtech Feb 18 '19 at 14:21
  • https://github.com/mysensors/Raspberry can you follow instructions from here for nrf they added other things –  Feb 18 '19 at 14:23
  • If you get everything let me know and i ll post the correct answer –  Feb 18 '19 at 15:59
  • I'm following the instructions here https://www.mysensors.org/build/raspberry . And the sudo mysgw gives an output similar to what the guide outlines. So my next question is what channels, addresses etc.... is the Raspberry Pi listening on? For example, I have an arduino also equipped with an nrf24l01+. What values do I provide for radio.openWritingPipe(<addressvalue>) and radio.setChannel(<channelNumber>) in my arduino sketch file such that it will successfully transmit data to the RPi? – learningtech Feb 18 '19 at 16:16
  • the address which u use in arduino http://robotix.ah-oui.org/user_docs/dos11/NRF24L01-tutorial.pdf –  Feb 18 '19 at 16:29

0 Answers0