Error Running Meshtastic Python on Raspberry Pi

I had no problems installing the Python API on my Ubuntu machine and have been using it for months, but I’m now trying to get it going on a Pi to send messages with status data from there but I’m getting this error. Any Pointers?

pi@EverlanderMain:~ $ meshtastic -h
Traceback (most recent call last):
  File "/usr/local/bin/meshtastic", line 7, in <module>
  from meshtastic.__main__ import main
File "/home/pi/.local/lib/python3.5/site-packages/meshtastic/__init__.py", line 119
logging.error(f'An exception of type {exc_type} with value {exc_value} has occurred')
SyntaxError: invalid syntax
1 Like

hmm - did you use “pip3 installl --upgrade meshtastic” on your raspberry pi to install meshtastic?

I ask because of two reasons:

I just looked at line 119 of the current version in github and that line seems to be just a comment, so I’m not sure why it would have invalid syntax.

Also, the setup.py for that pip package says the minimum python version is 3.6, but your directory says python3.5 so that makes me think it might be too old a version of python.

oh! this might have been the cause:

1 Like

Yes

Nope

Maybe, I’ve just installed 3.6.0, but that alone didn’t fix it… But I’m getting cold feet to change too much more on this machine, I’ve got hundreds of python 2 scripts running lots of mission-critical stuff, and I don’t want to break it now… Thanks for trying

This may or may not be helpful, but if you’re running a PI 4 (4gb+) you can install Ubuntu MATE as an alternative OS. In my experience they keep the apt-get repositories more up to date. I believe python 3.8 is in there currently. With Raspbian you may have to build / install a later version manually :frowning:

1 Like

I got it, but don’t know how for sure…

It might have been sudo pip3 install --upgrade meshtastic

Thanks

1 Like