RAK833: failed to start the concentrator

Hello

I have currently the issue that the packet-forwarder won’t start.

This is my setup

Raspberry Pi Zero 2W
OS: Raspberry Pi OS Lite- Bookworm 64bit

LoRa Gateway
Brand: PiSupply
Model: RAK833 SPI
Chip: SX1301
Reset Pin: GPIO22

Initial configuration
SPI enabled
I2C enabled
Serial login shell disabled
Serial port hardware enabled

Description
My gateway has already worked before. I have not used it for a while and wanted to upgrade today to the Bookworm debian version (respectively the Rasperry Pi OS - Bookworm version). I did a fresh install to have everything clean.

Unfortunately, I run now into the error:

ERROR: [main] failed to start the concentrator

I followed the installation and configuration instructions from the manufacturer’s git repository:

I believe, the issue is, that the start script can’t toggle the reset pin, because of this error: “kernel: export_store: invalid GPIO 22”

I tried also to do it manually with following commands:

SX1301_RESET_BCM_PIN=22
echo "$SX1301_RESET_BCM_PIN"  > /sys/class/gpio/export

This leads to following error message:
echo: write error: invalid argument

Also the the output of the ./start.sh script with error messages like
/sys/class/gpio/gpio22/direction: No such file or directory are maybe pointing to an issue with the GPIO pins?

Now I’m not sure what the reason of the issue could be.
It looks to me like somehow the GPIO pin can’t be accessed?
On the other hand, the Gateway and Raspberry were for a few months outside on my balcony.
The place is protected from rain, but maybe humidity etc. could be damaged the Gateway module?

Also the LED’s on the Gateway module doesn’t light up.
I think there is a red LED which is illuminated as soon as the gateway is configured correctly.

Maybe someone has an idea, what I can check or test to find out the exact issue?
Help is much apprechiated. Thanks.

This are my configuration files:

start.sh

#! /bin/bash

Reset iC880a PIN

SX1301_RESET_BCM_PIN=22
echo “$SX1301_RESET_BCM_PIN” > /sys/class/gpio/export
echo “out” > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/direction
echo “0” > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value
sleep 0.1
echo “1” > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value
sleep 0.1
echo “0” > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value
sleep 0.1
echo “$SX1301_RESET_BCM_PIN” > /sys/class/gpio/unexport
./set_eui.sh
sleep 0.2
#./update_gwid.sh ./local_conf.json
sleep 0.5
./lora_pkt_fwd

global_conf.json

