mpous / basicstation

LoRa Basics™ Station - The LoRaWAN Gateway Software
https://doc.sm.tc/station
60 stars 30 forks source link

PiHAT with RAK2247 - TTS v3 #23

Closed eihnat closed 3 years ago

eihnat commented 3 years ago

Hi,

I'm using PiHAT with RAK2247, when I setup TTNv2, everything seems to be working fine, in console I can see gateway connected.

When I changed to v3 and setup gw in TTS console, it seems to be connecting, but only for short time and then disconnects. Status of gateway is also disconnected. In webconsole (live activity) I can see:

15:17:35
Disconnect gateway
network_check
15:17:35
Forward gateway status

Versions
    firmware"1.0.0"package"1.0.0"platform"rpi - Firmware 1.0.0 - Protocol 2"station"2.0.5(rpi/std)"

network_check
15:17:35
Forward gateway status

Versions
    firmware"1.0.0"package"1.0.0"platform"rpi - Firmware 1.0.0 - Protocol 2"station"2.0.5(rpi/std)"

network_check
15:17:35
Receive gateway status

Versions
    firmware"1.0.0"package"1.0.0"platform"rpi - Firmware 1.0.0 - Protocol 2"station"2.0.5(rpi/std)"

flash_on
15:17:35
Connect gateway

Is this normal behavior?

When checking logs on balena:

26.04.21 15:18:28 (+0200) <main> 2021-04-26 13:18:28.721 [any:INFO] ./tc.trust: 

26.04.21 15:18:28 (+0200) <main> cert. version     : 3

26.04.21 15:18:28 (+0200) <main> serial number     : 44:AF:B0:80:D6:A3:27:BA:89:30:39:86:2E:F8:40:6B

26.04.21 15:18:28 (+0200) <main> issuer name       : O=Digital Signature Trust Co., CN=DST Root CA X3

26.04.21 15:18:28 (+0200) <main> subject name      : O=Digital Signature Trust Co., CN=DST Root CA X3

26.04.21 15:18:28 (+0200) <main> issued  on        : 2000-09-30 21:12:19

26.04.21 15:18:28 (+0200) <main> expires on        : 2021-09-30 14:01:15

26.04.21 15:18:28 (+0200) <main> signed using      : RSA with SHA1

26.04.21 15:18:28 (+0200) <main> RSA key size      : 2048 bits

26.04.21 15:18:28 (+0200) <main> basic constraints : CA=true

26.04.21 15:18:28 (+0200) <main> key usage         : Key Cert Sign, CRL Sign

26.04.21 15:18:28 (+0200) <main> 2021-04-26 13:18:28.721 [AIO:INFO] tc has no cert configured - running server auth and client auth with token

26.04.21 15:18:28 (+0200) <main> 2021-04-26 13:18:28.788 [TCE:INFO] Connecting to INFOS: wss://eu1.cloud.thethings.network:8887

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.067 [TCE:INFO] Infos: b827:ebff:fe64:2dfe muxs-::0 wss://eu1.cloud.thethings.network:8887/traffic/eui-B827EBFFFE642DFE

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.067 [AIO:DEBU] [3] ws_close reason=1000

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.067 [AIO:ERRO] Recv failed: SSL - The peer notified us that the connection is going to be closed

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.067 [AIO:DEBU] [3] WS connection shutdown...

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.068 [any:INFO] ./tc.trust: 

26.04.21 15:18:29 (+0200) <main> cert. version     : 3

26.04.21 15:18:29 (+0200) <main> serial number     : 44:AF:B0:80:D6:A3:27:BA:89:30:39:86:2E:F8:40:6B

26.04.21 15:18:29 (+0200) <main> issuer name       : O=Digital Signature Trust Co., CN=DST Root CA X3

26.04.21 15:18:29 (+0200) <main> subject name      : O=Digital Signature Trust Co., CN=DST Root CA X3

26.04.21 15:18:29 (+0200) <main> issued  on        : 2000-09-30 21:12:19

26.04.21 15:18:29 (+0200) <main> expires on        : 2021-09-30 14:01:15

26.04.21 15:18:29 (+0200) <main> signed using      : RSA with SHA1

