Trying to run Chirpstack on a custom gateway

I have a custom gateway with an armv7l architecture processor. I have compiled chirpstack with sqlite support. All the binaries are running on my gateway, all localhost: chirpstack-gateway-bridge, basicstation, mosquitto, redis and chirpstack itself. They run without errors.

But when I try to run chirpstack with chirpstack.toml and region_au915_0.toml, MQTT does not seem to work neither the web interface does not show (I get ERR_CONNECTION_REFUSED on the browser)

If I leave enabled_regions empty on my chirpstack.toml config file, then at least the web interface opens.

Am I missing something on my setup?

Have you checked the ChirpStack server logs?

Yes I’ve checked the logs. There are no error messages.

The other components of chirpstack ecosystem, such as mosquitto broker, redis, chirpstack-gateway-bridge, sqlite and basicstation seem to be working ok.

I’m using default configuration files from here: chirpstack/chirpstack/configuration at master · chirpstack/chirpstack · GitHub

With the only difference that I’m using sqlite (DATABASE=sqlite make dist) instead of postgress and “trace” for log level.

[sqlite]
  path="sqlite://chirpstack.sqlite"
  max_open_connections=4
  pragmas=[
    "busy_timeout = 1000",
    "foreign_keys = ON",
  ]

With this configuration the logs are the following (and no other logs show) and I cannot access web interface:

2024-10-29T15:31:12.930662Z  INFO chirpstack::cmd::root: Starting ChirpStack LoRaWAN Network Server version="4.10.0-test.1" docs="https://www.chirpstack.io/"
2024-10-29T15:31:12.933295Z  INFO chirpstack::storage::sqlite: Setting up SQLite connection pool
2024-10-29T15:31:12.934988Z  INFO chirpstack::storage: Applying schema migrations
2024-10-29T15:31:12.953591Z  INFO chirpstack::storage: Setting up Redis client
2024-10-29T15:31:12.955070Z  INFO chirpstack::region: Setting up regions
2024-10-29T15:31:12.955585Z  INFO setup{common_name=RU864 region_id=ru864}: chirpstack::region: Configuring region
2024-10-29T15:31:12.956322Z  INFO setup{common_name=ISM2400 region_id=ism2400}: chirpstack::region: Configuring region
2024-10-29T15:31:12.956661Z  INFO setup{common_name=AS923 region_id=as923}: chirpstack::region: Configuring region
2024-10-29T15:31:12.957104Z  INFO setup{common_name=IN865 region_id=in865}: chirpstack::region: Configuring region
2024-10-29T15:31:12.957455Z  INFO setup{common_name=CN470 region_id=cn470_10}: chirpstack::region: Configuring region
2024-10-29T15:31:12.957851Z TRACE setup{common_name=CN470 region_id=cn470_10}: chirpstack::region: Disabling all channels first
2024-10-29T15:31:12.957999Z TRACE setup{common_name=CN470 region_id=cn470_10}: chirpstack::region: Enabling channels channels=[80, 81, 82, 83, 84, 85, 86, 87]
2024-10-29T15:31:12.958287Z  INFO setup{common_name=AU915 region_id=au915_0}: chirpstack::region: Configuring region
2024-10-29T15:31:12.958861Z TRACE setup{common_name=AU915 region_id=au915_0}: chirpstack::region: Disabling all channels first
2024-10-29T15:31:12.958992Z TRACE setup{common_name=AU915 region_id=au915_0}: chirpstack::region: Enabling channels channels=[0, 1, 2, 3, 4, 5, 6, 7, 64]
2024-10-29T15:31:12.959539Z  INFO setup{common_name=EU433 region_id=eu433}: chirpstack::region: Configuring region
2024-10-29T15:31:12.959934Z  INFO setup{common_name=US915 region_id=us915_0}: chirpstack::region: Configuring region
2024-10-29T15:31:12.960458Z TRACE setup{common_name=US915 region_id=us915_0}: chirpstack::region: Disabling all channels first
2024-10-29T15:31:12.960586Z TRACE setup{common_name=US915 region_id=us915_0}: chirpstack::region: Enabling channels channels=[0, 1, 2, 3, 4, 5, 6, 7, 64]
2024-10-29T15:31:12.960777Z  INFO setup{common_name=US915 region_id=us915_1}: chirpstack::region: Configuring region
2024-10-29T15:31:12.961228Z TRACE setup{common_name=US915 region_id=us915_1}: chirpstack::region: Disabling all channels first
2024-10-29T15:31:12.961350Z TRACE setup{common_name=US915 region_id=us915_1}: chirpstack::region: Enabling channels channels=[8, 9, 10, 11, 12, 13, 14, 15, 65]
2024-10-29T15:31:12.965024Z  INFO setup{common_name=KR920 region_id=kr920}: chirpstack::region: Configuring region
2024-10-29T15:31:12.966337Z  INFO setup{common_name=AS923_2 region_id=as923_2}: chirpstack::region: Configuring region
2024-10-29T15:31:12.967599Z  INFO setup{common_name=AS923_3 region_id=as923_3}: chirpstack::region: Configuring region
2024-10-29T15:31:12.968892Z  INFO setup{common_name=AS923_4 region_id=as923_4}: chirpstack::region: Configuring region
2024-10-29T15:31:12.970191Z  INFO setup{common_name=CN779 region_id=cn779}: chirpstack::region: Configuring region
2024-10-29T15:31:12.971424Z  INFO setup{common_name=EU868 region_id=eu868}: chirpstack::region: Configuring region
2024-10-29T15:31:12.973806Z TRACE setup{common_name=EU868 region_id=eu868}: chirpstack::region: Adding extra channel frequency=867100000 min_dr=0 max_dr=5
2024-10-29T15:31:12.975044Z TRACE setup{common_name=EU868 region_id=eu868}: chirpstack::region: Adding extra channel frequency=867300000 min_dr=0 max_dr=5
2024-10-29T15:31:12.975852Z TRACE setup{common_name=EU868 region_id=eu868}: chirpstack::region: Adding extra channel frequency=867500000 min_dr=0 max_dr=5
2024-10-29T15:31:12.976684Z TRACE setup{common_name=EU868 region_id=eu868}: chirpstack::region: Adding extra channel frequency=867700000 min_dr=0 max_dr=5
2024-10-29T15:31:12.977373Z TRACE setup{common_name=EU868 region_id=eu868}: chirpstack::region: Adding extra channel frequency=867900000 min_dr=0 max_dr=5
2024-10-29T15:31:12.978311Z  INFO chirpstack::backend::joinserver: Setting up Join Server clients
2024-10-29T15:31:12.979122Z  INFO chirpstack::backend::roaming: Setting up roaming clients
2024-10-29T15:31:12.979868Z  INFO chirpstack::adr: Setting up adr algorithms
2024-10-29T15:31:12.980492Z TRACE chirpstack::adr: Setting up included algorithms
2024-10-29T15:31:12.981286Z TRACE chirpstack::adr: Setting up plugins
2024-10-29T15:31:12.981980Z  INFO chirpstack::integration: Setting up global integrations
2024-10-29T15:31:12.983547Z  INFO chirpstack::integration::redis: Initializing Redis integration
2024-10-29T15:31:12.984090Z  INFO chirpstack::integration::mqtt: Initializing MQTT integration

If I comment the regions in chirpstack.toml, the logs are the following and I still cannot access the web interface:

2024-10-29T15:34:02.210972Z  INFO chirpstack::cmd::root: Starting ChirpStack LoRaWAN Network Server version="4.10.0-test.1" docs="https://www.chirpstack.io/"
2024-10-29T15:34:02.212715Z  INFO chirpstack::storage::sqlite: Setting up SQLite connection pool
2024-10-29T15:34:02.214372Z  INFO chirpstack::storage: Applying schema migrations
2024-10-29T15:34:02.231948Z  INFO chirpstack::storage: Setting up Redis client
2024-10-29T15:34:02.233368Z  INFO chirpstack::region: Setting up regions
2024-10-29T15:34:02.235773Z  INFO chirpstack::backend::joinserver: Setting up Join Server clients
2024-10-29T15:34:02.235915Z  INFO chirpstack::backend::roaming: Setting up roaming clients
2024-10-29T15:34:02.236022Z  INFO chirpstack::adr: Setting up adr algorithms
2024-10-29T15:34:02.236128Z TRACE chirpstack::adr: Setting up included algorithms
2024-10-29T15:34:02.236262Z TRACE chirpstack::adr: Setting up plugins
2024-10-29T15:34:02.236353Z  INFO chirpstack::integration: Setting up global integrations
2024-10-29T15:34:02.236436Z  INFO chirpstack::integration::redis: Initializing Redis integration
2024-10-29T15:34:02.236524Z  INFO chirpstack::integration::mqtt: Initializing MQTT integration