{
“SX1301_conf”: {
“lorawan_public”: true,
“clksrc”: 1,
“antenna_gain”: 0,
“radio_0”: {
“enable”: true,
“type”: “SX1257”,
“freq”: 867500000,
“rssi_offset”: -158.0,
“tx_enable”: true,
“tx_freq_min”: 863000000,
“tx_freq_max”: 870000000
},
“radio_1”: {
“enable”: true,
“type”: “SX1257”,
“freq”: 868500000,
“rssi_offset”: -158.0,
“tx_enable”: false
},
“chan_multiSF_0”: {
“enable”: true,
“radio”: 1,
“if”: -400000
},
“chan_multiSF_1”: {
“enable”: true,
“radio”: 1,
“if”: -200000
},
“chan_multiSF_2”: {
“enable”: true,
“radio”: 1,
“if”: 0
},
“chan_multiSF_3”: {
“enable”: true,
“radio”: 0,
“if”: -400000
},
“chan_multiSF_4”: {
“enable”: true,
“radio”: 0,
“if”: -200000
},
“chan_multiSF_5”: {
“enable”: true,
“radio”: 0,
“if”: 0
},
“chan_multiSF_6”: {
“enable”: true,
“radio”: 0,
“if”: 200000
},
“chan_multiSF_7”: {
“enable”: true,
“radio”: 0,
“if”: 400000
},
“chan_Lora_std”: {
“enable”: true,
“radio”: 1,
“if”: -200000,
“bandwidth”: 250000,
“spread_factor”: 7
},
“chan_FSK”: {
“enable”: true,
“radio”: 1,
“if”: 300000,
“bandwidth”: 125000,
“datarate”: 50000
},
“tx_lut_0”: {
“pa_gain”: 0,
“mix_gain”: 10,
“rf_power”: -6,
“dig_gain”: 0
},
“tx_lut_1”: {
“pa_gain”: 0,
“mix_gain”: 14,
“rf_power”: -3,
“dig_gain”: 0
},
“tx_lut_2”: {
“pa_gain”: 1,
“mix_gain”: 8,
“rf_power”: 0,
“dig_gain”: 3
},
“tx_lut_3”: {
“pa_gain”: 2,
“mix_gain”: 9,
“rf_power”: 3,
“dig_gain”: 3
},
“tx_lut_4”: {
“pa_gain”: 1,
“mix_gain”: 9,
“rf_power”: 6,
“dig_gain”: 1
},
“tx_lut_5”: {
“pa_gain”: 2,
“mix_gain”: 9,
“rf_power”: 10,
“dig_gain”: 0
},
“tx_lut_6”: {
“pa_gain”: 2,
“mix_gain”: 10,
“rf_power”: 11,
“dig_gain”: 0
},
“tx_lut_7”: {
“pa_gain”: 2,
“mix_gain”: 11,
“rf_power”: 12,
“dig_gain”: 0
},
“tx_lut_8”: {
“pa_gain”: 2,
“mix_gain”: 12,
“rf_power”: 13,
“dig_gain”: 1
},
“tx_lut_9”: {
“pa_gain”: 2,
“mix_gain”: 12,
“rf_power”: 14,
“dig_gain”: 0
},
“tx_lut_10”: {
“pa_gain”: 3,
“mix_gain”: 8,
“rf_power”: 16,
“dig_gain”: 1
},
“tx_lut_11”: {
“pa_gain”: 3,
“mix_gain”: 10,
“rf_power”: 20,
“dig_gain”: 0
},
“tx_lut_12”: {
“desc”: “TX gain table, index 12”,
“pa_gain”: 3,
“mix_gain”: 12,
“rf_power”: 23,
“dig_gain”: 0
},
“tx_lut_13”: {
“desc”: “TX gain table, index 13”,
“pa_gain”: 3,
“mix_gain”: 14,
“rf_power”: 25,
“dig_gain”: 0
},
“tx_lut_14”: {
“desc”: “TX gain table, index 14”,
“pa_gain”: 3,
“mix_gain”: 14,
“rf_power”: 26,
“dig_gain”: 0
},
“tx_lut_15”: {
“desc”: “TX gain table, index 15”,
“pa_gain”: 3,
“mix_gain”: 14,
“rf_power”: 27,
“dig_gain”: 0
}
},
“gateway_conf”: {
“gateway_ID”: “”,
/* change with default server address/ports, or overwrite in local_conf.json /
“server_address”: “eu1.cloud.thethings.network”,
“serv_port_up”: 1700,
“serv_port_down”: 1700,
/
adjust the following parameters for your network /
“keepalive_interval”: 10,
“stat_interval”: 30,
“push_timeout_ms”: 100,
/
forward only valid packets */
“forward_crc_valid”: true,
“forward_crc_error”: false,
“forward_crc_disabled”: false,
“fake_gps”: false,
“ref_latitude”: 10,
“ref_longitude”: 20,
“ref_altitude”: -1,
“autoquit_threshold”: 20
}
}

And here is my logfile

journalctl log

Apr 13 00:49:21 rak-gateway systemd[1]: ttn-gateway.service: Main process exited, code=exited, status=1/FAILURE
Apr 13 00:49:21 rak-gateway systemd[1]: ttn-gateway.service: Failed with result ‘exit-code’.
Apr 13 00:49:22 rak-gateway chirpstack-network-server[671]: time=“2024-04-13T00:49:22Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_ns"”
Apr 13 00:49:22 rak-gateway chirpstack-application-server[658]: time=“2024-04-13T00:49:22Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_as"”
Apr 13 00:49:25 rak-gateway chirpstack-network-server[671]: time=“2024-04-13T00:49:25Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_ns"”
Apr 13 00:49:25 rak-gateway chirpstack-application-server[658]: time=“2024-04-13T00:49:25Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_as"”
Apr 13 00:49:26 rak-gateway systemd[1]: ttn-gateway.service: Scheduled restart job, restart counter is at 86.
Apr 13 00:49:26 rak-gateway systemd[1]: Stopped ttn-gateway.service - The Things Network Gateway.
Apr 13 00:49:26 rak-gateway systemd[1]: Started ttn-gateway.service - The Things Network Gateway.
Apr 13 00:49:26 rak-gateway ttn-gateway[2325]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 6: echo: write error: Invalid argument
Apr 13 00:49:26 rak-gateway kernel: export_store: invalid GPIO 22
Apr 13 00:49:26 rak-gateway ttn-gateway[2325]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 7: /sys/class/gpio/gpio22/direction: No such file or directory
Apr 13 00:49:26 rak-gateway ttn-gateway[2325]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 8: /sys/class/gpio/gpio22/value: No such file or directory
Apr 13 00:49:26 rak-gateway ttn-gateway[2325]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 10: /sys/class/gpio/gpio22/value: No such file or directory
Apr 13 00:49:27 rak-gateway ttn-gateway[2325]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 12: /sys/class/gpio/gpio22/value: No such file or directory
Apr 13 00:49:27 rak-gateway ttn-gateway[2325]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 14: echo: write error: Invalid argument
Apr 13 00:49:27 rak-gateway kernel: unexport_store: invalid GPIO 22
Apr 13 00:49:27 rak-gateway chirpstack-network-server[671]: time=“2024-04-13T00:49:27Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_ns"”
Apr 13 00:49:27 rak-gateway chirpstack-application-server[658]: time=“2024-04-13T00:49:27Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_as"”
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: *** Beacon Packet Forwarder for Lora Gateway ***
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: Version: 4.0.1
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: *** Lora concentrator HAL library version info ***
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: Version: 5.0.1;
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: ***
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Little endian host
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: found global configuration file global_conf.json, parsing it
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: global_conf.json does contain a JSON object named SX1301_conf, parsing SX1301 parameters
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: lorawan_public 1, clksrc 1
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: no configuration for LBT
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: antenna_gain 0 dBi
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Configuring TX LUT with 16 indexes
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -158.000000, tx enabled 1, tx_notch_freq 0
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -158.000000, tx enabled 0, tx_notch_freq 0
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Lora multi-SF channel 0> radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Lora multi-SF channel 1> radio 1, IF -200000 Hz, 125 kHz bw, SF 7 to 12
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Lora multi-SF channel 2> radio 1, IF 0 Hz, 125 kHz bw, SF 7 to 12
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Lora multi-SF channel 3> radio 0, IF -400000 Hz, 125 kHz bw, SF 7 to 12
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Lora multi-SF channel 4> radio 0, IF -200000 Hz, 125 kHz bw, SF 7 to 12
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Lora multi-SF channel 5> radio 0, IF 0 Hz, 125 kHz bw, SF 7 to 12
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Lora multi-SF channel 6> radio 0, IF 200000 Hz, 125 kHz bw, SF 7 to 12
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Lora multi-SF channel 7> radio 0, IF 400000 Hz, 125 kHz bw, SF 7 to 12
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: FSK channel> radio 1, IF 300000 Hz, 125000 Hz bw, 50000 bps datarate
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: gateway MAC address is configured to E45F01FFFE7E957D
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: server hostname or IP address is configured to “eu1.cloud.thethings.network”
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: upstream port is configured to “1700”
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: downstream port is configured to “1700”
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: downstream keep-alive interval is configured to 10 seconds
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: statistics display interval is configured to 30 seconds
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: upstream PUSH_DATA time-out is configured to 100 ms
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: packets received with a valid CRC will be forwarded
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: packets received with a CRC error will NOT be forwarded
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: packets received with no CRC will NOT be forwarded
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Reference latitude is configured to 10.000000 deg
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Reference longitude is configured to 20.000000 deg
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Reference altitude is configured to -1 meters
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: fake GPS is disabled
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: Auto-quit after 20 non-acknowledged PULL_DATA
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: found local configuration file local_conf.json, parsing it
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: redefined parameters will overwrite global parameters
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: local_conf.json does not contain a JSON object named SX1301_conf
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: local_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: gateway MAC address is configured to E45F01FFFE7E957D
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: packets received with a valid CRC will be forwarded
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: packets received with a CRC error will NOT be forwarded
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: INFO: packets received with no CRC will NOT be forwarded
Apr 13 00:49:28 rak-gateway ttn-gateway[2334]: ERROR: [main] failed to start the concentrator
Apr 13 00:49:28 rak-gateway systemd[1]: ttn-gateway.service: Main process exited, code=exited, status=1/FAILURE
Apr 13 00:49:28 rak-gateway systemd[1]: ttn-gateway.service: Failed with result ‘exit-code’.
Apr 13 00:49:29 rak-gateway chirpstack-network-server[671]: time=“2024-04-13T00:49:29Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_ns"”
Apr 13 00:49:29 rak-gateway chirpstack-application-server[658]: time=“2024-04-13T00:49:29Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_as"”
Apr 13 00:49:31 rak-gateway chirpstack-network-server[671]: time=“2024-04-13T00:49:31Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_ns"”
Apr 13 00:49:31 rak-gateway chirpstack-application-server[658]: time=“2024-04-13T00:49:31Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_as"”
Apr 13 00:49:33 rak-gateway systemd[1]: ttn-gateway.service: Scheduled restart job, restart counter is at 87.
Apr 13 00:49:33 rak-gateway systemd[1]: Stopped ttn-gateway.service - The Things Network Gateway.
Apr 13 00:49:33 rak-gateway systemd[1]: Started ttn-gateway.service - The Things Network Gateway.
Apr 13 00:49:33 rak-gateway chirpstack-network-server[671]: time=“2024-04-13T00:49:33Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_ns"”
Apr 13 00:49:33 rak-gateway ttn-gateway[2342]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 6: echo: write error: Invalid argument
Apr 13 00:49:33 rak-gateway ttn-gateway[2342]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 7: /sys/class/gpio/gpio22/direction: No such file or directory
Apr 13 00:49:33 rak-gateway kernel: export_store: invalid GPIO 22
Apr 13 00:49:33 rak-gateway chirpstack-application-server[658]: time=“2024-04-13T00:49:33Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user "chirpstack_as"”
Apr 13 00:49:33 rak-gateway ttn-gateway[2342]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 8: /sys/class/gpio/gpio22/value: No such file or directory
Apr 13 00:49:33 rak-gateway ttn-gateway[2342]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 10: /sys/class/gpio/gpio22/value: No such file or directory
Apr 13 00:49:33 rak-gateway ttn-gateway[2342]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 12: /sys/class/gpio/gpio22/value: No such file or directory
Apr 13 00:49:33 rak-gateway ttn-gateway[2342]: /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 14: echo: write error: Invalid argument
Apr 13 00:49:33 rak-gateway kernel: unexport_store: invalid GPIO 22

