Skip to main content

xmpp2mqtt

xmpp2mqtt is a daemonizable microservice that bridges XMPP chats with MQTT endpoints so automation tooling that only understands MQTT/HTTP can exchange messages with XMPP users. The service logs into an XMPP account via slixmpp, subscribes/publishes MQTT topics via paho-mqtt, and relays messages in both directions using JSON payloads.

Status

In development, somewhat useable

Configuration

Create a JSON file (e.g. ~/.config/xmpp2mqtt.cfg, location os overrideable with a CLI parameter) with at least the following structure:

{
  "xmpp": {
    "jid": "bot@example.com/resource",
    "password": "changeme",
    "host": "xmpp.example.com",
    "port": 5222,
    "use_tls": true,
    "verify_tls": true,
    "use_ipv6": false,
    "allowed_jids": {
      "receive": ["trusted-user@example.com"],
      "send_only": ["notify-only@example.com"]
    }
  },
  "mqtt": {
    "host": "mqtt.example.com",
    "port": 8883,
    "username": "xmpp2mqtt",
    "password": "secret",
    "keepalive": 60,
    "inbound_topics": ["xmpp/bridge/in"],
    "outbound_topics": ["xmpp/bridge/out"],
    "qos": 1
  },
  "backoff": {
    "initial": 1.0,
    "max": 60.0,
    "jitter": 0.5
  },
  "logging": {
    "level": "debug"
  }
}

Notes:

  • Empty topic lists are allowed; the service simply skips bridging for that direction.
  • mqtt.inbound_topics are the publish targets for messages received via XMPP (XMPP -> MQTT).
  • mqtt.outbound_topics are the subscriptions for payloads that should be delivered to XMPP peers (MQTT -> XMPP).
  • allowed_jids.receive implies send permission as well. send_only grants transmit privilege without accepting inbound chats.
  • Additional sections (REST, HTTP TLS, etc.) will be defined once the REST bridge is implemented.

CLI Overview

xmpp2mqtt start [--foreground] [--cfg path] [--logfile path] [--pidfile path]
xmpp2mqtt stop [--pidfile path]
xmpp2mqtt status [--pidfile path]
  • start --foreground keeps the process attached to the terminal with stdout/stderr logging.
  • Background mode writes logs to the configured file; use newsyslog for rotation.

Metadata

Release files for xmpp2mqtt 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xmpp2mqtt 0.1.0
File Size Uploaded
xmpp2mqtt-0.1.0.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xmpp2mqtt 0.1.0
File Interpreter ABI Platform
xmpp2mqtt-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.2 kB

Release files / xmpp2mqtt-0.1.0.tar.gz

Download URL xmpp2mqtt-0.1.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
af553d3e759242bc0c039505bb0a6e93cd44401ee3bdd1e705b5f890ead85079
BLAKE2b-256 checksum
How to use checksums
4773de117d3f8c97ab76d876aca4159ef1485e0973621066aa5350c6f2dd461d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / xmpp2mqtt-0.1.0-py3-none-any.whl

Download URL xmpp2mqtt-0.1.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb2a932658d55ce9dd3e00fb2979a5d34348091876e3e65d1c94ebfe949f447d
BLAKE2b-256 checksum
How to use checksums
39a7c8abced91a3477bfcdcbd75dc4d0903368a677bef549f342df1d14be550e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page