Now if I also comment the MQTT integration section, the logs are the following and this time I can access web interface, login and register gateways (although they never stay online):

2024-10-29T15:35:51.477344Z  INFO chirpstack::cmd::root: Starting ChirpStack LoRaWAN Network Server version="4.10.0-test.1" docs="https://www.chirpstack.io/"
2024-10-29T15:35:51.479038Z  INFO chirpstack::storage::sqlite: Setting up SQLite connection pool
2024-10-29T15:35:51.480690Z  INFO chirpstack::storage: Applying schema migrations
2024-10-29T15:35:51.498681Z  INFO chirpstack::storage: Setting up Redis client
2024-10-29T15:35:51.500050Z  INFO chirpstack::region: Setting up regions
2024-10-29T15:35:51.503507Z  INFO chirpstack::backend::joinserver: Setting up Join Server clients
2024-10-29T15:35:51.504644Z  INFO chirpstack::backend::roaming: Setting up roaming clients
2024-10-29T15:35:51.505131Z  INFO chirpstack::adr: Setting up adr algorithms
2024-10-29T15:35:51.505556Z TRACE chirpstack::adr: Setting up included algorithms
2024-10-29T15:35:51.506007Z TRACE chirpstack::adr: Setting up plugins
2024-10-29T15:35:51.506407Z  INFO chirpstack::integration: Setting up global integrations
2024-10-29T15:35:51.506793Z  INFO chirpstack::integration::redis: Initializing Redis integration
2024-10-29T15:35:51.507204Z  INFO chirpstack::gateway::backend: Setting up gateway backends for the different regions
2024-10-29T15:35:51.507948Z  INFO chirpstack::downlink: Setting up Class-B/C scheduler loop
2024-10-29T15:35:51.508648Z TRACE chirpstack::downlink::scheduler: Starting class_b_c_scheduler_loop run
2024-10-29T15:35:51.508796Z TRACE chirpstack::downlink::scheduler: Getting devices that have schedulable queue-items
2024-10-29T15:35:51.516575Z TRACE chirpstack::downlink::scheduler: Got this number of devices with schedulable queue-items device_count=0
2024-10-29T15:35:51.517245Z TRACE chirpstack::downlink::scheduler: class_b_c_scheduler_loop completed successfully
2024-10-29T15:35:51.517894Z  INFO chirpstack::downlink: Setting up multicast scheduler loop
2024-10-29T15:35:51.518467Z  INFO chirpstack::api: Setting up API interface bind=0.0.0.0:8080
2024-10-29T15:35:51.518728Z TRACE chirpstack::downlink::scheduler: Starting multicast-group queue scheduler loop run
2024-10-29T15:35:51.522278Z TRACE chirpstack::downlink::scheduler: Getting schedulable multicast-group queue items
2024-10-29T15:35:51.527611Z TRACE chirpstack::downlink::scheduler: Got this number of multicast-group queue items count=0
2024-10-29T15:35:51.528379Z TRACE chirpstack::downlink::scheduler: Multicast-group queue scheduler run completed successfully
2024-10-29T15:35:51.616830Z  INFO chirpstack::api::backend: Backend interfaces API interface is disabled
2024-10-29T15:35:52.522208Z TRACE chirpstack::downlink::scheduler: Starting class_b_c_scheduler_loop run
2024-10-29T15:35:52.522369Z TRACE chirpstack::downlink::scheduler: Getting devices that have schedulable queue-items
2024-10-29T15:35:52.528277Z TRACE chirpstack::downlink::scheduler: Got this number of devices with schedulable queue-items device_count=0
2024-10-29T15:35:52.529526Z TRACE chirpstack::downlink::scheduler: class_b_c_scheduler_loop completed successfully
2024-10-29T15:35:52.530539Z TRACE chirpstack::downlink::scheduler: Starting multicast-group queue scheduler loop run
2024-10-29T15:35:52.531224Z TRACE chirpstack::downlink::scheduler: Getting schedulable multicast-group queue items
2024-10-29T15:35:52.536469Z TRACE chirpstack::downlink::scheduler: Got this number of multicast-group queue items count=0
2024-10-29T15:35:52.538114Z TRACE chirpstack::downlink::scheduler: Multicast-group queue scheduler run completed successfully
2024-10-29T15:35:53.542184Z TRACE chirpstack::downlink::scheduler: Starting multicast-group queue scheduler loop run
2024-10-29T15:35:53.542345Z TRACE chirpstack::downlink::scheduler: Getting schedulable multicast-group queue items
2024-10-29T15:35:53.542588Z TRACE chirpstack::downlink::scheduler: Starting class_b_c_scheduler_loop run
2024-10-29T15:35:53.542667Z TRACE chirpstack::downlink::scheduler: Getting devices that have schedulable queue-items
2024-10-29T15:35:53.549575Z TRACE chirpstack::downlink::scheduler: Got this number of multicast-group queue items count=0
2024-10-29T15:35:53.550817Z TRACE chirpstack::downlink::scheduler: Multicast-group queue scheduler run completed successfully
2024-10-29T15:35:53.575613Z TRACE chirpstack::downlink::scheduler: Got this number of devices with schedulable queue-items device_count=0
2024-10-29T15:35:53.575808Z TRACE chirpstack::downlink::scheduler: class_b_c_scheduler_loop completed successfully
......
2024-10-29T15:36:02.720856Z DEBUG gRPC{uri=/}: chirpstack::api: Started processing request
2024-10-29T15:36:02.721763Z  INFO gRPC{uri=/}: chirpstack::api: Finished processing request status="200" latency=1.0575ms
.......
2024-10-29T15:36:02.783375Z DEBUG gRPC{uri=/assets/index-B204SH-X.js}: chirpstack::api: Started processing request
2024-10-29T15:36:02.835315Z  INFO gRPC{uri=/assets/index-B204SH-X.js}: chirpstack::api: Finished processing request status="200" latency=51.999417ms
2024-10-29T15:36:02.844090Z DEBUG gRPC{uri=/assets/index-C-P4JNPO.css}: chirpstack::api: Started processing request
2024-10-29T15:36:02.847604Z  INFO gRPC{uri=/assets/index-C-P4JNPO.css}: chirpstack::api: Finished processing request status="200" latency=5.595042ms
2024-10-29T15:36:03.378111Z DEBUG gRPC{uri=/api.InternalService/Profile}: chirpstack::api: Started processing request
2024-10-29T15:36:03.381339Z  INFO gRPC{uri=/api.InternalService/Profile}: chirpstack::api: Finished processing request status="200" latency=3.314458ms
2024-10-29T15:36:03.435878Z DEBUG gRPC{uri=/assets/index-B204SH-X.js.map}: chirpstack::api: Started processing request
2024-10-29T15:36:03.653473Z  INFO gRPC{uri=/assets/index-B204SH-X.js.map}: chirpstack::api: Finished processing request status="200" latency=217.674292ms
2024-10-29T15:36:03.667631Z DEBUG gRPC{uri=/api.InternalService/Settings}: chirpstack::api: Started processing request
2024-10-29T15:36:03.673403Z  INFO gRPC{uri=/api.InternalService/Settings}: chirpstack::api: Finished processing request status="200" latency=6.005125ms
2024-10-29T15:36:03.680991Z DEBUG gRPC{uri=/icon.png}: chirpstack::api: Started processing request
2024-10-29T15:36:03.683436Z  INFO gRPC{uri=/icon.png}: chirpstack::api: Finished processing request status="200" latency=2.5225ms
......
2024-10-29T15:36:06.066694Z DEBUG gRPC{uri=/api.InternalService/Login}: chirpstack::api: Started processing request
2024-10-29T15:36:06.072927Z  INFO gRPC{uri=/api.InternalService/Login}: chirpstack::api: Finished processing request status="200" latency=6.309625ms
2024-10-29T15:36:06.080050Z DEBUG gRPC{uri=/api.InternalService/Profile}: chirpstack::api: Started processing request
2024-10-29T15:36:06.089233Z  INFO gRPC{uri=/api.InternalService/Profile}: chirpstack::api: Finished processing request status="200" latency=9.255208ms
2024-10-29T15:36:06.112725Z DEBUG gRPC{uri=/api.TenantService/List}: chirpstack::api: Started processing request
2024-10-29T15:36:06.124599Z  INFO gRPC{uri=/api.TenantService/List}: chirpstack::api: Finished processing request status="200" latency=11.947625ms
2024-10-29T15:36:06.171190Z DEBUG gRPC{uri=/api.InternalService/GetVersion}: chirpstack::api: Started processing request
2024-10-29T15:36:06.176310Z  INFO gRPC{uri=/api.InternalService/GetVersion}: chirpstack::api: Finished processing request status="200" latency=5.200417ms
2024-10-29T15:36:06.237608Z DEBUG gRPC{uri=/api.InternalService/GetVersion}: chirpstack::api: Started processing request
2024-10-29T15:36:06.243503Z  INFO gRPC{uri=/api.InternalService/GetVersion}: chirpstack::api: Finished processing request status="200" latency=5.977ms
2024-10-29T15:36:06.248567Z DEBUG gRPC{uri=/api.TenantService/Get}: chirpstack::api: Started processing request
2024-10-29T15:36:06.256113Z  INFO gRPC{uri=/api.TenantService/Get}: chirpstack::api: Finished processing request status="200" latency=7.617834ms
2024-10-29T15:36:06.260583Z DEBUG gRPC{uri=/logo.png}: chirpstack::api: Started processing request
2024-10-29T15:36:06.263267Z  INFO gRPC{uri=/logo.png}: chirpstack::api: Finished processing request status="200" latency=2.754708ms
2024-10-29T15:36:06.280135Z DEBUG gRPC{uri=/api.TenantService/Get}: chirpstack::api: Started processing request
2024-10-29T15:36:06.286882Z  INFO gRPC{uri=/api.TenantService/Get}: chirpstack::api: Finished processing request status="200" latency=6.818083ms
2024-10-29T15:36:06.292261Z DEBUG gRPC{uri=/api.InternalService/GetVersion}: chirpstack::api: Started processing request
2024-10-29T15:36:06.296168Z  INFO gRPC{uri=/api.InternalService/GetVersion}: chirpstack::api: Finished processing request status="200" latency=4.130251ms
2024-10-29T15:36:06.345811Z DEBUG gRPC{uri=/api.InternalService/GetDevicesSummary}: chirpstack::api: Started processing request
2024-10-29T15:36:06.355302Z  INFO gRPC{uri=/api.InternalService/GetDevicesSummary}: chirpstack::api: Finished processing request status="200" latency=9.564042ms
2024-10-29T15:36:06.359302Z DEBUG gRPC{uri=/api.InternalService/GetGatewaysSummary}: chirpstack::api: Started processing request
2024-10-29T15:36:06.365858Z  INFO gRPC{uri=/api.InternalService/GetGatewaysSummary}: chirpstack::api: Finished processing request status="200" latency=6.621291ms
2024-10-29T15:36:06.371347Z DEBUG gRPC{uri=/api.GatewayService/List}: chirpstack::api: Started processing request
2024-10-29T15:36:06.381549Z  INFO gRPC{uri=/api.GatewayService/List}: chirpstack::api: Finished processing request status="200" latency=10.272166ms
.......

