python icon indicating copy to clipboard operation
python copied to clipboard

Update Python CLI Guide

Open roberthadow opened this issue 8 months ago • 4 comments

The following meshtastic command arguments don't work reliably. They either need to be fixed or the documentation updated:

--test This argument throws the following error message: "Test module could not be important. Ensure you have the 'dotmap' module installed."

--reply This argument results in a connection to the radio, then no further apparent action. Eventually, it fails with the following error message: Exception in thread Thread-2: Traceback (most recent call last): File "/home/rhadow/miniconda3/lib/python3.12/threading.py", line 1073, in _bootstrap_inner self.run()

--set-owner-short This argument does not reliably reset the last four characters of the MAC address to uppercase. At least, it doesn't always stick.

--dest user.id (i.e. --dest '!b03bb4f8') works fine; num (i.e. --dest 2956702968) doesn't. The best you can hope for is "Received an implicit ACK. Packet will likely arrive, but cannot be guaranteed." What is an implicit ACK?

roberthadow avatar Apr 13 '25 15:04 roberthadow

The --test error is caused by dotmap not being installed because in the pyprojecttoml it is marked as optional. On a poetry install you need the --all-extras flag or --extras cli so the exception message could be clarified to "Test module could not be important. Ensure you have the 'dotmap' module installed. Did you use --all-extras with poetry install?" or removing the optional in the toml dotmap = { version = "^1.3.30" } Do you have a preference on which?

rc14193 avatar Jun 29 '25 15:06 rc14193

I have no preference. I never used a poetry install, to the best of my recollection.

That raises another point: CRUD. If one can install dotmap (create), there whould be a way to verify its installation (read), and eliminate it (delete).

roberthadow avatar Jul 01 '25 21:07 roberthadow

Ok I glazed over the make file. I see it uses pip by default. Maybe it's more that there needs to be a BUILD.md of some kind? The poetry lock file just stood out to me so I assumed poetry as the default and have been using that.

Is anyone really set on keeping dotmap? I think it could be eliminated since it's not pulled in the default pip install. There's other onReceive functions that don't use it and from what I see test.py is the only place it's used (it's also in mesh_interface.py but those lines are commented out).

If Dotmap is still wanted the make file could be changes to add a new command for when someone wants to run --test

rc14193 avatar Jul 04 '25 13:07 rc14193

As to implicit ACK, it seems that this is an acknowledgement that the message was received by some other node and perhaps retransmitted. There's a big assumption that the destination node is alive in the mesh within n hops. I suggest that implicit ACK is an unfortunate choice of working. Received and forwarded or Receved and forwarded. Delivery not guaranteed would be better..

roberthadow avatar Jul 04 '25 18:07 roberthadow