Closed Amir-HK closed 4 years ago
It should be working with RPi4, but the BCM2835 lib uses a bit of a workaround to support the RPi4. You can try a lower SPI speed in case there is a problem with SPI, long wiring or something. RF24 radio(22,0,1000000);
I would also suggest trying with the SPIDEV driver, since it should pretty much work on all Linux platforms:
rf24libs/RF24:
./configure --driver=SPIDEV
make
sudo make install
Then recompile the example and test.
You might have to reload SPI after switching drivers:
sudo rmmod spi_bcm2711 (for my RPi B its spi-bcm2835)
sudo modprobe spi_bcm2711
I think it may be time to configure SPIDEV as the default driver, since it supports a wider range of hardware.
The radio constructor should be the same for both drivers RF24 radio(22,0);
Might have to get me one of those fancy RPI4s to play with sometime soon to see whats up with the BCM driver.
First off, please don't open multiple issues for the same problem.
radio.setPALevel(RF24_PA_MIN);
radio.setChannel(3);
I checked the above points but my problem has not been solved.
I am sure the problem is related to PLL_Lock bit in the RF_SETUP register, which is High!
I changed my NRF24l01 module (my module has not antenna and is 100m ranges module), and for first time testing, the PLL_Lock bit was Low and radio.write method work correctly on RPI4, but in the next time, PLL_Lock bit change to HIGH and radio.write does not work!
So, can anyone tell me why PLL_Lock change in this Library?
Thanks in advance.
This is the first time this issue has come up, and I have no idea what is causing it. We just added a new function to the library to produce a constant carrier output, so if you update the library & rebuild/install, you should be able to call radio.stopConstCarrier();
after radio.begin(). In theory that should manually disable the PLL lock configuration and work around the issue until we can figure out what is causing it.
Hi,
I want to use the RF24 library with Raspberry pi 4B, which is based on BCM2711, but the RF24 library use BCM2835 (.c and .h). how can I use this library with Raspberry pi 4B?
Using the library without changes, I have faced some problems; for example, radio.write does not work!
I compared all of the registers with Arduino connected nrf24l01, which works correctly; the only difference is in the RF_SETUP register equal to 0x17. In contrast, on the Arduino side, the RF_SETUP register is 0x07, which means "force PLL lock signal" has been enabled in raspberry pi (based on datasheet explanation)!
I use Raspberry Pi OS, and connections are as below:
also, getstarted.cpp file is executed.