This is the output when I start ./start.sh

Output from start.sh

root at rak-gateway in /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd on master✘✘✘
╰─± ./start.sh
./start.sh: line 6: echo: write error: Invalid argument
./start.sh: line 7: /sys/class/gpio/gpio22/direction: No such file or directory
./start.sh: line 8: /sys/class/gpio/gpio22/value: No such file or directory
./start.sh: line 10: /sys/class/gpio/gpio22/value: No such file or directory
./start.sh: line 12: /sys/class/gpio/gpio22/value: No such file or directory
./start.sh: line 14: echo: write error: Invalid argument
*** Beacon Packet Forwarder for Lora Gateway ***
Version: 4.0.1
*** Lora concentrator HAL library version info ***
Version: 5.0.1;


INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
INFO: global_conf.json does contain a JSON object named SX1301_conf, parsing SX1301 parameters
INFO: lorawan_public 1, clksrc 1
INFO: no configuration for LBT
INFO: antenna_gain 0 dBi
INFO: Configuring TX LUT with 16 indexes
INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -158.000000, tx enabled 1, tx_notch_freq 0
INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -158.000000, tx enabled 0, tx_notch_freq 0
INFO: Lora multi-SF channel 0> radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 1> radio 1, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 2> radio 1, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 3> radio 0, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 4> radio 0, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 5> radio 0, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 6> radio 0, IF 200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 7> radio 0, IF 400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7
INFO: FSK channel> radio 1, IF 300000 Hz, 125000 Hz bw, 50000 bps datarate
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to E45F01FFFE7E957D
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: Reference latitude is configured to 10.000000 deg
INFO: Reference longitude is configured to 20.000000 deg
INFO: Reference altitude is configured to -1 meters
INFO: fake GPS is disabled
INFO: Auto-quit after 20 non-acknowledged PULL_DATA
INFO: found local configuration file local_conf.json, parsing it
INFO: redefined parameters will overwrite global parameters
INFO: local_conf.json does not contain a JSON object named SX1301_conf
INFO: local_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to E45F01FFFE7E957D
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
ERROR: [main] failed to start the concentrator

I have a short update.

I have uninstalled all the software from the manufacturer “Pi Supply” and cloned this git repository instead :
https://github.com/Lora-net/packet_forwarder.

Initially I had the same error ERROR: [main] failed to start the concentrator. But then suddenly the gateway has become alive. Blue LED from RX line is illuminated.

