Pages: [1]   Go Down
Author Topic: Arduino read python  (Read 901 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

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:
import serial
ser = serial.Serial('/dev/tty.USB0', 9600)
while 1:
    ser.readline()
'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__
    self.open()
  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
edu710@edu710-desktop:~/matechnoclg/projets/arduino$




Can anyone help me?

Thanks a lot
Logged

Gothenburg, Sweden
Offline Offline
Jr. Member
**
Karma: 0
Posts: 87
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try
Code:
ser = serial.Serial('/dev/ttyUSB0', 9600)
No extra "."
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks a lot  M Lundin
Logged

Pages: [1]   Go Up
Jump to: