This commit introduces a `MAGIC_PREFIX` (`🌐 `) that is prepended to
every message forwarded from the internet (XMPP) onto the local
Meshtastic mesh.
The `on_meshtastic_receive` handler has been updated to ignore any
incoming messages on the mesh that start with this prefix. This
prevents multiple bridges running in the same physical mesh network
from continually forwarding the same message back and forth, creating
an infinite communication loop.
Co-authored-by: jamessucla <2191476+jamessucla@users.noreply.github.com>
This commit updates `bridge.py` to properly `await` the `join_muc_wait()`
coroutine instead of calling the deprecated `join_muc()`. This prevents
an unretrieved Task exception (`asyncio.TimeoutError`) from polluting
the logs or crashing the background task if the XMPP server is slow
or doesn't respond to the MUC join request in time.
Co-authored-by: jamessucla <2191476+jamessucla@users.noreply.github.com>
This commit resolves an `AttributeError` when starting the `SovereignBridge`
class due to the missing `process` method. Newer versions of `slixmpp` (1.8+)
leverage the standard `asyncio` loop directly and no longer provide the
legacy `process(forever=True)` wrapper.
The bridge now correctly starts the XMPP client by calling
`xmpp.loop.run_forever()` directly after `xmpp.connect()`.
Co-authored-by: jamessucla <2191476+jamessucla@users.noreply.github.com>
This commit introduces a MVP for the sovereign computing hackathon. It
provides a Python-based bridge between a local Meshtastic node and an
internet-connected XMPP Multi-User Chat room.
Features:
- `bridge.py`: Uses `meshtastic` and `slixmpp` to bridge messages bidirectionally.
- Properly handles asynchronous/synchronous impedance mismatch between XMPP and serial interfaces.
- Avoids infinite loop echo chambers.
- `flake.nix`: Packages the Python script and its dependencies.
- Exposes a NixOS module for configuring the bridge as a persistent systemd service.
- Requires `--password-file` to prevent exposing XMPP passwords in process listings.
- `README.md`: Explains architecture, usage, and how to configure the NixOS module.
Co-authored-by: jamessucla <2191476+jamessucla@users.noreply.github.com>