Basicstation logs:

.........
2024-10-29 15:54:48.808 [S2E:VERB] RX 915.4MHz DR2 SF10/BW125 snr=12.0 rssi=-78 xtime=0x67001259D59504 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=55910 MIC=706417336
2024-10-29 15:54:51.261 [S2E:VERB] RX 916.4MHz DR3 SF9/BW125 snr=11.8 rssi=-74 xtime=0x67001259FB2282 - updf mhdr=40 DevAddr=4B75B673 FCtrl=80 FCnt=4375 FOpts=[] 04569ECF..06AA mic=-73217224 (52 bytes)
2024-10-29 15:54:52.221 [S2E:VERB] RX 916.2MHz DR2 SF10/BW125 snr=13.2 rssi=-63 xtime=0x6700125A09CBC8 - updf mhdr=40 DevAddr=0002DEBB FCtrl=C0 FCnt=7966 FOpts=[] 040D6C73..427E mic=-94429189 (19 bytes)
2024-10-29 15:54:54.951 [S2E:VERB] RX 915.9MHz DR6 SF8/BW500 snr=12.0 rssi=-77 xtime=0x6700125A335508 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=65439 MIC=418434894
2024-10-29 15:55:01.471 [S2E:VERB] RX 916.2MHz DR2 SF10/BW125 snr=10.5 rssi=-80 xtime=0x6700125A96B045 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=28615 MIC=1329761195
2024-10-29 15:55:07.601 [S2E:VERB] RX 915.9MHz DR6 SF8/BW500 snr=12.0 rssi=-78 xtime=0x6700125AF47046 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=56766 MIC=137576756
2024-10-29 15:55:13.801 [S2E:VERB] RX 916.4MHz DR5 SF7/BW125 snr=13.8 rssi=-69 xtime=0x6700125B52F6E4 - updf mhdr=40 DevAddr=013C945B FCtrl=80 FCnt=156 FOpts=[] 043D78F5..3D24 mic=-1876314479 (24 bytes)
2024-10-29 15:55:14.121 [S2E:VERB] RX 915.2MHz DR2 SF10/BW125 snr=11.8 rssi=-79 xtime=0x6700125B57C7B9 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=51952 MIC=-514900332
2024-10-29 15:55:20.261 [S2E:VERB] RX 915.9MHz DR6 SF8/BW500 snr=11.0 rssi=-84 xtime=0x6700125BB583E8 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=46945 MIC=83758101
2024-10-29 15:55:26.771 [S2E:VERB] RX 916.4MHz DR2 SF10/BW125 snr=12.2 rssi=-77 xtime=0x6700125C18DB55 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=60011 MIC=-1083694897
2024-10-29 15:55:27.570 [SYN:VERB] Time sync rejected: quality=315 threshold=292
2024-10-29 15:55:31.161 [S2E:VERB] RX 915.2MHz DR0 SF12/BW125 snr=5.0 rssi=-95 xtime=0x6700125C5BA848 - updf mhdr=40 DevAddr=4B8A6483 FCtrl=00 FCnt=25807 FOpts=[] 0981098A..DDE9 mic=-1771498696 (24 bytes)
2024-10-29 15:55:31.790 [SYN:INFO] MCU/SX130X drift stats: min: -45.5ppm  q50: -48.1ppm  q80: -50.0ppm  max: -51.7ppm - threshold q90: -50.5ppm
2024-10-29 15:55:31.790 [SYN:INFO] Mean MCU drift vs SX130X#0: -48.1ppm
2024-10-29 15:55:32.903 [S2E:VERB] RX 915.9MHz DR6 SF8/BW500 snr=11.8 rssi=-79 xtime=0x6700125C769789 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=12447 MIC=670430912
2024-10-29 15:55:33.902 [SYN:INFO] Time sync qualities: min=241 q90=286 max=676 (previous q90=292)
2024-10-29 15:55:39.423 [S2E:VERB] RX 916.0MHz DR2 SF10/BW125 snr=11.2 rssi=-76 xtime=0x6700125CD9EEF9 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=62175 MIC=-1052653650
2024-10-29 15:55:45.573 [S2E:VERB] RX 915.9MHz DR6 SF8/BW500 snr=11.2 rssi=-77 xtime=0x6700125D37AB24 - jreq MHdr=00 JoinEui=f803:3206:: DevEui=f803:3206:2:33dc DevNonce=22248 MIC=624426431
2024-10-29 15:55:48.652 [SYN:VERB] Time sync rejected: quality=330 threshold=286
.........

