-
Notifications
You must be signed in to change notification settings - Fork 433
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
Unable to get a valid SPI interface on Raspberry Pi 5 #1425
Comments
Ok I think I got it working for the Raspberry Pi 5 (finally). So, for whoever is passing by in quest for a solution, here's what I did using informations from an old issue :
I still have a problem when running the program. I can't seem to get access back to previously enumerated pins. As if the program is still running in the background. But at least I managed to send something. |
I forgot to post the code that worked (although not really different): #include <iostream>
#include <cstdlib>
#include <sstream>
#include <RadioLib.h>
#include "hal/RPi/PiHal.h"
#include <lgpio.h>
PiHal* hal = new PiHal(0);
SX1262 radio = new Module(hal, 21, 16, 18, 20);
int main(int argc, char** argv) {
std::cout << "[SX1262] Initializing ... ";
// forgot to mention these too lines
// it's so that I don't get a -707 error
// (cf. Troubleshooting section in the wiki)
radio.XTAL = true;
radio.setTCXO(0.0);
int state = radio.begin(868.0);;
if (state != RADIOLIB_ERR_NONE) {
std::cout << "failed, code " << state << std::endl;
return EXIT_FAILURE;
}
std::cout << "success!" << std::endl;
int count = 0;
while (true) {
printf("[SX1262] Transmitting packet ... ");
char str[64];
sprintf(str, "Hello World! #%d", count++);
state = radio.transmit(str);
if(state == RADIOLIB_ERR_NONE) {
std::cout << "success!" << std::endl;
hal->delay(1000);
}
else {
std::cout << "failed, code " << state << std::endl;
}
}
delete hal;
return EXIT_SUCCESS;
} |
Ok I'm gonna close the issue and start a discussion about joining TTN network. |
Describe the bug
I'm still stuck with the Raspberry Pi example. I try to use it on my Raspberry Pi 5, but I am not able to get a valid SPI handle.
To Reproduce
I'm using a modified Raspberry Pi example.
Expected behavior
Just make the SX1262 work fine on my Raspberry Pi 5 using the example for the Raspberry Pi.
Screenshots
No screenshots but I do have the errors:
I get these when the SPI interface is turned off using raspi-config (which I can only assume is normal):
And I get these when it is on (the same goes for the other SPI CS pin 8):
Which I don't understand because, the SX1262 HAT excluded, nothing is on the GPIO. When checking the pins with lgpio, I get this though :
And I don't know what to do with these.
Additional info (please complete):
The text was updated successfully, but these errors were encountered: