AERP is a host-side Python CLI for sending emergency alerts, acknowledgements, and all-clear messages over a Meshtastic mesh. It is aimed at Search & Rescue (SAR), disaster response, and remote teams that want a simple laptop or single-board-computer workflow attached to a Meshtastic radio.
Website: https://www.akitaengineering.com
- Emergency, ACK, and CLEAR messages are sent as JSON bytes using the current Meshtastic Python API.
- Incoming alerts work with both raw private-port numbers and Meshtastic's
PRIVATE_APPalias. - Proximity alerts recognize standard Meshtastic
decoded.positionpackets. - Local GPS and battery telemetry are read from Meshtastic's node database when available.
This repository is an external operator tool, not a Meshtastic firmware module. Converting it to ESP-IDF would mean maintaining custom device firmware or integrating directly into Meshtastic itself.
For most SAR teams, the current host-side approach is the safer choice:
- easier to update and validate before deployment
- easier to log operator actions during incidents
- no custom firmware maintenance burden on every field radio
- works with existing Meshtastic hardware and Python tooling
If you eventually need fully autonomous on-device alerting with no attached host, that should be a separate firmware project rather than a direct conversion of this CLI.
- Python
>=3.9,<3.15to match the currentmeshtasticpackage requirement - a Meshtastic radio connected over serial or reachable over TCP
- dependencies from
requirements.txt - (Optional)
customtkinterfor the Graphical Dashboard.
- Clone the repository.
git clone https://github.com/AkitaEngineering/Akita-Emergency-Response-Plugin.git
cd Akita-Emergency-Response-Plugin- Create and activate a virtual environment, then install dependencies.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Copy a config template.
cp config/aerp_config.example.json config/aerp_config.jsonFor a SAR-oriented starting profile, use:
cp config/aerp_config.sar.example.json config/aerp_config.json- Run the CLI.
python -m aerp.cli --config config/aerp_config.jsonFor TCP-connected devices:
python -m aerp.cli --host <ip_or_hostname> --config config/aerp_config.jsonFor an explicit serial device path:
python -m aerp.cli --device /dev/ttyUSB0 --config config/aerp_config.jsonFor detailed troubleshooting output:
python -m aerp.cli --device /dev/ttyUSB0 --config config/aerp_config.json --debugIf the config file does not exist, AERP creates a default JSON config at the path passed to --config.
AERP includes a beautiful, fully-featured dark-mode graphical dashboard (customtkinter required). To launch it:
python -m aerp.gui --config config/aerp_config.jsonThe GUI allows you to explicitly connect to a radio, monitor logs precisely, track incoming incidents, and manage broadcasts visually using a high-contrast Red/Black/Gray interface.
--device /path/to/serial: connect to a radio over a specific serial device.--host <ip_or_hostname>: connect to a Meshtastic TCP endpoint.--no-serial: skip serial autodetect when you only want TCP.--debug: enable verbose logging for connection and packet handling.
startstarts broadcasting emergency messages.stopstops broadcasting and sends an all-clear for the active emergency.clearsends an all-clear for the last sent emergency when no broadcast is active.statusprints local state, received ACKs, and active inbound emergencies.helpprints command help.exitorquitstops the CLI.
Edit config/aerp_config.json with these keys:
interval: seconds between broadcasts, must be greater than0emergency_port: Meshtastic port number from0to511; all participating nodes must matchemergency_message: default alert textalert_radius: proximity-alert radius in meters;0disables itack_timeout: seconds before an ACK is considered staleplugin_enabled_by_default: auto-start emergency broadcasting on launch whentrue
The file must be valid JSON with no comments.
- Confirm the radio is connected and has the correct Meshtastic channel and team port.
- Start AERP and run
statusto verify the local node ID is available. - Use
startonly for a real drill or incident; AERP begins recurring broadcasts immediately. - Watch
statusfor acknowledgements and other active emergencies on the mesh. - Use
stopwhen the incident is over so AERP halts broadcasts and sendsAERP_CLEAR. - If the process restarts after a resolved incident, use
clearonly when you need to manually clear the last recorded emergency ID.
- Pick a dedicated team port in the private range and standardize it across every node. The SAR example uses
300to avoid relying on Meshtastic's genericPRIVATE_APPdefault. - Keep the broadcast interval between
30and60seconds unless you have tested battery impact under realistic field conditions. - Set
ack_timeoutto at least3xthe broadcast interval so brief network fades do not make acknowledgements look stale. - Configure a fixed position on radios that may operate without live GPS. AERP can only include location that Meshtastic already knows about.
- Run the CLI on stable, field-chargeable hardware such as a rugged laptop or Raspberry Pi with a power bank.
- Perform radio-to-radio drills before deployment. LoRa coverage, terrain shadowing, and node placement matter more than application logic.
- If the CLI cannot determine the local node ID, wait a few seconds after connecting and run
statusagain. - If alerts are not received, verify every participant uses the same
emergency_portand Meshtastic channel. - If acknowledgements appear to expire too quickly, increase
ack_timeoutrelative tointerval. - If GPS is missing from alerts, confirm the radio has either live GPS or a configured fixed position in Meshtastic.
- If serial autodetect fails, retry with
--device /dev/ttyUSB0or the correct platform-specific device path.
Run the built-in regression checks with:
python -m unittest discover -s tests -vThis project is licensed under the GNU General Public License v3.0 (GPLv3). See LICENSE for details.