chirpstack-gateway-bridge logs:

..........
INFO[84229] backend/basicstation: uplink frame received   gateway_id=f80332fffe02615a uplink_id=3316358839
INFO[84229] integration/mqtt: publishing event            event=up qos=0 topic=au915_0/gateway/f80332fffe02615a/event/up uplink_id=3316358839
INFO[84235] backend/basicstation: join-request received   gateway_id=f80332fffe02615a uplink_id=1982219715
INFO[84235] integration/mqtt: publishing event            event=up qos=0 topic=au915_0/gateway/f80332fffe02615a/event/up uplink_id=1982219715
INFO[84238] backend/basicstation: uplink frame received   gateway_id=f80332fffe02615a uplink_id=1613336375
INFO[84238] integration/mqtt: publishing event            event=up qos=0 topic=au915_0/gateway/f80332fffe02615a/event/up uplink_id=1613336375
INFO[84241] backend/basicstation: join-request received   gateway_id=f80332fffe02615a uplink_id=689651372
INFO[84241] integration/mqtt: publishing event            event=up qos=0 topic=au915_0/gateway/f80332fffe02615a/event/up uplink_id=689651372
INFO[84243] backend/basicstation: uplink frame received   gateway_id=f80332fffe02615a uplink_id=66504276
INFO[84243] integration/mqtt: publishing event            event=up qos=0 topic=au915_0/gateway/f80332fffe02615a/event/up uplink_id=66504276
INFO[84243] integration/mqtt: publishing event            event=stats qos=0 topic=au915_0/gateway/f80332fffe02615a/event/stats
INFO[84244] backend/basicstation: uplink frame received   gateway_id=f80332fffe02615a uplink_id=1986378941
INFO[84244] integration/mqtt: publishing event            event=up qos=0 topic=au915_0/gateway/f80332fffe02615a/event/up uplink_id=1986378941
..........

