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

SX1262 Frequency Error #706

Closed
lvplummer opened this issue Mar 20, 2023 · 10 comments
Closed

SX1262 Frequency Error #706

lvplummer opened this issue Mar 20, 2023 · 10 comments
Labels
bug Something isn't working resolved Issue was resolved (e.g. bug fixed, or feature implemented)

Comments

@lvplummer
Copy link

I am using the great RadioLib with an ESP32C3 and SX1262. All works great except the reported frequency error. I get one good report and then wildly inaccurate results. Here is an example: -2241769.75. I am not sure if this is a bug or pilot error.

Larry

@jgromes
Copy link
Owner

jgromes commented Mar 21, 2023

Can you post some details about your setup? The code, details about your platfrom etc. - pretty much everything requested by the issue template.

Frequency error is experimental on SX126x, but seemed to be working for my use case (the SX126x_Receive/Receive_Interrupt examples).

@jgromes jgromes added the template info missing Author of this issue ignored the issue template. label Mar 21, 2023
@lvplummer
Copy link
Author

The hardware is two Heltec Wireless Stick V3 boards with ESP32S3 (not C3 as in earlier post) and SX1262.

https://www.amazon.com/dp/B07S5XLP6Q?psc=1&ref=ppx_yo2ov_dt_b_product_details

I am running your transmit and receive with interrupt examples on the two boards. The only changes were pins and LoRA config as follows:

SX1262 radio = new Module(8, 14, 12, 13);
SPI.begin (9, 11, 10);
int state = radio.begin(908.0, 500.0, 10, 5, 0x12, 10, 8);

I am using 0x12 for a sync word to be compatible with RadioHead which doesn't use a sync word but still transmits the default FSK 0x12 sync word.

Everything so far works as expected except for frequency error. I like to use frequency error as a simple feed forward AFC.

I run the exact same setup except for pin differences on a homebrew ESP32 and SX1276 board using the appropriate interrupt version examples which produce correct frequency error reports.

It took me a while to get SX1276 and SX1262 interop because I didn't realize that your CRC on/off defaults were different. Once both were turned on, all is good.

Larry

@jgromes
Copy link
Owner

jgromes commented Mar 22, 2023

Thanks for providing the configuration, with that I was able to replicate the issue. Turns out that there was a problem in the calulcation that I failed to see previously, ebcause I was testing with quite precise TCXXO modules. Using SX1278 with a bad crystal forced the issue. It should be fixed in the latest commit, thanks for reporting!

PS:

It took me a while to get SX1276 and SX1262 interop because I didn't realize that your CRC on/off defaults were different. Once both were turned on, all is good.

As far as I can tell, defaults should be the same for both SX127x and SX126x. I tested that with SX1278::begin() and SX1268::begin(), the two different modules can communicate. Is that not the case for you?

@jgromes jgromes closed this as completed Mar 22, 2023
@jgromes jgromes added bug Something isn't working resolved Issue was resolved (e.g. bug fixed, or feature implemented) and removed template info missing Author of this issue ignored the issue template. labels Mar 22, 2023
@lvplummer
Copy link
Author

lvplummer commented Mar 22, 2023 via email

@jgromes
Copy link
Owner

jgromes commented Mar 22, 2023

I am seeing the SX1276 default for CRC is off and for SX1262 default is
on

Where exactly are you seeing this? Looking through the code, it actually seems that neither one explicitly sets CRC.

EDIT: The commit fixing this issue was already pushed.

@lvplummer
Copy link
Author

Seeing is the wrong word. Using the defaults doesn't work. When I set the CRC to on for SX1276, it works. When CRC is set to on for the SX1262, it still works.

@jgromes
Copy link
Owner

jgromes commented Mar 23, 2023

@lvplummer FYI I explicitly enabled CRCs in the latest commits, so the defaults should match now.

@lvplummer
Copy link
Author

lvplummer commented Mar 23, 2023 via email

@jgromes
Copy link
Owner

jgromes commented Mar 23, 2023

Yes, I pushed it yesterday. If you go through the conversation (in GitHub issues) you will see the referenced commits fixing it.

@lvplummer
Copy link
Author

lvplummer commented Mar 23, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved Issue was resolved (e.g. bug fixed, or feature implemented)
Projects
None yet
Development

No branches or pull requests

2 participants