FOSSASystems / FOSSASAT-1

GNU General Public License v3.0
533 stars 106 forks source link

fixed wrong sync word for SX127X chips #9

Closed kbm15 closed 4 years ago

kbm15 commented 4 years ago

Summary of changes

SX126X are able to decode the frame but SX127X can't. After a thorough inspection, it seems the sync words aren't doing what they should. We used Dani EA4GPZ decoded frame to compare against different sync word behaviours and concluded the most similar one is 0x00.

Sources:
https://revspace.nl/DecodingLora#sync_word
https://twitter.com/yl3ct/status/1203771916504436736

jgromes commented 4 years ago

Thank you for the PR. According to Semtech, sync words on SX127x and SX126x should be compatible (https://lora-developers.semtech.com/knowledge-base/forum/viewthread/92/).

kbm15 commented 4 years ago

As long as you use:

StuartsProjects commented 4 years ago

I can confirm this, I can get the groundstation and simulator to communicate when both devices are SX126X, but not when the groundstation is a SX1278. Standard format syncwords work OK.

I did spot last week that 0x0FxF0 and 0xFF did not appear to match but its taken an age to prove it.

StuartsProjects commented 4 years ago

Has a syncword of 0x00 on the SX1278 groundstation been checked ?

Does not seem to work here.

kbm15 commented 4 years ago

Try with 0x12 instead @LoRaTracker

StuartsProjects commented 4 years ago

Nope, no joy with 0x12 on the SX1278 groundstaion and 0x0F0F on the SX1262 simulator.

0x12 on the SX1278 Groundstation does work when the SX1262 simulator is using 0x1424 (i.e. system default)

kbm15 commented 4 years ago

Then we can conclude it's not possible for sx127x stations to receive the Fossasat Tx. Thank you for testing it.

jgromes commented 4 years ago

Just tested all possible SX127x sync word values, none of them match with SX1268's 0x0F0F. My guess is that even the close match of 0x00 is not enough.

0x0F0F is indeed a bad choice of sync word for the satellite. It was originally supposed to be using SX1278, but that was switched to SX1268 because of the integrated TCXO support.

However, I would like to point out that none of this can be found anywhere in the datasheets. The only mention of LoRa syncword in SX1278 datasheet is that the value 0x34 is reserved for LoRaWAN networks - suggesting any other value is permitted and should be used when not sending data via LoRaWAN. SX1268 datasheet doesn't even contain the information that compatibility can be achieved with 0x1424/0x3444 sync words.

Will close this PR now and drop SX127x support from the ground station code for now. FOSSASAT-1 will only be decodable with an SX126x, until another one is launched with sync word set to 0x1424.

jgromes commented 4 years ago

I got limited success receiving SX1268 transmission with 0x0F0F sync using SX1278 with 0x11 sync. Works only in that one direction, and is not 100%, but it would mean ground stations can at least receive. CRC checks out too.

@kbm15 @LoRaTracker would it be possible for you guys to check?

kbm15 commented 4 years ago

That's why i suggested LoRaTracker to test 0x12, because it's possible to be successful some of the time. If the module has erratic behavior let's try words with best chance to decode. Anyway, it's kinda black magic now.