Metadata-Version: 2.3
Name: mmqtt
Version: 1.0.6
Summary: This library may be useful for testing Meshtastic networks connected to an MQTT server.
License: GPL-3.0-only
Author: Ben Lipsey
Author-email: ben@pdxlocations.com
Requires-Python: >=3.9,<3.14
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: cryptography (>=43.0.3,<44.0.0)
Requires-Dist: meshtastic (>=2.6.0,<3.0.0)
Requires-Dist: paho-mqtt (>=2.1.0,<3.0.0)
Description-Content-Type: text/markdown

This project is useful for testing Meshtastic networks connected to an MQTT server. Functions can be called in mqttc.py or by using arguments in the command line.

## Available functions:

```
send_nodeinfo(short_name, long_name, hw_model)
send_position(lat, lon, alt, precision)
send_device_telemetry(battery_level, voltage, chutil, airtxutil, uptime)
send_text_message("text")
```

## Available arguments:

```
  -h, --help             show this help message and exit
  --config CONFIG        Path to the config file
  --message MESSAGE      The message to send
  --lat LAT              Latitude coordinate
  --lon LON              Longitude coordinate
  --alt ALT              Altitude
  --precision PRECISION  Position Precision
```

## Examples:

To publish a message to the broker using settings defined in config.json:
```
python3 mqttc.py --message "I need an Alpinist"
```

To publish a message to the broker using settings defined in my-config.json:
```
python3 mqttc.py --config "my-config.json" --message "I need an Alpinist"
```


## Installation:
```
git clone https://github.com/pdxlocations/MQTTc-for-Meshtastic.git
cd MQTTc-for-Meshtastic
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

Rename config-example.json and edit configuration:
```
sudo mv config-example.json config.json
sudo nano config.json
```

