-
Notifications
You must be signed in to change notification settings - Fork 415
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
SX1280 ranging not working #293
Comments
I haven't used SX1280 ranging since it was originally implemented, so it's very possible it's been broken at some point, or even that it never worked correctly. The missing calibration as well as the missing readout steps were added in the last commit, could you check if that fixed the issue? |
Thanks for the quick update. The commit is almost working after a few small tweaks. I can see the values in the ranging result register and they change as I move the devices around, but the conversion to meters is not accurate, though the formula appears correct.
My copy of the code is a mess with debug garbage in it now. When I get it more presentable I can submit a PR or just share the changes.
How did you come up with the values for calibration?
…Sent from my iPhone
On Apr 26, 2021, at 12:29 PM, Jan Gromeš ***@***.***> wrote:
I haven't used SX1280 ranging since it was originally implemented, so it's very possible it's been broken at some point, or even that it never worked correctly.
The missing calibration as well as the missing readout steps were added in the last commit, could you check if that fixed the issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
The values are from SX1280 ranging guide - to get more accurate results you might have to do your own calibration, using the process described in that document. |
I tried doing a PR with the changes, but screwed up something on my system so I'm falling back to the rather crude "sending you the diffs" method. These changes are still returning incorrect ranging, and I need to investigate further but wanted to get this off my mind. I don't think the 3 separate readRegister calls make any difference over a single read of 3 bytes, but that's what I found in Semtech code someplace. The more significant changes are the (1<<1) for enabling the clock and make sure to respect endianness when building the raw value.
|
Thanks, I'll put that into commits and push it. What sort of values do you get out of ranging now? |
I have been happy that I can just get the values to change as I move the devices around. I still need to look into the calibration some more. I did find an additional issue: _sf should not be used as an index into calTable (line 96+). Try:
...I really need to get my dev environment sane again so I can just submit the PR... |
@miked531 not sure if this is still relevant, but I went through the documentation available for SX128x ranging (mainly the datasheet, AN1200.29 and https://os.mbed.com/teams/Semtech/code/SX1280Lib/). It seems everything in RadioLib should be correct, the only issue is the calibration. Since it seems the process is quite involved, I added the option for users to set their own calibration table. |
I am attempting to use the SX128x_Ranging example and it always reports 0 meters. Transmit/receive examples work successfully.
Comparing the SX1280 DS (section 14.5) to the code and I see the calibration (step 9) missing. There may be a few steps missing with trying to read the result in step 12. I have no idea if any of the steps are important. (I am new to Arduino and SX1280). Using DS_SX1280-1_V3.2 as my reference PDF.
Sketch that is causing the module fail
Hardware setup
Two Arduino Nano 33 IOT boards with NiceRF SX1280-TCXO modules.
Debug mode output
this repeats...
Additional info (please complete):
The text was updated successfully, but these errors were encountered: