1

I'm trying to connect to my Ardiuno with Python on my Ubuntu computer. I tried this example: http://playground.arduino.cc/interfacing/python

But I always get:

>>> import serial
>>> ser = serial.Serial('/dev/tty.usbserial', 9600)
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "build/bdist.linux-x86_64/egg/serial/serialutil.py", line 282, in __init__
 File "build/bdist.linux-x86_64/egg/serial/serialposix.py", line 289, in open
OSError: [Errno 2] No such file or directory: '/dev/tty.usbserial'
>>> 

I can use the serial connection in sketch without any problems. I also added my user to the groups tty and dialout.

How do I connect to my Arduino using Python?

dsolimano
9,0463 gold badges52 silver badges67 bronze badges
asked Sep 6, 2014 at 18:47

1 Answer 1

1

list the serial ports first. I'm not sure dev/tty.usbserial is correct.

You try do ls /dev/tty* in Terminal, pehaps your Arduino board will pop up as ttyACM0 or something like that(sorry, haven't used Ubuntu in a while).

You can also check out the PySerial finding ports article(may need PySerial 2.7 or newer)

answered Sep 6, 2014 at 19:16
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.