Skip to content

Waveshare SX1262 on RPi Zero 2 W on Bookworm 64bit OS (6.12.25) #32

@timiman

Description

@timiman

I'm trying to get 2 identical Zero 2 W's to communicate as node and gateway using their Waveshare SX1262 LoRa HAT.
I can understand that not Zero 2 W neither 64bit O/S is officially supported by LoRaRF, but I'm giving a try in case it is just a matter of "noone had tested yet" rather than "is a matter of software and/or hardware compatibility".

I have tried to use LoRaRF or Waveshare's "sample-code" but it a no go between them.
SPI and Serial are enabled, tried with various antennas (original and new ones) with different distance between them -over 3m, have tried to use different SFx, set the correct EU frequency. But still no message is transmitted and thus received.
I didn't find any related issue here with clear and confirmed solution with my setup and one issue's solution I've found has not worked for me.

With all tries mentioned below, the TxD led was blinking every second on both Zero 2 W.
I remembered 1,5 years ago, when I was testing both of them in bullseye O/S they were working just fine with Waveshare's example code and
the TxD led was blinking fast upon sending and receiving (RxD led).

I think that the communication issue has to do with the GPIO numbers used on both example codes above (LoRaRF's and Waveshare's),
because the sample code on the node, seems to get stuck on the line
LoRa.wait() and also the GPIO numbering has changed in Bookworm (also which library of gpio access should I use in python3 to get results?).

The node main function is:


while True :

    LoRa.beginPacket()

    LoRa.write(messageList, len(messageList))

    LoRa.write([counter], 1)

    LoRa.endPacket()

    if not LoRa.endPacket():
        print("Failed to send packet")

    print(f"{message}  {counter}")
    LoRa.wait()

    print("Transmit time: {0:0.2f} ms | Data rate: {1:0.2f} byte/s".format(LoRa.transmitTime(), LoRa.dataRate()))
    time.sleep(5)
    counter = (counter + 1) % 256

The busID/csID in use are:
busId = 0; csId = 0

And the GPIO number sets I have tried are:

resetPin = 21; busyPin = 20; irqPin = -1; txenPin = 5; rxenPin = -1   # old SX gateway
#resetPin = 17; busyPin = 24; irqPin = 25; txenPin = 6; rxenPin = -1  # waveshare's source
#resetPin = 22; busyPin = 24; irqPin = -1; txenPin = 5; rxenPin = 25  # waveshare's wiki

Finally, I do not know if the current Linux kernel I use (6.12.25) has break anything to have this issue.
Does anyone have any hints to follow to establish communication between my two Zero 2 Ws ?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions