meshtastic-mqtt-json/README.md

95 lines
4.3 KiB
Markdown
Raw Normal View History

2024-11-30 02:04:34 +00:00
# Meshtastic MQTT Parser
A lightweight Python library for parsing Meshtastic MQTT messages into JSON format. This tool makes it easy to build applications that interact with Meshtastic mesh networks via MQTT.
## Overview
This library connects to a Meshtastic MQTT broker and decodes various message types into JSON format, making it simple to process Meshtastic mesh network data in your Python applications.
## Features
- Connects to any Meshtastic MQTT broker
- Decrypts encrypted messages
- Parses all standard Meshtastic message types
- Outputs clean JSON format
- Message type filtering support
- Simple command-line interface
2024-11-30 03:56:16 +00:00
## Installation
Install from PyPI:
2024-11-30 02:04:34 +00:00
```bash
2024-11-30 04:02:21 +00:00
pip install meshtastic-mqtt-json
2024-11-30 02:04:34 +00:00
```
## usage
```bash
2024-11-30 04:02:21 +00:00
python meshtastic_mqtt_json [options]
2024-11-30 02:04:34 +00:00
```
2024-11-30 03:56:16 +00:00
```python
2024-11-30 04:02:21 +00:00
from meshtastic_mqtt_json import MeshtasticMQTT
2024-11-30 03:56:16 +00:00
client = MeshtasticMQTT()
client.connect(broker='mqtt.meshtastic.org', port=1883, root='msh/US/2/e/', channel='LongFast', username='meshdev', password='large4cats', key='AQ==')
```
2024-11-30 02:04:34 +00:00
### Command Line Options
2024-11-30 02:11:10 +00:00
| Option | Description | Default |
| ------------ | ------------------------------|---------------------- |
| `--broker` | MQTT broker address | `mqtt.meshtastic.org` |
| `--port` | MQTT broker port | `1883` |
| `--root` | Root topic | `msh/US/2/e/` |
| `--channel` | Channel name | `LongFast` |
| `--username` | MQTT username | `meshdev` |
| `--password` | MQTT password | `large4cats` |
| `--key` | Encryption key | `AQ==` |
| `--filter` | Filter specific message types | |
2024-11-30 02:04:34 +00:00
### Filter Example
```bash
2024-11-30 04:02:21 +00:00
python meshtastic_mqtt_json.py --filter "NODEINFO,POSITION,TEXT_MESSAGE"
2024-11-30 02:04:34 +00:00
```
## Supported Message Types
The library supports parsing of the following Meshtastic message types:
2024-11-30 02:08:40 +00:00
| Message Type | Description |
| ------------------------------- | ----------------------------- |
| **ADMIN_APP** | Administrative messages |
| **ATAK_FORWARDER** | ATAK forwarding messages |
| **ATAK_PLUGIN** | ATAK plugin messages |
| **AUDIO_APP** | Audio messages |
| **DETECTION_SENSOR_APP** | Sensor detection data |
| **IP_TUNNEL_APP** | IP tunneling messages |
| **NEIGHBORINFO_APP** | Neighbor information |
| **NODEINFO_APP** | Node information and details |
| **PAXCOUNTER_APP** | People counter data |
| **POSITION_APP** | GPS position updates |
| **PRIVATE_APP** | Private messages |
| **RANGE_TEST_APP** | Range testing data |
| **REMOTE_HARDWARE_APP** | Remote hardware control |
| **REPLY_APP** | Reply messages |
| **ROUTING_APP** | Routing information |
| **SERIAL_APP** | Serial communication |
| **SIMULATOR_APP** | Simulator messages |
| **STORE_FORWARD_APP** | Store and forward messages |
| **TELEMETRY_APP** | Device telemetry data |
| **TEXT_MESSAGE_APP** | Plain text messages |
| **TEXT_MESSAGE_COMPRESSED_APP** | Compressed text messages |
| **TRACEROUTE_APP** | Network route tracing |
| **WAYPOINT_APP** | Waypoint information |
| **ZPS_APP** | Zone/Position System messages |
2024-11-30 02:04:34 +00:00
2024-11-30 02:15:08 +00:00
## Roadmap
- [ ] Add support for custom node ID & names for the client
- [ ] Add support for custom MQTT servers besides the official Meshtastic server
- [ ] Create a PyPi package for easy import into other projects
- [ ] Create an examples folder with use cases for the library, such as an IRC relay, cli chat, logging, etc.
2024-11-30 02:08:40 +00:00
___
2024-11-30 04:02:21 +00:00
###### Mirrors for this repository: [acid.vegas](https://git.acid.vegas/meshtastic_mqtt_json) • [SuperNETs](https://git.supernets.org/acidvegas/meshtastic_mqtt_json) • [GitHub](https://github.com/acidvegas/meshtastic_mqtt_json) • [GitLab](https://gitlab.com/acidvegas/meshtastic_mqtt_json) • [Codeberg](https://codeberg.org/acidvegas/meshtastic_mqtt_json)