mqtt2push is a lightweight Go daemon that subscribes to MQTT topics and forwards incoming messages as push notifications to iOS, Android, and web clients.
- Subscribe to multiple MQTT topics
- MQTT wildcard support
- MQTT QoS 0, 1 and 2
- Username/password authentication
- Plain MQTT
- MQTT over TLS
- Custom CA certificates
- Automatic reconnect
- Automatic re-subscription after reconnect
- Lightweight standalone binary
- No inbound ports required
- iOS and Android push notifications
- Open source
Go to /usr/src:
cd /usr/srcDownload the current git repository:
git clone git@github.com:signalgridco/mqtt2push.gitcd into the mqtt repo:
cd mqtt2pushBuild from source:
go mod tidy
go build -o mqtt2pushDone. Next, you need to configure the config.yml
mqtt:
broker: "mqtt.example.com"
port: 1883
topics:
- "alerts/#"
- "servers/+/status"
username: "mqttuser"
password: "mqttpassword"
qos: 0
client_id: "mqtt2push"
tls:
enabled: false
signalgrid:
client_key: "YOUR_CLIENT_KEY"
channel: "YOUR_CHANNEL"
type: "INFO"When TLS is disabled, the connection is made using plain MQTT over TCP.
If port is omitted, 1883 is used automatically.
mqtt:
broker: "mqtt.example.com"
port: 8883
topics:
- "alerts/#"
- "servers/+/status"
username: "mqttuser"
password: "mqttpassword"
qos: 0
client_id: "mqtt2push"
tls:
enabled: true
signalgrid:
client_key: "YOUR_CLIENT_KEY"
channel: "YOUR_CHANNEL"
type: "INFO"When TLS is enabled without a custom CA file, mqtt2push uses the
operating system's normal trusted CA store. If port is omitted, 8883
is used automatically.
mqtt:
broker: "mqtt.internal.example"
port: 8883
topics:
- "factory/alarms/#"
username: "mqttuser"
password: "mqttpassword"
qos: 1
client_id: "mqtt2push"
tls:
enabled: true
ca_file: "/etc/mqtt2push/company-ca.pem"
signalgrid:
client_key: "YOUR_CLIENT_KEY"
channel: "YOUR_CHANNEL"
type: "INFO"The custom CA certificate is added to the operating system's existing trusted CA store.
Push notification delivery is provided by Signalgrid.
A Signalgrid account and channel are required to obtain the client_key
and channel values used in config.yml.
Once configured, mqtt2push receives MQTT messages from your broker and
forwards them to the configured Signalgrid channel for delivery to your
devices.
You can create your account here.
Multiple MQTT subscriptions can be configured:
topics:
- "factory/alarms/#"
- "servers/+/status"
- "network/core/events"Normal MQTT wildcards are supported.
mqtt2push does not interpret or transform the MQTT payload.
The MQTT topic:
factory/line1/alarm
is used as the notification title and displayed as:
factory · line1 · alarm
The MQTT payload:
Motor temperature exceeded 80°C
is used directly as the notification body.
Place config.yml next to the executable:
mqtt2push
config.yml
Start the bridge:
./mqtt2pushExample output:
Connected to MQTT broker mqtt.example.com:1883
Subscribed to alerts/# with QoS 0
Topic: alerts/server1 | Message: Server unavailable | Response: 200 OK