cpmpercussion / myo-to-osc

A pure-python cross-platform solution for simply connecting Myo armbands to OSC-connected software.
11 stars 4 forks source link

Connection problem Ubuntu #8

Open alexarje opened 6 years ago

alexarje commented 6 years ago

So when I try to run python3 myo_to_osc.py on Ubuntu 17.10, I get the following error:

available BT adapter: /dev/ttyACM0 Traceback (most recent call last): File "/home/alexanje/.local/lib/python3.6/site-packages/serial/serialposix.py", line 265, in > open self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK) PermissionError: [Errno 13] Permission denied: '/dev/ttyACM0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "myo_to_osc.py", line 60, in m = Myo() # scan for USB bluetooth adapter and start the serial connection automatically File "/home/alexanje/github/myo-to-osc/myo/init.py", line 58, in init self.bt = BT(tty, baudrate=115200) File "/home/alexanje/github/myo-to-osc/myo/bluetooth.py", line 70, in init self.ser = serial.Serial(port=tty, baudrate=baudrate, dsrdtr=1) File "/home/alexanje/.local/lib/python3.6/site-packages/serial/serialutil.py", line 240, in > init self.open() File "/home/alexanje/.local/lib/python3.6/site-packages/serial/serialposix.py", line 268, in > open raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg)) serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyACM0: [Errno 13] > Permission denied: '/dev/ttyACM0'

Turns out to be a permission problem. There are some non-ideal solutions here. To be able to continue testing, I opted for doing sudo chmod 666 /dev/ttyACM0 for now, but this will have to be done every time the dongle is inserted.

alexarje commented 6 years ago

Doing the above works, though, so now I am connected!

screenshot from 2018-01-08 13-58-02

cpmpercussion commented 6 years ago

Interesting - I haven't checked the permissions of serial ports in Ubuntu, but looking at that SO thread suggests that such serial ports are part of the group dialout, so if you added yourself to that group you would have RW access to /dev/ttyACM0.