Skip to content

Bridge Mode

The bridge mode forwards MQTT beacon and gateway data to Zabbix for monitoring. It is implemented in server/src/bridge.ts.

Overview

The bridge acts as a translator between the MQTT beacon/gateway protocol and Zabbix's monitoring system. It can run standalone (bridge-only) or alongside the full SafeCall server.

How It Works

  1. Cache: Periodically fetches the list of known beacons and gateways from the SafeCall REST API
  2. Filter: Only processes MQTT messages for devices that exist in the cache
  3. Throttle: Applies configurable delays between updates to avoid flooding Zabbix
  4. Send: Forwards device metrics to Zabbix via ZabbixSender

Data Forwarded

Beacon Data (from adv1/adv4/adv8)

  • Battery level
  • Temperature
  • Humidity
  • SOS/panic button state
  • Signal strength

Gateway Data (from alive messages)

  • IP address
  • Uptime
  • Firmware version
  • Last seen timestamp

Configuration

KeyDescription
bridge_mqtt_urlMQTT broker URL
bridge_mqtt_userMQTT username
bridge_mqtt_passMQTT password
bridge_server_urlSafeCall server URL (for REST cache)
bridge_zabbix_hostZabbix server hostname
bridge_zabbix_portZabbix server port
bridge_endpoint_beaconREST endpoint for beacon list
bridge_endpoint_gatewayREST endpoint for gateway list
bridge_delay_beaconMinimum seconds between beacon updates
bridge_delay_gatewayMinimum seconds between gateway updates
bridge_cache_update_intervalSeconds between cache refreshes

LLD Integration

The bridge also supports Zabbix Low-Level Discovery (LLD). The server exposes LLD endpoints:

  • GET /lld/beacons — Returns beacon discovery data in LLD format
  • GET /lld/gateways — Returns gateway discovery data in LLD format

These are consumed by Zabbix to automatically create monitoring items for new devices.

Standalone Mode

When server_features contains only "bridge", the server starts in standalone bridge mode. This only requires MQTT and Zabbix configuration — no database, HTTP server, or JWT setup is needed.