SInce bluetooth/Android are a bit of a struggle to get & remain connected, I though that I would give the Python API a try - but I have very little experience with Python so the comment ```# By default will try to find a meshtastic device, otherwise provide a device path like /dev/ttyUSB0 doesn’t help as I do not know how to change the path. Could anyone provide the alternative code to replace:
Thanks for the feedback, so now I’ve got past that difficulty.
But now __init__py is throwing up multiple syntax errors, of which this is just one of the reported code lines with a syntax error:
logging.error(“Subclass must provide toradio: {toRadio}”)
I have deleted all the logging.error lines, only to be greeted with an Exception error
"Multiple ports detected, you must specify a device, such as {ports[0].device}
I’m tempted to give up for now & come back in a few months time.
It looks like you might be trying to use this library with Python 2. It requires python3 (or later). pip will only install this on python 3 based systems, so I’m not sure why python 2 found it in its PYTHON_PATH.
(alternatively, can you post a longer log of the error messages - including the run of the python command and your code and I can help take a look)
Thank you greatly for your response. After installing python3.6, (got source, compiled locally) I am still unable to get it to work, just trying the basic “meshtastic -h” to test before using it in a script such as Meshtalk. It seems f-strings are still an issue in my environment. Note the hardware, maybe I should just be using this on an RPi?
linaro@tinkerboard:~/meshtalk$ which python3.6
/usr/local/bin/python3.6
linaro@tinkerboard:~/meshtalk$ alias python='/usr/local/bin/python3.6'
linaro@tinkerboard:~/meshtalk$ python -V
Python 3.6.9
linaro@tinkerboard:~/meshtalk$ meshtastic -h
Traceback (most recent call last):
File "/usr/local/bin/meshtastic", line 7, in <module>
from meshtastic.__main__ import main
File "/usr/local/lib/python3.5/dist-packages/meshtastic/__init__.py", line 118
logging.error(f'An exception of type {exc_type} with value {exc_value} has occurred')
Asus Tinker Board, ARMv7 Processor rev 1 (v7l)
Linux version 4.4.132+ (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) ) #8
You’ve aliased python to python3.6 in your shell, but meshtastic’s script (and probably meshtalk) isn’t using your shell at all. You’ll likely need to edit the meshtastic script (vi $(which meshtastic)), as mine starts with this:
#!/usr/bin/python3
You’ll need to change it to
#!/usr/local/bin/python3.6
For meshtalk / meshwatch.py, you should be able to invoke it directly with the python3.6 interpreter – /usr/local/bin/python3.6 ./meshtalk/meshwatch.py