I have tested with a Raspberry Pi with the same binaries and configuration files and it works. The only difference is mosquitto version. On my custom gateway mosquitto is version 1.5.3 while on Raspberry Pi it is 2.0.11. But it is strange because chirpstack-gateway-bridge can connect and send messages to mosquitto broker on my custom gateway.

I was just looking at chirpstack’s source code more specifically here: chirpstack/chirpstack/src/integration/mqtt.rs at 3d470c6a14bf7fdd869e354946e6b37580c03e29 · chirpstack/chirpstack · GitHub

And it seems chirpstack is using MQTT v5. The mosquitto version on my custom gateway is v1.5.3 which does not seems to support MQTT v5. Maybe that’s why it’s not working.

I will try to update mosquitto on my gateway to a more recent version and report back here how that goes.

I have cross compiled mosquitto v2.0.20 and ran it on my gateway. But still chirpstack does not seem to be able connect to it.

chirpstack-gateway-bridge can connect to this updated version of mosquitto with no problem.

Now I’m out of ideas again.

So I think I figured out the issue. I’ve added some additional print logs at the code and I found the application hangs right at the moment where it tries to generate a random client_id, since I didn’t have client_id configured on toml file.

Here: chirpstack/chirpstack/src/integration/mqtt.rs at f265a815a6b8efe908185bc4c78bd68b9c2bb8e9 · chirpstack/chirpstack · GitHub

