Sorry for the late reply. Here is /opt/ttn-station/bin/start.sh
:
#!/bin/bash
# Reset iC880a PIN
SX1301_RESET_BCM_PIN=4
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
# Test the connection, wait if needed.
while [[ $(ping -c1 google.com 2>&1 | grep " 0% packet loss") == "" ]]; do
echo "[TTN Gateway]: Waiting for internet connection..."
sleep 30
done
# Start station
/opt/ttn-station/bin/station
So it’s basically a reset section (which I modified to use the pin number 4), a connection test and then it executes the station executable. Shouldn’t this executable be automatically replaced by the last one I built ?
EDIT: I’m sorry, I found the executable I built myself, replaced the original with it and ran with the debug option and I get the following log:
2022-10-20 03:59:31.320 [SYS:INFO] Station Ver : 2.0.6(rpi/debug) 2022-10-20 02:45:59
2022-10-20 03:59:31.320 [SYS:INFO] Package Ver : (null)
2022-10-20 03:59:31.320 [SYS:INFO] mbedTLS Ver : 2.28.0
2022-10-20 03:59:31.320 [SYS:INFO] proto EUI : 242:fdff:fec5:59b3 (station.conf)
2022-10-20 03:59:31.320 [SYS:INFO] prefix EUI : ::1 (builtin)
2022-10-20 03:59:31.320 [SYS:INFO] Station EUI : 242:fdff:fec5:59b3
2022-10-20 03:59:31.320 [SYS:INFO] Station home: ./ (builtin)
2022-10-20 03:59:31.320 [SYS:INFO] Station temp: /tmp/ (builtin)
2022-10-20 03:59:31.320 [SYS:WARN] Station in NO-CUPS mode
2022-10-20 03:59:31.521 [TCE:INFO] Starting TC engine
2022-10-20 03:59:31.686 [AIO:INFO] ./tc.trust:
cert. version : 3
serial number : 5E:C3:B7:A6:43:7F:A4:E0
issuer name : CN=ACCVRAIZ1, OU=PKIACCV, O=ACCV, C=ES
subject name : CN=ACCVRAIZ1, OU=PKIACCV, O=ACCV, C=ES
issued on : 2011-05-05 09:37:37
expires on : 2030-12-31 09:37:37
signed using : RSA with SHA1
RSA key size : 4096 bits
basic constraints : CA=true
subject alt name :
<unsupported>
key usage : Key Cert Sign, CRL Sign
certificate policies : An 2022-10-20 03:59:31.686 [TCE:INFO] Connecting to INFOS: wss://eu1.cloud.thethings.network:8887
2022-10-20 03:59:31.727 [AIO:XDEB] [3] ws_connecting state=1
2022-10-20 03:59:31.764 [AIO:XDEB] [3] ws_connecting state=1
2022-10-20 03:59:31.765 [AIO:XDEB] [3] ws_connecting state=1
2022-10-20 03:59:31.972 [AIO:XDEB] [3] ws_connecting state=1
2022-10-20 03:59:31.974 [AIO:XDEB] [3] ws_connecting state=1
2022-10-20 03:59:31.974 [AIO:XDEB] [3] ws_connecting state=2
2022-10-20 03:59:31.974 [AIO:XDEB] [3] socket write bytes=304
2022-10-20 03:59:32.012 [AIO:XDEB] [3] ws_connecting state=3
2022-10-20 03:59:32.012 [AIO:XDEB] [3] socket read bytes=129
2022-10-20 03:59:32.012 [AIO:XDEB] [3|WS] > {"router":"242:fdff:fec5:59b3"}
2022-10-20 03:59:32.012 [AIO:XDEB] [3] socket write bytes=37
2022-10-20 03:59:32.055 [AIO:XDEB] [3] socket read bytes=127
2022-10-20 03:59:32.055 [AIO:XDEB] [3|WS] < {"router":"242:fdff:fec5:59b3","muxs":"muxs-::0","uri":"wss://eu1.cloud.thethings.network:8887/traffic/eui-0242FDFFFEC559B3"}
2022-10-20 03:59:32.055 [TCE:INFO] Infos: 242:fdff:fec5:59b3 muxs-::0 wss://eu1.cloud.thethings.network:8887/traffic/eui-0242FDFFFEC559B3
2022-10-20 03:59:32.055 [AIO:DEBU] [3] ws_close reason=1000
2022-10-20 03:59:32.055 [AIO:ERRO] Recv failed: SSL - The peer notified us that the connection is going to be closed
2022-10-20 03:59:32.055 [AIO:DEBU] [3] WS connection shutdown...
2022-10-20 03:59:32.277 [AIO:INFO] ./tc.trust:
cert. version : 3
serial number : 5E:C3:B7:A6:43:7F:A4:E0
issuer name : CN=ACCVRAIZ1, OU=PKIACCV, O=ACCV, C=ES
subject name : CN=ACCVRAIZ1, OU=PKIACCV, O=ACCV, C=ES
issued on : 2011-05-05 09:37:37
expires on : 2030-12-31 09:37:37
signed using : RSA with SHA1
RSA key size : 4096 bits
basic constraints : CA=true
subject alt name :
<unsupported>
key usage : Key Cert Sign, CRL Sign
certificate policies : An 2022-10-20 03:59:32.278 [TCE:VERB] Connecting to MUXS...
2022-10-20 03:59:32.315 [AIO:XDEB] [3] ws_connecting state=1
2022-10-20 03:59:32.361 [AIO:XDEB] [3] ws_connecting state=1
2022-10-20 03:59:32.362 [AIO:XDEB] [3] ws_connecting state=1
2022-10-20 03:59:32.571 [AIO:XDEB] [3] ws_connecting state=1
2022-10-20 03:59:32.571 [AIO:XDEB] [3] ws_connecting state=2
2022-10-20 03:59:32.571 [AIO:XDEB] [3] socket write bytes=321
2022-10-20 03:59:32.622 [AIO:XDEB] [3] ws_connecting state=3
2022-10-20 03:59:32.622 [AIO:XDEB] [3] socket read bytes=129
2022-10-20 03:59:32.622 [TCE:VERB] Connected to MUXS.
2022-10-20 03:59:32.622 [AIO:XDEB] [3|WS] > {"msgtype":"version","station":"2.0.6(rpi/debug)","firmware":null,"package":null,"model":"rpi","protocol":2,"features":"rmtsh"}
2022-10-20 03:59:32.622 [AIO:XDEB] [3] socket write bytes=135
2022-10-20 03:59:32.660 [AIO:XDEB] [3] socket read bytes=1104
2022-10-20 03:59:32.660 [AIO:XDEB] [3|WS] < {"msgtype":"router_config","NetID":null,"JoinEui":null,"region":"EU863","hwspec":"sx1301/1","freq_range":[863000000,870000000],"DRs":[[12,125,0],[11,125,0],[10,125,0],[9,125,0],[8,125,0],[7,125,0],[7,250,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],"sx1301_conf":[{"radio_0":{"enable":true,"freq":867500000},"radio_1":{"enable":true,"freq":868500000},"chan_multiSF_0":{"enable":true,"radio":1,"if":-400000},"chan_multiSF_1":{"enabl
2022-10-20 03:59:32.660 [AIO:XDEB] [3|WS] . e":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":{"ena
2022-10-20 03:59:32.660 [AIO:XDEB] [3|WS] . ble":true,"radio":1,"if":300000,"datarate":50000}}],"nocca":true,"nodc":true,"nodwell":true,"MuxTime":1666598775.896436,"bcning":{"DR":3,"layout":[2,8,17],"freqs":[869525000]}}
2022-10-24 08:06:15.896 [HAL:XDEB] [lgw_soft_reset:596] ERROR: CONCENTRATOR UNCONNECTED
2022-10-24 08:06:15.896 [HAL:XDEB] [lgw_disconnect:585] WARNING: concentrator was already disconnected
2022-10-24 08:06:15.896 [RAL:INFO] Lora gateway library version: Version: 5.0.1;
2022-10-24 08:06:15.898 [RAL:INFO] [LGW lgw1] clksrc=1 lorawan_public=1
2022-10-24 08:06:15.898 [HAL:XDEB] [lgw_board_setconf:453] Note: board configuration; lorawan_public:1, clksrc:1
2022-10-24 08:06:15.898 [RAL:INFO] RX/TX RF0: 867.5MHz rssi_offset=-166.0 type=2 tx_notch_freq=0
2022-10-24 08:06:15.898 [HAL:XDEB] [lgw_rxrf_setconf:502] WARNING: NOT A VALID TX NOTCH FILTER FREQUENCY [126000..250000]Hz
2022-10-24 08:06:15.898 [HAL:XDEB] [lgw_rxrf_setconf:514] Note: rf_chain 0 configuration; en:1 freq:867500000 rssi_offset:-166.000000 radio_type:2 tx_enable:1 tx_notch_freq:0
2022-10-24 08:06:15.898 [RAL:INFO] RX RF1: 868.5MHz rssi_offset=-166.0 type=2 tx_notch_freq=0
2022-10-24 08:06:15.898 [HAL:XDEB] [lgw_rxrf_setconf:514] Note: rf_chain 1 configuration; en:1 freq:868500000 rssi_offset:-166.000000 radio_type:2 tx_enable:0 tx_notch_freq:0
2022-10-24 08:06:15.898 [RAL:INFO] [mSF] 0: 868.1MHz rf=1 freq=-400.0 datarate=0
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:633] Note: LoRa 'multi' if_chain 0 configuration; en:1 freq:-400000 SF_mask:0x7e
2022-10-24 08:06:15.899 [RAL:INFO] [mSF] 1: 868.3MHz rf=1 freq=-200.0 datarate=0
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:633] Note: LoRa 'multi' if_chain 1 configuration; en:1 freq:-200000 SF_mask:0x7e
2022-10-24 08:06:15.899 [RAL:INFO] [mSF] 2: 868.5MHz rf=1 freq= +0.0 datarate=0
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:633] Note: LoRa 'multi' if_chain 2 configuration; en:1 freq:0 SF_mask:0x7e
2022-10-24 08:06:15.899 [RAL:INFO] [mSF] 3: 867.1MHz rf=0 freq=-400.0 datarate=0
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:633] Note: LoRa 'multi' if_chain 3 configuration; en:1 freq:-400000 SF_mask:0x7e
2022-10-24 08:06:15.899 [RAL:INFO] [mSF] 4: 867.3MHz rf=0 freq=-200.0 datarate=0
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:633] Note: LoRa 'multi' if_chain 4 configuration; en:1 freq:-200000 SF_mask:0x7e
2022-10-24 08:06:15.899 [RAL:INFO] [mSF] 5: 867.5MHz rf=0 freq= +0.0 datarate=0
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:633] Note: LoRa 'multi' if_chain 5 configuration; en:1 freq:0 SF_mask:0x7e
2022-10-24 08:06:15.899 [RAL:INFO] [mSF] 6: 867.7MHz rf=0 freq=+200.0 datarate=0
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:633] Note: LoRa 'multi' if_chain 6 configuration; en:1 freq:200000 SF_mask:0x7e
2022-10-24 08:06:15.899 [RAL:INFO] [mSF] 7: 867.9MHz rf=0 freq=+400.0 datarate=0
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:633] Note: LoRa 'multi' if_chain 7 configuration; en:1 freq:400000 SF_mask:0x7e
2022-10-24 08:06:15.899 [RAL:INFO] [STD] 8: 868.3MHz rf=1 freq=-200.0 datarate=2 bw=2
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:607] Note: LoRa 'std' if_chain 8 configuration; en:1 freq:-200000 bw:2 dr:2
2022-10-24 08:06:15.899 [RAL:INFO] [FSK] 9: 868.8MHz rf=1 freq=+300.0 datarate=50000 bw=0 sync_word=0/0
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_rxif_setconf:663] Note: FSK if_chain 9 configuration; en:1 freq:300000 bw:2 dr:50000 (50000 real dr) sync:0x%0lX
2022-10-24 08:06:15.899 [RAL:INFO] SX130x LBT not enabled
2022-10-24 08:06:15.899 [RAL:INFO] Station device: /dev/spidev0.0 (PPS capture disabled)
2022-10-24 08:06:15.899 [HAL:INFO] [lgw_spi_open:101] Setting SPI speed to 8000000
2022-10-24 08:06:15.899 [HAL:INFO] [lgw_spi_open:135] Note: SPI port opened and configured ok
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_spi_r:258] Note: SPI read success
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_connect:534] INFO: no FPGA detected or version not supported (v0)
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_spi_r:258] Note: SPI read success
2022-10-24 08:06:15.899 [HAL:XDEB] [lgw_connect:557] ERROR: NOT EXPECTED CHIP VERSION (v0)
2022-10-24 08:06:15.899 [HAL:ERRO] [lgw_start:742] FAIL TO CONNECT BOARD
2022-10-24 08:06:15.899 [RAL:ERRO] Concentrator start failed: lgw_start
2022-10-24 08:06:15.899 [RAL:ERRO] ral_config failed with status 0x08
2022-10-24 08:06:15.899 [any:ERRO] Closing connection to muxs - error in s2e_onMsg
2022-10-24 08:06:15.899 [AIO:DEBU] [3] ws_close reason=1000
2022-10-24 08:06:15.899 [AIO:XDEB] [3] ws_closing_w state=5
2022-10-24 08:06:15.899 [AIO:DEBU] Echoing close - reason=1000
2022-10-24 08:06:15.900 [AIO:XDEB] [3] socket write bytes=8
2022-10-24 08:06:15.935 [AIO:XDEB] [3] socket read bytes=4
2022-10-24 08:06:15.935 [AIO:DEBU] [3|WS] Server sent close: reason=1000
2022-10-24 08:06:15.935 [AIO:DEBU] [3] WS connection shutdown...
2022-10-24 08:06:15.936 [TCE:VERB] Connection to MUXS closed in state -1
2022-10-24 08:06:15.936 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)
2022-10-24 08:25:30.870 [HAL:XDEB] [lgw_soft_reset:596] ERROR: CONCENTRATOR UNCONNECTED
2022-10-24 08:25:30.870 [HAL:INFO] [lgw_spi_close:159] Note: SPI port closed
2022-10-24 08:25:30.870 [HAL:XDEB] [lgw_disconnect:582] Note: success disconnecting the concentrator
and then it starts again, untill I ctrl+c.