Error ... "StreamInterface is now abstract (to update existing code create SerialInterface instead)"

Hi, I am new to Python and Linux. Have been trying to connect my Raspberry Pi 3 to my TTGo T-Beam device without avail. After installing Meshtastic (pip3 install --upgrade meshtastic), started the Python3 REPL (>>>) and successfully imported meshtastic, I am stuck at the step of “interface = meshtastic.StreamInterface(”/dev/ttyUSB0")", with the following error …

interface = meshtastic.StreamInterface(“/dev/ttyUSB0”)
Traceback (most recent call last):
File “”, line 1, in
File “/home/pi/VENV/lib/python3.7/site-packages/meshtastic/init.py”, line 437, in init
“StreamInterface is now abstract (to update existing code create SerialInterface instead)”)
Exception: StreamInterface is now abstract (to update existing code create SerialInterface instead)

when I tried using SerialInterface instead of StreamInterface as suggested by the system (“interface = meshtastic.SerialInterface(”/dev/ttyUSB0")"), I received another error message as follows…

interface = meshtastic.SerialInterface(“/dev/ttyUSB0”)
Traceback (most recent call last):
File “/home/pi/VENV/lib/python3.7/site-packages/serial/serialposix.py”, line 310, in _reconfigure_port
fcntl.flock(self.fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
BlockingIOError: [Errno 11] Resource temporarily unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 1, in
File “/home/pi/VENV/lib/python3.7/site-packages/meshtastic/init.py”, line 586, in init
self.stream.open()
File “/home/pi/VENV/lib/python3.7/site-packages/serial/serialposix.py”, line 272, in open
self._reconfigure_port(force_update=True)
File “/home/pi/VENV/lib/python3.7/site-packages/serial/serialposix.py”, line 312, in _reconfigure_port
raise SerialException(msg.errno, “Could not exclusively lock port {}: {}”.format(self._port, msg))
serial.serialutil.SerialException: [Errno 11] Could not exclusively lock port /dev/ttyUSB0: [Errno 11] Resource temporarily unavailable

Could anyone help me proceed to connect the T-Beam?? Many thanks.

Re 1: yes, you now want to use Serial interface. I thought I updated all the docs but I guess I missed someplace.

Re 2
Hmm. It is probably one of two things:

Your user is not in the dialout group, so you can’t access the port due to Linux permissions.

You have the port open (terminal program?) In another process.

@geeksville, thanks for your info and thanks for updating the file on GitHub. The raspberry pi is now connected to the radio as indicated as follows:

(VENV) pi@pi3 : ~/VENV $ meshtastic

Trigger powerFSM 9

Transition powerFSM transition=Contact from phone, from=DARK to=DARK

Trigger powerFSM 11

Transition powerFSM transition=serial API, from=DARK to=SERIAL

Shutdown BT: 177636 heap size

Connected to radio.

Bravo!!!

1 Like