Closed oeysteinhansen closed 7 months ago
@oeysteinhansen Thanks for the very clear bug report! I've got a fix for this ready now, exactly along the lines you suggested.
Thank you for your quick response. Had a look at the #804 committed code. Looks correct. I will update when a version with the fixes is available.
The driver has the option to set the SyncWord via its configure() command (also via driver init), in the option "syncword". Most of the code is correct but when writing the syncword value to the SX126x device registry, it writes to a wrong registry because of a code issue.
Package: lora-sx126x MicroPython: MicroPython v1.22.1 on 2024-01-05; Generic ESP32S3 module with ESP32S3 Board: Heltec LoRa 32 v3
code file: micropython-lib/micropython/lora/lora-sx126x/lora/sx126x.py code line: 386 code current:
self._cmd(">BBH", _CMD_WRITE_REGISTER, _REG_LSYNCRH, syncword)
code fixed:self._cmd(">BHH", _CMD_WRITE_REGISTER, _REG_LSYNCRH, syncword)
code note: Changing the data packing format from">BBH"
to">BHH"
so the full 16bit registry address is used.I have tested the change with creating a separate function (as i have not been able to edit the library code)
Tested by receiving messages from Meshtastic v2 devices witch use the syncword 0x2B.