26.04.21 15:18:29 (+0200) <main> RSA key size      : 2048 bits

26.04.21 15:18:29 (+0200) <main> basic constraints : CA=true

26.04.21 15:18:29 (+0200) <main> key usage         : Key Cert Sign, CRL Sign

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.068 [AIO:INFO] tc has no cert configured - running server auth and client auth with token

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.117 [TCE:VERB] Connecting to MUXS...

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.369 [TCE:VERB] Connected to MUXS.

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.411 [RAL:WARN] Ignoring unsupported/unknown field: antenna_gain

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.412 [RAL:INFO] Lora gateway library version: Version: 5.0.1;

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] Connecting to device: /dev/spidev0.0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:DEBU] SX130x txlut table (0 entries)

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 rxrfchain 0: enable=1 freq=867.5MHz rssi_offset=-166.000000 type=2 tx_enable=1 tx_notch_freq=0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 rxrfchain 1: enable=1 freq=868.5MHz rssi_offset=-166.000000 type=2 tx_enable=0 tx_notch_freq=0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  0: enable=1 rf_chain=1 freq=-400000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  1: enable=1 rf_chain=1 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  2: enable=1 rf_chain=1 freq=0 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  3: enable=1 rf_chain=0 freq=-400000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  4: enable=1 rf_chain=0 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  5: enable=1 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  6: enable=1 rf_chain=0 freq=200000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  7: enable=1 rf_chain=0 freq=400000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  8: enable=1 rf_chain=1 freq=-200000 bandwidth=2 datarate=2 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX1301 ifchain  9: enable=1 rf_chain=1 freq=300000 bandwidth=3 datarate=50000 sync_word=0/0

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] SX130x LBT not enabled

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.413 [RAL:VERB] Station device: /dev/spidev0.0 (PPS capture disabled)

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.414 [RAL:ERRO] Concentrator start failed: lgw_start

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.414 [RAL:ERRO] ral_config failed with status 0x08

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.414 [any:ERRO] Closing connection to muxs - error in s2e_onMsg

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.414 [AIO:DEBU] [3] ws_close reason=1000

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.414 [AIO:DEBU] Echoing close - reason=1000

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.460 [AIO:DEBU] [3|WS] Server sent close: reason=1000

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.460 [AIO:DEBU] [3] WS connection shutdown...

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.461 [TCE:VERB] Connection to MUXS closed in state -1

26.04.21 15:18:29 (+0200) <main> 2021-04-26 13:18:29.461 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.462 [any:INFO] ./tc.trust: 

26.04.21 15:18:39 (+0200) <main> cert. version     : 3

26.04.21 15:18:39 (+0200) <main> serial number     : 44:AF:B0:80:D6:A3:27:BA:89:30:39:86:2E:F8:40:6B

26.04.21 15:18:39 (+0200) <main> issuer name       : O=Digital Signature Trust Co., CN=DST Root CA X3

26.04.21 15:18:39 (+0200) <main> subject name      : O=Digital Signature Trust Co., CN=DST Root CA X3

26.04.21 15:18:39 (+0200) <main> issued  on        : 2000-09-30 21:12:19

26.04.21 15:18:39 (+0200) <main> expires on        : 2021-09-30 14:01:15

26.04.21 15:18:39 (+0200) <main> signed using      : RSA with SHA1

26.04.21 15:18:39 (+0200) <main> RSA key size      : 2048 bits

26.04.21 15:18:39 (+0200) <main> basic constraints : CA=true

26.04.21 15:18:39 (+0200) <main> key usage         : Key Cert Sign, CRL Sign

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.463 [AIO:INFO] tc has no cert configured - running server auth and client auth with token

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.513 [TCE:INFO] Connecting to INFOS: wss://eu1.cloud.thethings.network:8887

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.812 [TCE:INFO] Infos: b827:ebff:fe64:2dfe muxs-::0 wss://eu1.cloud.thethings.network:8887/traffic/eui-B827EBFFFE642DFE

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.812 [AIO:DEBU] [3] ws_close reason=1000

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.813 [AIO:ERRO] Recv failed: SSL - The peer notified us that the connection is going to be closed

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.813 [AIO:DEBU] [3] WS connection shutdown...

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.814 [any:INFO] ./tc.trust: 

