Balena/Basicstation/Chirpstack debug help

Hello all, could use a bit of help here…
I’ve got basicstation running on an RPi4 with RAK2245 in the US and have spun up a VM with gateway-bridge, network-server and application-server running.

I’ve got the basicstation TC_URI pointing to that vm’s gateway-bridge websocket port, but the connection keep looping with connect --> drop, connect --> drop.

13.10.20 23:22:22 (-0400) basicstation 2020-10-14 03:22:22.850 [AIO:DEBU] [3] ws_close reason=1000
13.10.20 23:22:22 (-0400) basicstation 2020-10-14 03:22:22.850 [AIO:DEBU] Echoing close - reason=1000
13.10.20 23:22:22 (-0400) basicstation 2020-10-14 03:22:22.850 [AIO:DEBU] [3] Connection closed unexpectedly
13.10.20 23:22:22 (-0400) basicstation 2020-10-14 03:22:22.850 [AIO:DEBU] [3] WS connection shutdown…
13.10.20 23:22:22 (-0400) basicstation 2020-10-14 03:22:22.879 [TCE:VERB] Connecting to MUXS…
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.910 [TCE:VERB] Connected to MUXS.
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.938 [RAL:ERRO] Unsupported hwspec=sx1301/0
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.938 [any:ERRO] Closing connection to muxs - error in s2e_onMsg
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.938 [AIO:DEBU] [3] ws_close reason=1000
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.938 [AIO:DEBU] Echoing close - reason=1000
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.958 [AIO:DEBU] [3|WS] Server sent close: reason=1000
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.958 [AIO:DEBU] [3] WS connection shutdown…
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.958 [TCE:VERB] Connection to MUXS closed in state -1
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.958 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)

The three important lines seem to be:

[RAL:ERRO] Unsupported hwspec=sx1301/0
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.938 [any:ERRO] Closing connection to muxs - error in s2e_onMsg
13.10.20 23:22:23 (-0400) basicstation 2020-10-14 03:22:22.938 [AIO:DEBU] [3] ws_close reason=1000

Any ideas? I believe a close reason of 1000 is a normal close, so perhaps my problem is with Unsupported hwspec and the s2e error, but I can’t figure out what they mean.

Here are the logs from gatewa-bridge:

Oct 14 03:28:46 dev-chirpstack-nginx chirpstack-gateway-bridge[5597]: time=“2020-10-14T03:28:46Z” level=info msg=“backend/basicstation: router-info request received” gateway_id=0242acfffe110002 remote_addr="[[REDACTED]]:36490" router_uri=“ws://[[REDACTED]]:3001/gateway/0242acfffe110002”
Oct 14 03:28:46 dev-chirpstack-nginx chirpstack-gateway-bridge[5597]: time=“2020-10-14T03:28:46Z” level=info msg=“backend/basicstation: gateway connected” gateway_id=0242acfffe110002 remote_addr="[[REDACTED]]:36492"
Oct 14 03:28:46 dev-chirpstack-nginx chirpstack-gateway-bridge[5597]: time=“2020-10-14T03:28:46Z” level=info msg=“integration/mqtt: subscribing to topic” qos=0 topic=“gateway/0242acfffe110002/command/#”
Oct 14 03:28:46 dev-chirpstack-nginx chirpstack-gateway-bridge[5597]: time=“2020-10-14T03:28:46Z” level=info msg=“backend/basicstation: gateway version received” firmware=1.0.0 gateway_id=0242acfffe110002 model=rpi package=1.0.0 protocol=2 station=“2.0.5(rpi/std)”
Oct 14 03:28:46 dev-chirpstack-nginx chirpstack-gateway-bridge[5597]: time=“2020-10-14T03:28:46Z” level=info msg=“backend/basicstation: router-config message sent to gateway” gateway_id=0242acfffe110002
Oct 14 03:28:46 dev-chirpstack-nginx chirpstack-gateway-bridge[5597]: time=“2020-10-14T03:28:46Z” level=info msg=“backend/basicstation: gateway disconnected” gateway_id=0242acfffe110002 remote_addr="[[REDACTED]]:36492"
Oct 14 03:28:46 dev-chirpstack-nginx chirpstack-gateway-bridge[5597]: time=“2020-10-14T03:28:46Z” level=info msg=“integration/mqtt: unsubscribing from topic” topic=“gateway/0242acfffe110002/command/#”