I also noticed that the same method is used to generate random number in other parts of the code.

My Linux gateway does not seem to have /dev/random, only /dev/urandom. Also it does not seem to have entropy available.

# cat /proc/sys/kernel/random/entropy_avail
0

On the contrary, Raspberry Pi returns 256 on entropy_avail.

Is there any other way to generate random numbers in Rust? Maybe something based on timestamp? Would this change affect chirpstack’s functionality?

My gateway has AM3352BZCZ60 ARM Cortex-A8 600MHz 32-bit 256MB of RAM.

I cross compiled haveged for my gateway and executed it. And entropy_avail now got to 128.

# cat /proc/sys/kernel/random/entropy_avail
128

This way it looks like chirpstack is running correctly. I could access the web interface, add the gateway itself and see Lora packets getting in!

Now I’ve ran to another issue. The javascript codecs are not working.

Code: UPLINK_CODEC Level: ERROR
level:"ERROR"
code:"UPLINK_CODEC"
description:"JS error: Error: interrupted "

Chirpstack logs don’t show any errors. The same codecs work on Raspberry Pi.

My gateway has AM3352BZCZ60 ARM Cortex-A8 600MHz 32-bit 256MB of RAM.

So it seems like increasing code timeout solves “JS error interrupted”.

# Codec configuration.
[codec]

  # JS codec configuration.
  [codec.js]

    # Maximum execution time.
    max_execution_time="1000ms"
1 Like

Oh that’s a good shout, solves this guys problem:

Although his codec was extremely small so its strange that it would have hit the cap in the first place.

@brocaar Could you please take a look at my findings and briefly explain to me about the entropy_avail and the JS error? Although I could solve the issues, is my processor not good enough to run Chirpstack?

AM3352BZCZ60 ARM Cortex-A8 600MHz 32-bit 256MB of RAM

May be the CPU of your “server” is too slow to execute the JS in 1s?