Cannot receive "state" gateway MQTT topic messages

After setting next config line in MQTT integration configuration section of chirpstack-gateway-bridge.toml file:

# State topic template.
state_topic_template="eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }}"

And then, configure a Node-RED MQTT node in order to receive topic messages:

+/gateway/7076ff0056081d01/state/#

We receive 1 message like next one, but nothing else.

{
  gatewayId: "7076ff0056081d01",
  state: "ONLINE"
}

Is this correct? Or should we receive periodic state events?

You only receive a message on gateway connect / disconnect. So if your gateway connected and staid connected, then what you are seeing is normal :slight_smile:

Thanks for the answer. Related to this, once subscribed to gateway/+/state/conn topic in order to monitor gateway status, I do not receive state value in json content when a gateway goes offline. Is this correct?

You should receive an offline state. Wether this is in JSON or Protobuf depends on the configuration of the ChirpStack MQTT Forwarder.

I’m receiving state: ONLINE when a gateway is connected, but if it disconnects, I only receive gatewayId: <id>, without state param inside JSON payload. Is this ok?

Yes, that might be correct. As Protobuf does not send default values, the field might not be set. When decoding the value using the Protobuf definition, it would set the default value, which is OFFLINE.