Also strangely that gateway id seems to be randomly generated - it doesn’t match my actual hardware.

Thanks!

@barryjump Hi…I have been facing the same issue…can you please help me out if you have sorted this?

Have you sorted this?

if not…
your gateway id needs to be the lora mac of your rak2245, unless you’ve generated and are using a random id?
does your gateway show online in your chirpstack webui?

@ccall48 Yeah thanks…Sorted this out…But unable to receive the join req from the end device. I am using multitech gateway with basic station running on it.

Hey guys, i’m facing a similar issue with connecting the corecell design via basicstation to chirptstack inside docker. I get to see the basicstation intentionally in the gateway-bridge log but not getting any traffic.

Gateway-bridge conf:

[general]
log_level=5

[filters]
join_euis=[["0000000000000000", "ffffffffffffffff"]]
net_ids=["000000"]


[integration.mqtt.auth.generic]
servers="tcp://mosquitto:1883"
username="admin"
password="admin"

# Gateway backend configuration.

[backend]
# Backend type.
#
# Valid options are:
#   * semtech_udp
#   * concentratord
#   * basic_station
type="basic_station"

# Basic Station backend.
[backend.basic_station]

# ip:port to bind the Websocket listener to.
bind=":3001"

# TLS certificate and key files.
#
# When set, the websocket listener will use TLS to secure the connections
# between the gateways and ChirpStack Gateway Bridge (optional).
tls_cert=""
tls_key=""

# TLS CA certificate.
#
# When configured, ChirpStack Gateway Bridge will validate that the client
# certificate of the gateway has been signed by this CA certificate.
ca_cert=""

# Stats interval.
#
# This defines the interval in which the ChirpStack Gateway Bridge forwards
# the uplink / downlink statistics.
stats_interval="30s"

# Ping interval.
ping_interval="1m0s"

# Read timeout.
#
# This interval must be greater than the configured ping interval.
read_timeout="1m5s"

# Write timeout.
write_timeout="1s"

# Region.
#
# Please refer to the LoRaWAN Regional Parameters specification
# for the complete list of common region names.
region="EU868"

# Minimal frequency (Hz).
frequency_min=863000000

# Maximum frequency (Hz).
frequency_max=870000000

# Concentrator configuration.
#
# This section contains the configuration for the SX1301 concentrator chips.
# Example:
# [[backend.basic_station.concentrators]]
#
#   # Multi-SF channel configuration.
#   [backend.basic_station.concentrators.multi_sf]
#
#   # Frequencies (Hz).
#   frequencies=[
#     868100000,
#     868300000,
#     868500000,
#     867100000,
#     867300000,
#     867500000,
#     867700000,
#     867900000,
#   ]
#
#   # LoRa STD channel.
#   [backend.basic_station.concentrators.lora_std]
#
#   # Frequency (Hz).
#   frequency=868300000
#
#   # Bandwidth (Hz).
#   bandwidth=250000
#
#   # Spreading factor.
#   spreading_factor=7
#
#   # FSK channel.
#   [backend.basic_station.concentrators.fsk]
#
#   # Frequency (Hz).
#   frequency=868800000

Gateway-bridge logs:

level=info  msg="backend/basicstation: gateway connected" gateway_id=b827ebfffe255d5f remote_addr="172.16.7.186:41306"
level=debug msg="integration/mqtt: set gateway subscription called" gateway_id=b827ebfffe255d5f subscribe=true
level=info  msg="integration/mqtt: subscribing to topic" qos=0 topic="gateway/b827ebfffe255d5f/command/#"
level=debug msg="backend/basicstation: message received" gateway_id=b827ebfffe255d5f message="{\"msgtype\":\"version\",\"station\":\"2.0.5(corecell/std)\",\"firmware\":\"2.0.4\",\"package\":\"2.0.4\",\"model\":\"corecell\",\"protocol\":2,\"features\":\"rmtsh\"}"
level=info  msg="backend/basicstation: gateway version received" firmware=2.0.4 gateway_id=b827ebfffe255d5f model=corecell package=2.0.4 protocol=2 station="2.0.5(corecell/std)"
level=debug msg="sending message to gateway" gateway_id=b827ebfffe255d5f message="{\"msgtype\":\"router_config\",\"NetID\":[0],\"JoinEui\":[[0,18446744073709551615]],\"region\":\"EU863\",\"hwspec\":\"sx1301/0\",\"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],[-1,0,0],[-1,0,0],[-1,0,0],[-1,0,0],[-1,0,0],[-1,0,0],[-1,0,0],[-1,0,0]],\"sx1301_conf\":[]}"
level=info  msg="backend/basicstation: router-config message sent to gateway" gateway_id=b827ebfffe255d5f
level=info  msg="backend/basicstation: gateway disconnected" gateway_id=b827ebfffe255d5f remote_addr="172.16.7.186:41306"
level=debug msg="integration/mqtt: set gateway subscription called" gateway_id=b827ebfffe255d5f subscribe=false
level=info  msg="integration/mqtt: unsubscribing from topic" topic="gateway/b827ebfffe255d5f/command/#"