26.04.21 15:18:39 (+0200) <main> cert. version     : 3

26.04.21 15:18:39 (+0200) <main> serial number     : 44:AF:B0:80:D6:A3:27:BA:89:30:39:86:2E:F8:40:6B

26.04.21 15:18:39 (+0200) <main> issuer name       : O=Digital Signature Trust Co., CN=DST Root CA X3

26.04.21 15:18:39 (+0200) <main> subject name      : O=Digital Signature Trust Co., CN=DST Root CA X3

26.04.21 15:18:39 (+0200) <main> issued  on        : 2000-09-30 21:12:19

26.04.21 15:18:39 (+0200) <main> expires on        : 2021-09-30 14:01:15

26.04.21 15:18:39 (+0200) <main> signed using      : RSA with SHA1

26.04.21 15:18:39 (+0200) <main> RSA key size      : 2048 bits

26.04.21 15:18:39 (+0200) <main> basic constraints : CA=true

26.04.21 15:18:39 (+0200) <main> key usage         : Key Cert Sign, CRL Sign

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.814 [AIO:INFO] tc has no cert configured - running server auth and client auth with token

26.04.21 15:18:39 (+0200) <main> 2021-04-26 13:18:39.861 [TCE:VERB] Connecting to MUXS...

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.116 [TCE:VERB] Connected to MUXS.

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.163 [RAL:WARN] Ignoring unsupported/unknown field: antenna_gain

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.163 [RAL:INFO] Lora gateway library version: Version: 5.0.1;

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.164 [RAL:VERB] Connecting to device: /dev/spidev0.0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:DEBU] SX130x txlut table (0 entries)

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 rxrfchain 0: enable=1 freq=867.5MHz rssi_offset=-166.000000 type=2 tx_enable=1 tx_notch_freq=0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 rxrfchain 1: enable=1 freq=868.5MHz rssi_offset=-166.000000 type=2 tx_enable=0 tx_notch_freq=0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  0: enable=1 rf_chain=1 freq=-400000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  1: enable=1 rf_chain=1 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  2: enable=1 rf_chain=1 freq=0 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  3: enable=1 rf_chain=0 freq=-400000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  4: enable=1 rf_chain=0 freq=-200000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  5: enable=1 rf_chain=0 freq=0 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  6: enable=1 rf_chain=0 freq=200000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  7: enable=1 rf_chain=0 freq=400000 bandwidth=0 datarate=0 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  8: enable=1 rf_chain=1 freq=-200000 bandwidth=2 datarate=2 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX1301 ifchain  9: enable=1 rf_chain=1 freq=300000 bandwidth=3 datarate=50000 sync_word=0/0

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] SX130x LBT not enabled

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.165 [RAL:VERB] Station device: /dev/spidev0.0 (PPS capture disabled)

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.166 [RAL:ERRO] Concentrator start failed: lgw_start

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.166 [RAL:ERRO] ral_config failed with status 0x08

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.166 [any:ERRO] Closing connection to muxs - error in s2e_onMsg

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.166 [AIO:DEBU] [3] ws_close reason=1000

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.166 [AIO:DEBU] Echoing close - reason=1000

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.211 [AIO:DEBU] [3|WS] Server sent close: reason=1000

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.211 [AIO:DEBU] [3] WS connection shutdown...

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.211 [TCE:VERB] Connection to MUXS closed in state -1

26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.211 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)
eihnat commented 3 years ago

Ok. Managed to make it work. Issue was actually with concentrator not starting (visible also in logs).

 26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.166 [RAL:ERRO] Concentrator start failed: lgw_start

 26.04.21 15:18:40 (+0200) <main> 2021-04-26 13:18:40.166 [RAL:ERRO] ral_config failed with status 0x08

Surprisingly, this was happening also on TTN v2, gateway remained connected, but error messages were same. For reference, I have this HAT: https://uk.pi-supply.com/products/iot-lora-gateway-hat-for-raspberry-pi

Solution: change reset pin from 17 to 22. I have also disabled bluetooth (DT overlay: pi3-disable-bt), but not sure if this affects it in any way. might try later without this option. Hope this helps someone in future.