Trouble with LoRaWAN Gateway Module WM1302 + WM1302 Pi Hat

Hey,
I’m new to the Seeed family and I’ve been facing some challenges setting up a simple gateway using the WM1302 module with 1302 Pi Hat on a Raspberry Pi 4B. I’ve been following the instructions on the official Wiki page (LoRaWAN® Gateway Module WM1302 | Seeed Studio Wiki),

but unfortunately, I can’t seem to get it to work properly.

Packet Forwarder ***
Version: 2.1.0
*** SX1302 HAL library version info ***
Version: 2.1.0


INFO: Little endian host
INFO: found configuration file global_conf.json.sx1250.EU868, parsing it
INFO: global_conf.json.sx1250.EU868 does contain a JSON object named SX130x_conf, parsing SX1302 parameters
INFO: com_type SPI, com_path /dev/spidev0.0, lorawan_public 1, clksrc 0, full_duplex 0
INFO: antenna_gain 0 dBi
INFO: Configuring legacy timestamp
INFO: Configuring Tx Gain LUT for rf_chain 0 with 16 indexes for sx1250
INFO: radio 0 enabled (type SX1250), center frequency 867500000, RSSI offset -215.399994, tx enabled 1, single input mode 0
INFO: radio 1 enabled (type SX1250), center frequency 868500000, RSSI offset -215.399994, tx enabled 0, single input mode 0
INFO: Lora multi-SF channel 0> radio 1, IF -400000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 1> radio 1, IF -200000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 2> radio 1, IF 0 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 3> radio 0, IF -400000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 4> radio 0, IF -200000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 5> radio 0, IF 0 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 6> radio 0, IF 200000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 7> radio 0, IF 400000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7, Explicit header
INFO: FSK channel> radio 1, IF 300000 Hz, 125000 Hz bw, 50000 bps datarate
INFO: global_conf.json.sx1250.EU868 does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to “the right one :)”
INFO: server hostname or IP address is configured to “eu1.cloud.thethings.network”
INFO: upstream port is configured to “1700”
INFO: downstream port is configured to “1700”
INFO: downstream keep-alive interval is configured to 10 seconds
INFO: statistics display interval is configured to 30 seconds
INFO: upstream PUSH_DATA time-out is configured to 100 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: GPS serial port path is configured to “/dev/ttyS0”
INFO: Reference latitude is configured to 0.000000 deg
INFO: Reference longitude is configured to 0.000000 deg
INFO: Reference altitude is configured to 0 meters
INFO: Beaconing period is configured to 0 seconds
INFO: Beaconing signal will be emitted at 869525000 Hz
INFO: Beaconing datarate is set to SF9
INFO: Beaconing modulation bandwidth is set to 125000Hz
INFO: Beaconing TX power is set to 14dBm
INFO: Beaconing information descriptor is set to 0
INFO: global_conf.json.sx1250.EU868 does contain a JSON object named debug_conf, parsing debug parameters
INFO: got 2 debug reference payload
INFO: reference payload ID 0 is 0xCAFE1234
INFO: reference payload ID 1 is 0xCAFE2345
INFO: setting debug log file name to loragw_hal.log
INFO: [main] TTY port /dev/ttyS0 open for GPS synchronization
./reset_lgw.sh: 26: echo: echo: I/O error
./reset_lgw.sh: 27: echo: echo: I/O error
./reset_lgw.sh: 28: echo: echo: I/O error
./reset_lgw.sh: 29: echo: echo: I/O error
./reset_lgw.sh: 32: cannot create /sys/class/gpio/gpio17/direction: Directory nonexistent
./reset_lgw.sh: 33: cannot create /sys/class/gpio/gpio5/direction: Directory nonexistent
./reset_lgw.sh: 34: cannot create /sys/class/gpio/gpio18/direction: Directory nonexistent
./reset_lgw.sh: 35: cannot create /sys/class/gpio/gpio13/direction: Directory nonexistent
CoreCell reset through GPIO17…
SX1261 reset through GPIO17…
CoreCell power enable through GPIO18…
CoreCell ADC reset through GPIO13…
./reset_lgw.sh: 45: cannot create /sys/class/gpio/gpio18/value: Directory nonexistent
./reset_lgw.sh: 47: cannot create /sys/class/gpio/gpio17/value: Directory nonexistent
./reset_lgw.sh: 48: cannot create /sys/class/gpio/gpio17/value: Directory nonexistent
./reset_lgw.sh: 50: cannot create /sys/class/gpio/gpio5/value: Directory nonexistent
./reset_lgw.sh: 51: cannot create /sys/class/gpio/gpio5/value: Directory nonexistent
./reset_lgw.sh: 53: cannot create /sys/class/gpio/gpio13/value: Directory nonexistent
./reset_lgw.sh: 54: cannot create /sys/class/gpio/gpio13/value: Directory nonexistent
Opening SPI communication interface
Note: chip version is 0x05 (v0.5)
ERROR: Failed to set SX1250_0 in STANDBY_RC mode
ERROR: failed to setup radio 0
ERROR: [main] failed to start the concentrator

Following the instructions in the wiki, I enabled both SPI and I2C. Additionally, I changed the SX1302_RESET_PIN from 23 to 17 and the SX1261_RESET_PIN from 22 to 5.

I found that others faced the same issue in 2022, but I couldn’t find a solution for it. Hopefully, someone out there might be able to assist me.

Thank you in advance!

I had the same issue. I believe it it something to do with echoing out pins. After so searching around and chatGPT help I found that changing the way the resent pins get set is what fixed it for me (avoid echoing).

This is my reset_lgw.sh code:
(I am using WM1302/SX1302 so no need for the SX1261 reset lines)

  GNU nano 7.2                                                                                                                                                                        
# Usage examples:
#       ./reset_lgw.sh stop
#       ./reset_lgw.sh start
# GPIO mapping has to be adapted with HW
#

SX1302_RESET_PIN=17
SX1302_POWER_EN_PIN=18

reset() {
   echo "CoreCell reset through GPIO$SX1302_RESET_PIN..."
    
     gpioset gpiochip0 $SX1302_RESET_PIN=1
     sleep 0.1
     gpioset gpiochip0 $SX1302_RESET_PIN=0
     sleep 0.1

}

term() {
   # "unexport" (set back to "input" by reading its value)
   gpioget gpiochip0 $SX1302_RESET_PIN
}

case "$1" in
    start)
    term # just in case
    reset
    ;;
    stop)
    reset
    term
    ;;
    *)
    echo "Usage: $0 {start|stop}"
    exit 1
    ;;
esac

exit 0