Basicstation:

[SYS:INFO] Logging     : stderr (maxsize=10000000, rotate=3)  
[SYS:INFO] Station Ver : 2.0.5(corecell/std) 2021-01-21 11:19:59
[SYS:INFO] Package Ver : 2.0.4
[SYS:INFO] proto EUI   : 0:b827:eb25:5d5f	(/sys/class/net/eth0/address)
[SYS:INFO] prefix EUI  : ::1	(builtin)
[SYS:INFO] Station EUI : b827:ebff:fe25:5d5f
[SYS:INFO] Station home: ./	(builtin)
[SYS:INFO] Station temp: /var/tmp/	(builtin)
[SYS:WARN] Station in NO-CUPS mode
[TCE:INFO] Starting TC engine  
[TCE:INFO] Connecting to INFOS: ws://172.16.7.181:3001
[TCE:INFO] Infos: b827:ebff:fe25:5d5f b827:ebff:fe25:5d5f ws://172.16.7.181:3001/gateway/b827ebfffe255d5f
[AIO:DEBU] [3] ws_close reason=1000
[AIO:DEBU] [3] Connection closed unexpectedly
[AIO:DEBU] [3] WS connection shutdown...
[TCE:VERB] Connecting to MUXS...
[TCE:VERB] Connected to MUXS.
[RAL:ERRO] Unsupported hwspec=sx1301/0
[any:ERRO] Closing connection to muxs - error in s2e_onMsg
[AIO:DEBU] [3] ws_close reason=1000
[AIO:DEBU] Echoing close - reason=1000
[AIO:DEBU] [3|WS] Server sent close: reason=1000
[AIO:DEBU] [3] WS connection shutdown...
[TCE:VERB] Connection to MUXS closed in state -1
[TCE:INFO] INFOS reconnect backoff 10s (retry 1) 
ERROR: Failed to stop TX trigger
ERROR: Failed to stop TX trigger
ERROR: failed to close I2C device (err=-1)
[TCE:INFO] Connecting to INFOS: ws://172.16.7.181:3001
[TCE:INFO] Infos: b827:ebff:fe25:5d5f b827:ebff:fe25:5d5f ws://172.16.7.181:3001/gateway/b827ebfffe255d5f
[AIO:DEBU] [3] ws_close reason=1000
[AIO:DEBU] [3] Connection closed unexpectedly
[AIO:DEBU] [3] WS connection shutdown...
[TCE:VERB] Connecting to MUXS...
[TCE:VERB] Connected to MUXS.
[RAL:ERRO] Unsupported hwspec=sx1301/0
[any:ERRO] Closing connection to muxs - error in s2e_onMsg
[AIO:DEBU] [3] ws_close reason=1000
[AIO:DEBU] Echoing close - reason=1000
[AIO:DEBU] [3|WS] Server sent close: reason=1000
[AIO:DEBU] [3] WS connection shutdown...
[TCE:VERB] Connection to MUXS closed in state -1
[TCE:INFO] INFOS reconnect backoff 10s (retry 1)

For me it seems the gateway-bridge received the correct model version as corecell but replys with hwspec:SX1301. That causes the basicstation to say “[RAL:ERRO] Unsupported hwspec=sx1301/0”

I would really appriciate some advise. What am i missing?

So I reply to myself as i figured it out. just don’t be as stupid as i was…

As seen in the previous gateway-bridge conf I commented all the stuff of the concentrator configuration out. Just uncomment it and it works.

What I also learned: if you want to use an RPI with an PicoCell USB Gateway you need to make small changes regarding the platform=“linuxpico”. Just change the Architecture in the setup.gmk file to

ARCH.linuxpico = arm-linux-gnueabihf

and start the build with “make platform=linuxpico variant=std”

1 Like