MQTT Error Message with Tektelic Kona Micro

Hello,

We are trying to connect a Tektelic Kona Micro Gateway and it proves to be a frustrating process. Here is what is at play here and the error message.

Gateway : Tektelic Kona Micro (up to date) /hereby named “device”
Chipstack-gateway-bridge : Installed and running on Device
Chirpstack Instance : Full install and functional on GCS VM

after installing the bridge and updating the config.json file and .toml file, we get an error message:

Mar 10 12:51:09 kona-micro monit[1910]: ‘chirpstack-gateway-bridge’ stop on user request
Mar 10 12:51:09 kona-micro monit[1910]: Monit daemon with PID 1910 awakened
Mar 10 12:51:09 kona-micro monit[1910]: Awakened by User defined signal 1
Mar 10 12:51:09 kona-micro monit[1910]: ‘chirpstack-gateway-bridge’ stop: ‘/bin/bash -c /etc/init.d/chirpstack-gateway-bridge stop’
Mar 10 12:51:09 kona-micro chirpstack-gateway-bridge[19871]: time=“2021-03-10T12:51:09Z” level=info msg=“signal received” signal=terminated
Mar 10 12:51:09 kona-micro chirpstack-gateway-bridge[19871]: time=“2021-03-10T12:51:09Z” level=warning msg=“shutting down server”
Mar 10 12:51:10 kona-micro monit[1910]: ‘chirpstack-gateway-bridge’ stop action done
Mar 10 12:51:14 kona-micro tek_mqtt_bridge[1888]: [DEBUG ] bridge_mqtt.c:81 MQTT initializing
Mar 10 12:51:17 kona-micro tek_mqtt_bridge[1888]: [ERROR ] bridge_mqtt.c:131 failed to connect with MQTT code: 4
Mar 10 12:51:17 kona-micro tek_mqtt_bridge[1888]: [ERROR ] main.c:795 cannot initialize MQTT
Mar 10 12:51:17 kona-micro tek_mqtt_bridge[1888]: [INFO ] main.c:783 initiating bridge restart
Mar 10 12:51:19 kona-micro monit[1910]: ‘chirpstack-gateway-bridge’ start on user request
Mar 10 12:51:19 kona-micro monit[1910]: Monit daemon with PID 1910 awakened
Mar 10 12:51:19 kona-micro monit[1910]: Awakened by User defined signal 1
Mar 10 12:51:19 kona-micro monit[1910]: ‘chirpstack-gateway-bridge’ start: ‘/bin/bash -c /etc/init.d/chirpstack-gateway-bridge start’
Mar 10 12:51:19 kona-micro monit[1910]: ‘chirpstack-gateway-bridge’ start action done
Mar 10 12:51:19 kona-micro chirpstack-gateway-bridge[23079]: time=“2021-03-10T12:51:19Z” level=info msg=“starting ChirpStack Gateway Bridge” docs=xxxxx://www.chirpstack.io/gateway-bridge/" version=3.10.0
Mar 10 12:51:19 kona-micro chirpstack-gateway-bridge[23079]: time=“2021-03-10T12:51:19Z” level=info msg=“backend/semtechudp: starting gateway udp listener” addr=“127.0.0.1:1700
Mar 10 12:51:22 kona-micro chirpstack-gateway-bridge[23079]: time=“2021-03-10T12:51:22Z” level=info msg=“integration/mqtt: connected to mqtt broker”
Mar 10 12:51:22 kona-micro chirpstack-gateway-bridge[23079]: time=“2021-03-10T12:51:22Z” level=warning msg="[store] memorystore wiped" module=mqtt
Mar 10 12:51:37 kona-micro tek_mqtt_bridge[1888]: [DEBUG ] bridge_mqtt.c:81 MQTT initializing
Mar 10 12:51:40 kona-micro tek_mqtt_bridge[1888]: [ERROR ] bridge_mqtt.c:131 failed to connect with MQTT code: 4
Mar 10 12:51:40 kona-micro tek_mqtt_bridge[1888]: [ERROR ] main.c:795 cannot initialize MQTT
Mar 10 12:51:40 kona-micro tek_mqtt_bridge[1888]: [INFO ] main.c:783 initiating bridge restart
Mar 10 12:51:44 kona-micro chirpstack-gateway-bridge[23079]: time=“2021-03-10T12:51:44Z” level=info msg=“integration/mqtt: publishing event” event=stats qos=0 stats_id=4c397712-6f17-4c69-a410-f5e5422d4f43 topic=/devices/gw-647fdafffe007db4/events/stats
Mar 10 12:51:57 kona-micro chirpstack-gateway-bridge[23079]: time=“2021-03-10T12:51:57Z” level=info msg=“integration/mqtt: subscribing to topic” qos=0 topic="/devices/gw-647fdafffe007db4/commands/#"
Mar 10 12:52:00 kona-micro tek_mqtt_bridge[1888]: [DEBUG ] bridge_mqtt.c:81 MQTT initializing
Mar 10 12:52:02 kona-micro tek_mqtt_bridge[1888]: [ERROR ] bridge_mqtt.c:131 failed to connect with MQTT code: 4
Mar 10 12:52:02 kona-micro tek_mqtt_bridge[1888]: [ERROR ] main.c:795 cannot initialize MQTT
Mar 10 12:52:02 kona-micro tek_mqtt_bridge[1888]: [INFO ] main.c:783 initiating bridge restart
root@kona-micro:/var/log#

