Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer
    
Using ttyACM0 worked –  Stein Sep 6 '14 at 20:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.