mirror of
https://github.com/AkitaEngineering/Akita-Meshtastic-Meshcore-Bridge.git
synced 2026-10-31 01:42:01 +01:00
3.1 KiB
3.1 KiB
Akita Meshtastic Meshcore Bridge Deployment Guide
Prerequisites
- Python 3.10+ (recommended: 3.11 or 3.12)
- All hardware connected and serial ports identified
- MQTT broker (if using MQTT transport)
- A dedicated OS user that can access the serial devices (usually
dialout)
Installation
- Clone the repository:
git clone https://github.com/AkitaEngineering/Akita-Meshtastic-Meshcore-Bridge.git cd Akita-Meshtastic-Meshcore-Bridge - Create and activate a virtual environment:
python -m venv .venv # Windows: .venv\Scripts\activate # Linux/macOS: source .venv/bin/activate - Install dependencies:
pip install -r requirements.txt
Configuration
- Copy
examples/config.ini.exampleto/etc/ammb/config.ini(orconfig.iniin the working directory). - Set the correct serial port, baud rate, MQTT, and API settings.
- Ensure
SERIAL_PROTOCOLmatches your device (companion_radiofor MeshCore USB). - For production MQTT, enable TLS (
MQTT_TLS_ENABLED = True) and set credentials. - If the REST API is enabled, set
API_TOKENand keepAPI_HOST = 127.0.0.1unless you terminate TLS at a reverse proxy.
Production entry point
Use the headless production runtime:
python run_bridge.py --config /etc/ammb/config.ini
The same bridge is also available as:
python run_bridge_async.py --config /etc/ammb/config.ini
That wrapper adds an optional in-process FastAPI server. It is not a second protocol implementation.
Before first start:
python run_bridge_tui.py --check --config /etc/ammb/config.ini
systemd
A unit file lives at packaging/ammb.service.
- Copy the application to
/opt/ammband the unit to/etc/systemd/system/ammb.service. - Create user
ammband add it todialout. - Install the venv and config as referenced in the unit.
- Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now ammb.service
sudo systemctl status ammb.service
The unit restarts on failure. Watch logs with journalctl -u ammb.service -f.
The production entry points handle systemd's SIGTERM and flush message logs
before exiting. Fatal preflight findings prevent startup and are reported in the
journal; run the explicit --check command for the full diagnostic report.
Operational Notes
- Only one process can access a serial port at a time.
MESHTASTIC_RETRY_ON_BOOT = Truekeeps the process running if a radio appears after boot.- Optional
MESSAGE_LOG_FILEwrites forwarded messages as JSON lines. - Monitor
/api/healthwhen the API is enabled (Authorization: Bearer <token>if configured). - To update, pull the latest code, reinstall requirements if needed, and restart the service.
Troubleshooting
- Serial port access denied: Ensure no other process is using the port and the service user is in
dialout. - No messages/events: Check device connection and config. Enable debug logging for more details.
- API 401: An
API_TOKENis configured. SendAuthorization: Bearer <token>orX-API-Token.
Support
- See README.md for more details and contact info.