Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pdxlocations committed Nov 27, 2024
1 parent e9bee85 commit 1eb6330
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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"```
3 changes: 1 addition & 2 deletions tx_message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1eb6330

Please sign in to comment.