From 06a70137da4c52aa6ff7e1f91b34de1062db2a75 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 13 Feb 2024 16:11:18 +1100 Subject: [PATCH] lora sx126x: Fix syncword setting. Closes #796. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton --- micropython/lora/lora-sx126x/lora/sx126x.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micropython/lora/lora-sx126x/lora/sx126x.py b/micropython/lora/lora-sx126x/lora/sx126x.py index f1aa5a871..ff0263d9d 100644 --- a/micropython/lora/lora-sx126x/lora/sx126x.py +++ b/micropython/lora/lora-sx126x/lora/sx126x.py @@ -386,7 +386,7 @@ def configure(self, lora_cfg): # see # https://www.thethingsnetwork.org/forum/t/should-private-lorawan-networks-use-a-different-sync-word/34496/15 syncword = 0x0404 + ((syncword & 0x0F) << 4) + ((syncword & 0xF0) << 8) - self._cmd(">BBH", _CMD_WRITE_REGISTER, _REG_LSYNCRH, syncword) + self._cmd(">BHH", _CMD_WRITE_REGISTER, _REG_LSYNCRH, syncword) if not self._configured or any( key in lora_cfg for key in ("output_power", "pa_ramp_us", "tx_ant")