From 1eb6330e6bf6d2e846ca82973cc5a18e9da4461e Mon Sep 17 00:00:00 2001 From: pdxlocations Date: Wed, 27 Nov 2024 13:05:26 -0800 Subject: [PATCH] update readme --- README.md | 20 +++++++++++++++++++- tx_message_handler.py | 3 +-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1333ed7..40c4d07 100644 --- a/README.md +++ b/README.md @@ -1 +1,19 @@ -TODO +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 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``` + +Example: + +To publish a message to the broker using settings defined in config.json: +``` python3 mqttc.py --message "I need an Alpinist"``` + diff --git a/tx_message_handler.py b/tx_message_handler.py index 32e9647..a127b36 100644 --- a/tx_message_handler.py +++ b/tx_message_handler.py @@ -36,10 +36,9 @@ def generate_mesh_packet(encoded_message): global message_id message_id = get_message_id(message_id) - node_number = int(config.node.id.replace("!", ""), 16) mesh_packet = mesh_pb2.MeshPacket() mesh_packet.id = message_id - setattr(mesh_packet, "from", node_number) + setattr(mesh_packet, "from", config.node.number) mesh_packet.to = config.destination_id mesh_packet.want_ack = False mesh_packet.channel = generate_hash(config.channel.preset, config.channel.key)