pythonraspberry-piraspberry-pi-picolora

LoRa communication between RPI and PICO with Waveshare hats


I'm trying to make a Raspberry PICO with the Waveshare SX1262 LoRa hat to send LoRa messages to a Raspberry Pi also using a Waveshare sx1262 LoRa Hat.

The radio configuration is different in both devices and I'm unable to see any message sent by the PICO in the RPI.

Communication between 2 PICOs work, and also between 2 RPI using LoRa protocol, but not between different devices.

Initialisation options are very different and I'm wondering which options I should use...

Raspberry PICO configuration (using https://github.com/ehong-tl/micropySX126X code)

sx.begin(freq=923, bw=500.0, sf=12, cr=8, syncWord=0x12,
     power=-5, currentLimit=60.0, preambleLength=8,
     implicit=False, implicitLen=0xFF,
     crcOn=True, txIq=False, rxIq=False,
     tcxoVoltage=1.7, useRegulatorLDO=False, blocking=True)

Raspberry Pi configuration (using https://www.waveshare.net/w/upload/6/68/SX126X_LoRa_HAT_Code.zip code)

node = sx126x.sx126x(serial_num = "/dev/ttyS0",freq=923,addr=101,power=22,rssi=True)
AIR_SPEED = 2400
PACKAGE_SIZE = 240 Bytes

Even though the chip is the same, the way to configure them is very different.

Any idea on how to make the 2 devices communicate?

Thanks in advance!


Solution

  • That's because the RPi firmware is weird and the Ebyte E22 chip is even weirder. These managed chips they've been churning out are not sending LoRa packets, and are incompatible with regular LoRa modules.

    Look at the initialization code:

    node = sx126x.sx126x(serial_num = "/dev/ttyS0", freq=868, addr=0, power=22, rssi=True, air_speed=2400, relay=False)
    

    The air_speed=2400 parameter is definitely not a LoRa parameter (and on the other hand LoRa SF and BW parameters are absent), because the chip is in FSK/OOK mode, instead of LoRa mode. It's the RegBitrateMsb/RegBitrateLsb registers, 0x02/0x03. So the RPi hat can definitely not communicate with a normal LoRa module, unless you bypass the UART management, and rewire it for SPI.