I tried basicstation and Semtech UDP packet-forwarder as the gateway bridge backend. I am running into a problem when I send a downlink packet, it does not reach the node. I can see the packets in the gateway bridge logs
2022-08-13 11:28:05.692 [SYN:INFO] MCU/SX130X drift stats: min: +0.5ppm q50: +8.1ppm q80: +11.9ppm max: +13.8ppm - threshold q90: +12.4ppm
2022-08-13 11:28:05.693 [SYN:INFO] Mean MCU drift vs SX130X#0: 6.5ppm
2022-08-13 11:28:12.124 [SYN:ERRO] Failed to convert xtime to gpstime - last PPS sync too old: 40m35s
2022-08-13 11:28:14.664 [SYN:ERRO] Failed to convert xtime to gpstime - last PPS sync too old: 40m38s
2022-08-13 11:28:15.592 [S2E:WARN] Received 'dnmsg' before 'router_config' - dropped
2022-08-13 11:28:25.255 [SYN:ERRO] Failed to convert xtime to gpstime - last PPS sync too old: 40m48s
2022-08-13 11:28:26.186 [S2E:WARN] Received 'dnmsg' before 'router_config' - dropped
2022-08-13 11:28:35.442 [SYN:ERRO] Failed to convert xtime to gpstime - last PPS sync too old: 40m59s
2022-08-13 11:28:36.410 [SYN:ERRO] Failed to convert xtime to gpstime - last PPS sync too old: 41m0s
2022-08-13 11:28:37.346 [S2E:WARN] Received 'dnmsg' before 'router_config' - dropped
The message Received 'dnmsg' before 'router_config' - dropped is keep popping up as the downlink message persists in the downlink queue.
When I point the gateway to ttn server, I am able to send a downlink without any issues. So I am pretty sure that I have not configured the chirpstack-gateway-bridge correctly.
The gateway-bridge.toml file for the reference
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
# configuration example and documentation.
[backend]
type="basic_station"
# Semtech UDP packet-forwarder backend.
[backend.semtech_udp]
# ip:port to bind the UDP listener to
#
# Example: 0.0.0.0:1700 to listen on port 1700 for all network interfaces.
# This is the listener to which the packet-forwarder forwards its data
# so make sure the 'serv_port_up' and 'serv_port_down' from your
# packet-forwarder matches this port.
udp_bind = "0.0.0.0:1700"
# Skip the CRC status-check of received packets
#
# This is only has effect when the packet-forwarder is configured to forward
# LoRa frames with CRC errors.
skip_crc_check = false
# Fake RX timestamp.
#
# Fake the RX time when the gateway does not have GPS, in which case
# the time would otherwise be unset.
fake_rx_time=false
# Basic Station backend.
[backend.basic_station]
# ip:port to bind the Websocket listener to.
bind="0.0.0.0: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"
# Timesync interval.
#
# This defines the interval in which the ChirpStack Gateway Bridge sends
# a timesync request to the gateway. Setting this to 0 disables sending
# timesync requests.
timesync_interval="1h0m0s"
# 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="AS923"
# Minimal frequency (Hz).
frequency_min=915000000
# Maximum frequency (Hz).
frequency_max=928000000
# 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=[
923200000,
923400000,
922200000,
922400000,
922600000,
922800000,
923000000,
922000000,
]
# LoRa STD channel.
[backend.basic_station.concentrators.lora_std]
# Frequency (Hz).
frequency=923000000
# Bandwidth (Hz).
bandwidth=250000
# Spreading factor.
spreading_factor=7
# FSK channel.
[backend.basic_station.concentrators.fsk]
# Frequency (Hz).
frequency=922000000
[integration]
marshaler="json"
[integration.mqtt.auth.generic]
servers=["tcp://mosquitto:1883"]
username=""
password=""
I would recommend you to look into the initial logs of the Basics Station. On connect, ChirpStack Gateway Bridge will send the configuration to the Basics Station. My assumption is that because of config error (in the ChirpStack Gateway Bridge configuration), this is not processed correctly and will log a warning or error at the beginning of the Basics Station startup.
2022-08-17 13:07:16.640 [RAL:INFO] [FSK] 9: 922.2MHz rf=0 freq= +0.0 datarate=0 bw=0 sync_word=0/0 - Actual FSK in the Gateway bridge is 921800000. It is a mismatch
Was this ever resolved?
Iām seeing this same issue against Chirpstack version 3.16.4
Sep 8 19:55:38 RG1xx29D9CE user.notice lora: 2022-09-08 19:55:38.479 [S2E:WARN] Received ādnmsgā before ārouter_configā - dropped
(I havenāt figured out how to install 4.0 yet to try it)
Iām a little late to the party but I fixed a similar issue by adding a new region case to the /src/s2e.c J_REGION switch of the basicstation repo.
In my case of Singapore 8 Band I needed to add the region CRC 0xD653976B above line 1006 as a fall-through case
case ((ujcrc_t) 0xD653976B): // CRC obtained by debugging region variable
case J_AS923JP: { // non-std obsolete naming
region = J_AS923_1;
region_s = "AS923-1";
// FALL THRU
}
Hi Vic,
Sorry for the delay in response, I no longer have access to any lgw hardware.
However, from memory, the switch case I added was to add support for the unrecognized region.
To get the CRC value I added a LOG call to the default case that printed the unrecognized CRC to the xdebug logs.
Iām sure there is a cleaner way to do it but due to the CRC header being generated programmatically I simply hardcoded the switch case to fall through to the correct configuration.
/* ... src/s2e.c handle_router_config() */
case ((ujcrc_t) 0xD653976B): // CRC obtained by debugging region variable
case J_AS923JP: { // non-std obsolete naming
region = J_AS923_1;
region_s = "AS923-1";
// FALL THRU
}
case J_AS923_1: { // common region name
s2ctx->ccaEnabled = 1;
s2ctx->canTx = s2e_canTxPerChnlDC;
s2ctx->txpow = 13 * TXPOW_SCALE;
resetDC(s2ctx, 10); // 10%
break;
}
/* ... Other regions ...*/
default: {
LOG(MOD_S2E|WARNING, "Unrecognized region: %x - ignored", region);
LOG(MOD_S2E|WARNING, "Unrecognized region: %s - ignored", region_s);
s2ctx->txpow = 14 * TXPOW_SCALE;
region = 0;
break;
}
/* ... */