Config.json file
{
“SX1301_array_conf”:[
{
“board_freq_band”: “US915”,
“SX1301_conf”:[
{
“chip_enable”: true,
“chan_multiSF_0”: {“chan_rx_freq”: 903900000, “spread_factor”: “7-10” },
“chan_multiSF_1”: {“chan_rx_freq”: 904100000, “spread_factor”: “7-10” },
“chan_multiSF_2”: {“chan_rx_freq”: 904300000, “spread_factor”: “7-10” },
“chan_multiSF_3”: {“chan_rx_freq”: 904300000, “spread_factor”: “7-10” },
“chan_multiSF_4”: {“chan_rx_freq”: 904700000, “spread_factor”: “7-10” },
“chan_multiSF_5”: {“chan_rx_freq”: 904900000, “spread_factor”: “7-10” },
“chan_multiSF_6”: {“chan_rx_freq”: 905100000, “spread_factor”: “7-10” },
“chan_multiSF_7”: {“chan_rx_freq”: 905300000, “spread_factor”: “7-10” },
“chan_LoRa_std” : {“chan_rx_freq”: 904600000, “bandwidth”: 500000, “spread_factor”: 8 },
“chan_FSK” : {“chan_rx_freq”: 904600000, “bandwidth”: 250000, “bit_rate”: 100000 }
}],
“loramac_public”:true,
“aes_key”: “ABCDEF0123456789ABCDEF0123456789”
}],
“gateway_conf”: {
“server_address”: “127.0.0.1”,
“serv_port_up”: 1700,
“serv_port_down”: 1700,

/* adjust the following parameters for your network /
“keepalive_interval”: 60,
“stat_interval”: 60,
“push_timeout_ms”: 100,
/
forward only valid packets */
“forward_crc_valid”: true,
“forward_crc_error”: false,
“forward_crc_disabled”: false
}

}

chirpstack-gateway-bridge.toml

This configuration provides a Semtech UDP packet-forwarder backend and

integrates with a MQTT broker. Many options and defaults have been omitted

for simplicity.

See https://www.chirpstack.io/gateway-bridge/install/config/ for a full

configuration example and documentation.

[general]

debug=5, info=4, warning=3, error=2, fatal=1, panic=0

log_level=5

Log to syslog.

When set to true, log messages are being written to syslog.

log_to_syslog=true

Gateway backend configuration.

[backend]

Backend type.

type=“semtech_udp”

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 = “127.0.0.1:1700”

Integration configuration.

[integration]

Payload marshaler.

This defines how the MQTT payloads are encoded. Valid options are:

* protobuf: Protobuf encoding (this will become the ChirpStack Gateway Bridge v3 default)

* json: JSON encoding (easier for debugging, but less compact than ‘protobuf’)

marshaler=“protobuf”

MQTT integration configuration.

[integration.mqtt]

Event topic template.

event_topic_template=“gateway/{{ .GatewayID }}/event/{{ .EventType }}”

Command topic template.

command_topic_template=“gateway/{{ .GatewayID }}/command/#”

MQTT authentication.

[integration.mqtt.auth]
type=“gcp_cloud_iot_core”

[integration.mqtt.auth.gcp_cloud_iot_core]
server=“ssl://mqtt.googleapis.com:443”
device_id=“gw-647FDAFFFE007DB4”
project_id=“thingsfactorychirpstack”
cloud_region=“us-central1”
registry_id=“tf-gateways-registry”
jwt_key_file="/etc/chirpstack-gateway-bridge/rsa_private.pem"

#Edited by F Page - March 2021

any help would be appreciated.

Thanks

We’ve had issues with the Tektelic MQTT bridge package causing conflicts. I recommend removing it:

monit stop mqtt-bridge
killall -9 tek_mqtt_bridge
opkg remove tektelic-mqtt-bridge