I’ve tested a bit further around and the behavior is like this.
I repeat relative shortly one try after another the command ./lora_pkt_fwd. Most of the time it stops with the error. But about every tenth attempt works.

Maybe someone has an idea what could be the issue?

Uopdate 2
Now after a reboot the gateway is dead again.
Maybe a connection issue? Although it is a hat. So no cables which could be loose. Or it is just dead?

Have you considered using the manufacturers installer for their product?

@SimonBoonstra Trying random power or start up cyles you might get lucky and find device (SX1301 on Conc card) gets a reset, but as you found that is not consistent/repeatable. Suspect you have wrong GPIO assigned for reset (I need to reread docs), from memory I think RAK reasonably consistent on BCOM pin 17? (atleast for that gen of Cards) - check your start or pkt frwdr script. (1st place to check would be to “sudo nano start.sh” (not sure where your installer has dropped it but usually in /opt or a directory under there) and look in there/edit!), again from memory think it is declared around lines 8-15?)

Hi, Yes sure. I had also started with the manufacturers installer. But it didn’t worked for me. Then I remembered. Before the issue came which I have currently, I had to switch also in the very first installation to the https://github.com/Lora-net/packet_forwarder repository. This worked then.

I didn’t further investigate more, why the manufacturers installer didn’t worked for my, because I was already happy, as it run already with the other repository just fine.

Until now, with the new issue.

Hi, according to manufacturer’s install instruction, I need to change in my start.sh file the reset pin
from

SX1301_RESET_BCM_PIN=17

to

SX1301_RESET_BCM_PIN=22

It is writen exactly like this in the installation instructions. I see also here in the hardware documentation that the reset pin is board pin 15 which corresponds with the BCM Pin 22, if I’m not completely mistaken.

However, I gave now one more try to stick with the manufacturers installation file, respectievely repository. The installer places files in /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd and in /opt/ttn-gateway/lora_gateway.

When I execute /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh The error is, that the folder /sys/class/gpio/gpio22 and subdirectories are missing, according the details from Output from start.sh.

Output from start.sh

/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 6: echo: write error: Invalid argument
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 7: /sys/class/gpio/gpio22/direction: No such file or directory
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 8: /sys/class/gpio/gpio22/value: No such file or directory
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 10: /sys/class/gpio/gpio22/value: No such file or directory
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 12: /sys/class/gpio/gpio22/value: No such file or directory
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh: line 14: echo: write error: Invalid argument
*** Beacon Packet Forwarder for Lora Gateway ***
Version: 4.0.1
*** Lora concentrator HAL library version info ***
Version: 5.0.1;


INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
INFO: global_conf.json does contain a JSON object named SX1301_conf, parsing SX1301 parameters
INFO: lorawan_public 1, clksrc 1
INFO: no configuration for LBT
INFO: antenna_gain 0 dBi
INFO: Configuring TX LUT with 16 indexes
INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -158.000000, tx enabled 1, tx_notch_freq 0
INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -158.000000, tx enabled 0, tx_notch_freq 0
INFO: Lora multi-SF channel 0> radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 1> radio 1, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 2> radio 1, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 3> radio 0, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 4> radio 0, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 5> radio 0, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 6> radio 0, IF 200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 7> radio 0, IF 400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7
INFO: FSK channel> radio 1, IF 300000 Hz, 125000 Hz bw, 50000 bps datarate
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to 0000000000000000
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: Reference latitude is configured to 10.000000 deg
INFO: Reference longitude is configured to 20.000000 deg
INFO: Reference altitude is configured to -1 meters
INFO: fake GPS is disabled
INFO: Auto-quit after 20 non-acknowledged PULL_DATA
INFO: found local configuration file local_conf.json, parsing it
INFO: redefined parameters will overwrite global parameters
INFO: local_conf.json does not contain a JSON object named SX1301_conf
INFO: local_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to
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
ERROR: [main] failed to start the concentrator

This is, how my /sys/class/gpio folder looks

Octal Permissions Size User Group Date Modified Name
0220  .-w--w----  4.1k root gpio  14 Apr 00:23  export
0777  lrwxrwxrwx     0 root gpio  13 Apr 23:43  gpiochip512 -> ../../devices/platform/soc/3f200000.gpio/gpio/gpiochip512/
0220  .-w--w----  4.1k root gpio  14 Apr 00:23  unexport
╭─root at rak-gateway in /sys/class/gpio

