-
Notifications
You must be signed in to change notification settings - Fork 409
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
SX126x in FSK mode always reports wrong CRC #1350
Comments
I hope to be able to investigate this a bit more, but in August, combined with Chirpstack 4.4.?, the gateway logs showed that FSK uplinks were being received (but dropped somewhere higher up) - in October, with v4.5.4, the uplinks weren't received and now on 4.6.2 still not received. This might indicate that CRC already fails on transmission (and started failing in between August's and October's tests). |
I tried Chirpstack 4.4 again, but the FSK uplinks don't appear in the gateway logs now. As the changes to LoRaWAN & SX126x code since then are non-trivially convoluted, I cannot easily roll back to the code I had back then (I don't hoard copies like @HeadBoffin does - no, this is not a reason for me to buy a 14TB NAS). Two more observations:
Either I'm doing stuff terribly wrong, or something very sketchy is happening. Note that I have no experience with FSK nor have an SDR in my possession, but this doesn't feel right. |
@StevenCellist I hope you didn't spend too much time on this, because it's really stupid mistake on my part - sorry! In f23f798, configurable preamble detector length was added for SX126x, which changed the order of parameters for Pushed a commit that should fix this. I think this also manifests in other ways, such as in #1338 where FSK transmission is reported to be always timing out. |
LOL well I learned to speedrun Chirpstack by now so both sessions were just shy of a couple of hours. Not too bad to have it fixed. Let me give it a go :) |
In principle, the issue is fixed, until I alter the preamble length - then I get a CRC error again. |
I am simply going device-to-device, not device-to-gateway. Reception breaks for preamble length 32 bits and higher. |
Now breaks my clog (gotta love Dutch sayings) - simply removing |
There's an interesting note in the SX126x datasheet: Right now, since preamble is 40 bits, it will set the maximum preamble detector, which is 32 bits, and that's more than the 24 bits of the sync word. Lowering the detector length to 24 or 16 bits, reception starts working again. @StevenCellist I can either expose the detector length to user, or we can add some logic to verify this condition is met. To be honest I'm more in favor of option 1 since the second would be kind of convoluted. |
Wow.. that looks like such a lazy shortcut by Semtech! |
Strictly speaking, you would yield better results with 32 bits detLength and 4-byte syncword, but IMO cutting down the 32-bit detLength to a 'best-effort' 24-bits detLength for the 3-byte syncWord is good enough. |
Definitely smeels like it. I would need to see how the internals of the detector are implemented, but our preamble is for sure long enough to reliably detect 32 bits eve if the sync word is 24-bit.
Possibly since #1268 also reports CRC error. Seems like the CRC error flag is pretty ambiguous.
What I don't like about that one is that there would be no easy way to allow user to force it. Though I guess we can always resolve that later e.g. with a dedicated method, and we can add comments to the docs explaining this automation. |
Well.. what use is there for the user in setting the |
I agree, but with a bit more thought, it's not so bad of an idea. With the CRC disabled (#1353 and my own observation), it practically returns nothing, no error, just nothing. That is even worse than reporting some error. And there aren't many IRQs that signal an error - only Timeout (which makes no sense), Header (why though), and CRC (why though but OK). While it is very weird that this limitation is active in the first place, I see why they chose to resolve it in this way. |
Pushed a commit adding the automated configuration - with that the issue is resolved. I will keep digging further into #1268 since that very much feels related, but still present with this fix. |
I've been trying to get LoRaWAN working on the FSK datarate, however unsuccessful. To that end, I fired up a second device that is configured as a listener for the FSK uplinks, but it turns out that I always get a CRC error (no address filtering).
As I don't have an SDR, I cannot do the fancy stuff in #1268 unfortunately. And whatever I tried, I cannot recover the original uplink content (it looks like the packet length & content is rather undefined when a CRC error occurs).
To Reproduce
Tested using Heltec Wireless Stick Lite V3, using the
config.h
from LoRaWAN examples. So be aware of radio (and SPI) setup.FSK transmitter sketch
FSK receiver sketch
Additional info (please complete):
The text was updated successfully, but these errors were encountered: