Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSN Pin = 0 on getting started linux #684

Closed
Mbasttias opened this issue Nov 16, 2020 · 6 comments
Closed

CSN Pin = 0 on getting started linux #684

Mbasttias opened this issue Nov 16, 2020 · 6 comments
Assignees

Comments

@Mbasttias
Copy link

hello, I just downloaded and installed the library but when I use some getting started the pin configuration is not correct and the communication is not established with another node.

the hardware configuration message is as follows

================ SPI Configuration ================
CSN Pin = 0
CE Pin = Custom GPIO22
SPI Speedz = 10 Mhz

when you should dial

CSN Pin = CE0 (PI Hardware Driven)

Besides, if I want to try any of the examples with another node anyway, the communication is not established either as sender or receiver. Previously I had used this library in another RPi and I had not given that problem. Look for several possible solutions related to the constructor RF24 radio(22, 0), , but I couldn't fix it.

@2bndy5
Copy link
Member

2bndy5 commented Nov 16, 2020

CSN Pin = 0

This is referring to CE0 (AKA GPIO8).

the communication is not established

This could mean a lot of things. However, if radio.begin() returns true, then the SPI bus is properly setup. In fact, the output you quoted is from using radio.printDetails() which directly reads values from the radio's registers via SPI bus. But, you didn't post any of the registers' info (found in the section labeled "NRF Configuration") from that function's output, so I can't say for sure if SPI is behaving properly.

Did you change this line in either (not both) of the gettingStarted.cpp examples? Without doing so, each node is trying to communicate to the same unique node instead of each other.

@2bndy5
Copy link
Member

2bndy5 commented Nov 16, 2020

Just realized the getting started example's radioNumber variable on Linux is already set up to communicate to the arduino example's radioNumber

Previously I had used this library in another RPi and I had not given that problem.

It depends how long ago you last tried the library (there have been updates to the c'tor)

We simply need more details to help you here.

@Mbasttias
Copy link
Author

Mbasttias commented Nov 17, 2020

They are right that the communication was not established due to the radioNumber, I had not noticed that detail and the communication was established without problems, but I still can not change what the impression of radio.printDetails()

@2bndy5
Copy link
Member

2bndy5 commented Nov 17, 2020

I still can not change what the impression of radio.printDetails()

Why is it so important that it say CE0 instead of 0? Part of the reason is because we need the same code to work on arduino and Linux. The other part of the reason is because there is more than 1 SPI bus on RPi (although it takes some extra work to enable a second or third SPI bus). I think CSN = CE0 is more confusing than it is concise.

Even if you do manage to get radio.printDetails() to say

CSN = CE0 (Pi Hardware Driven)

This change will not be considered for future release of the library because this library aims to support other Linux based SoC boards that are not a RPi.

@2bndy5
Copy link
Member

2bndy5 commented Nov 18, 2020

@Mbasttias I found the commit that changed the output for CSN pin's label. This was done just before release of v1.3.7. I can't endorse rolling back to v1.3.6 because you would lose the various important bugfixes in the later releases

@2bndy5 2bndy5 self-assigned this Dec 7, 2020
@2bndy5
Copy link
Member

2bndy5 commented Dec 14, 2020

Output for printDetails() (& printPrettyDetails()) now prints "/dev/spidev<bus_number>.<bus_cs_pin>" about the CSN pin to avoid any further confusion.
So calling

RF24 radio(22, 0);
radio.begin();
radio.printDetails();

should say

CSN Pin = /dev/spidev0.0

@Mbasttias I"m closing this now. If you have a better suggestion that isn't specific to the Raspberry Pi, feel free to re-open this issue and post it here.

@2bndy5 2bndy5 closed this as completed Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants