Go Down

Topic: Arduino read python (Read 1 time) previous topic - next topic



I'm a beginner
I test duelmilanove
I'm a ubuntu 8.04's user hardy heron
I learn python
i put the code

Code: [Select]
import serial
ser = serial.Serial('/dev/tty.USB0', 9600)
while 1:
'1 Hello world!\r\n'
'2 Hello world!\r\n'
'3 Hello world!\r\n'

my terminal say's

edu710@edu710-desktop:~/matechnoclg/projets/arduino$ python 4.py
Traceback (most recent call last):
 File "4.py", line 2, in <module>
   ser = serial.Serial('/dev/tty.USB0', 9600)
 File "/usr/lib/python2.5/site-packages/serial/serialutil.py", line 156, in __init__
 File "/usr/lib/python2.5/site-packages/serial/serialposix.py", line 141, in open
   raise SerialException("Could not open port: %s" % msg)
serial.serialutil.SerialException: Could not open port: [Errno 2] No such file or directory: '/dev/tty.USB0'

and i try

edu710@edu710-desktop:~/matechnoclg/projets/arduino$ dmesg|tail
[73405.423146] usb 1-8: USB disconnect, address 5
[73405.423483] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[73405.423501] ftdi_sio 1-8:1.0: device disconnected
[73429.498224] usb 1-8: new full speed USB device using ohci_hcd and address 6
[73429.725531] usb 1-8: configuration #1 chosen from 1 choice
[73429.751432] ftdi_sio 1-8:1.0: FTDI USB Serial Device converter detected
[73429.751471] /build/buildd/linux-2.6.24/drivers/usb/serial/ftdi_sio.c: Detected FT232RL
[73429.751574] usb 1-8: FTDI USB Serial Device converter now attached to ttyUSB0
[77247.307776] usb 1-8: USB disconnect, address 6
[77247.308281] ftdi_sio 1-8:1.0: device disconnected

Can anyone help me?

Thanks a lot

M Lundin

Code: [Select]
ser = serial.Serial('/dev/ttyUSB0', 9600)
No extra "."


thanks a lot  M Lundin

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131