If someone have an Idea, what could be the reason that I don’t have the mentioned folder structure, would be much apprechiated, as I’m out of any idea right now.

Since I don’t know, how to solve the problem with the GPIO pins and the non-existent folder(s), I have developed a workaround. I switch the reset GPIO pin from high to low, ten times in a row with a python script. Then I immediately start the packet forwarder. This approach works roughly at 60% of cases.
If it doesn’t work with the first try, then it will most likely work the next time I’ll try. And in very rare cases, I need three attempts.

But it would of course still be nice if the original problem could be solved, if anyone has an idea.

Command used: python /root/gpio_toggle.py && ./lora_pkt_fwd.
Here is the corresponding Python script:

import RPi.GPIO as GPIO
import time

# Set the pin mode to BCM
GPIO.setmode(GPIO.BCM)

# Set pin 22 as output
GPIO.setup(22, GPIO.OUT)

# Turn the pin on and off 10 times
for i in range(10):
    GPIO.output(22, GPIO.HIGH) # Turn the pin on
    time.sleep(0.1) # Wait for 0.1 seconds
    GPIO.output(22, GPIO.LOW) # Turn the pin off
    time.sleep(0.1) # Wait for 0.1 seconds

# Clean up and exit GPIO
GPIO.cleanup()

The installers will have been created against prior releases of Raspberry Pi OS so if you have another SD Card you could try stepping back to something like Buster.

I’d try my RAK833 but it’s disappeared under the rumble I call shelves.

Have you made any enquiries on the RAK forum?

Dont have the docs immediately in front of me and working from memory (dangerous I know!), it will depend on the HAT or other interface you are using…and how that maps the mPCIe card physical pin out (correctly called out as physical pin 22) to actual Broadcom GPIO logical pinout. (which is what the s/w considers). You might just check all the mappings and satisfy that way :wink: I know a lot of later gen (SX1302&1303) mPCIe cards use Pin 22 (from memory SEEED, Mimic, Elecrow, Waveshare…)

Your link above doesnt help me check as circular to your own post above :wink: Just logged into some of my other RAK SX1301 GW’s and can see BCM Pin 17 called out in start.sh hence my suggestion, but you need to check, later RAK units switched form 8xx numbering (831, 832, 833 - SX1301/8 based) to (2xxx, 7xxx based - SX1302/3) so that may be when reset pin/assignment changed, along with the mCPIe format shift? Just make sure s/w build is for the platform you are using.

:thinking: BTW you could always just try the alternate pin options - no harm done if wrong!

Bookworm OS which uses 6.6 no longer supports echo to write to the GPIO pins. This has been replaced with pinctrl command. Updating the the reset() function in the reset_lgw.sh helped me address these issues.

reset() {
    echo "CoreCell reset through GPIO$SX1302_RESET_PIN..."
    echo "SX1261 reset through GPIO$SX1302_RESET_PIN..."
    echo "CoreCell power enable through GPIO$SX1302_POWER_EN_PIN..."
    echo "CoreCell ADC reset through GPIO$AD5338R_RESET_PIN..."

    # write output for SX1302 CoreCell power_enable and reset
	pinctrl set $SX1302_RESET_PIN op; WAIT_GPIO
	pinctrl set $SX1302_RESET_PIN op dh; WAIT_GPIO
	pinctrl set $SX1302_RESET_PIN op dl; WAIT_GPIO

    	pinctrl set $SX1261_RESET_PIN op; WAIT_GPIO
	pinctrl set $SX1261_RESET_PIN op dl; WAIT_GPIO
	pinctrl set $SX1261_RESET_PIN op dh; WAIT_GPIO

}

~/sx1302_hal/tools $ ../util_chip_id/chip_id
CoreCell reset through GPIO17...
SX1261 reset through GPIO17...
CoreCell power enable through GPIO18...
CoreCell ADC reset through GPIO13...
Opening SPI communication interface
Note: chip version is 0x10 (v1.0)
INFO: using legacy timestamp
ARB: dual demodulation disabled for all SF
INFO: no temperature sensor found on port 0x39
INFO: no temperature sensor found on port 0x3B
INFO: no temperature sensor found on port 0x38
ERROR: no temperature sensor found.

INFO: concentrator EUI: 0x0016c00000000251

Closing SPI communication interface
ERROR: failed to close I2C temperature sensor device (err=-1)
ERROR: failed to stop the gateway

I had disabled temperature check but this doesn’t block me anymore from getting the Concentrator EUI number.