[BangPypers] URGENT: problem using Pyserial in Python

Jayneil Dalal jayneil.dalal at gmail.com
Wed Sep 14 18:52:47 CEST 2011


Dear Sir/Madam,
I am currently trying to develop a GUI for serial communication based on
Python.

Following are my specs:
OS:Linux( Ubuntu 11.04)
Python version: 3.1.3
Pyserial version: 2.5

I did the following in IDLE :

1)import serial
2)import time
3)ser=serial.Serial()
4)ser.port="/dev/ttyS0"
Note:- I have a laptop. So I have only USB ports. But when I tried
dev/ttyUSB0 it gave me errors..So i did not use it
5)ser.baudrate=19200

Now this is where I get the errors:
6)ser.open()
The error is:

*Traceback (most recent call last):*
*  File "<pyshell#12>", line 1, in <module>*
*    ser.open()*
*  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 280, in
open*
*    self._reconfigurePort()*
*  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 308, in
_reconfigurePort*
*    raise SerialException("Could not configure port: %s" % msg)*
*serial.serialutil.SerialException: Could not configure port: (5,
'Input/output error')*
*
*
So can you please suggest me how to avoid this.

Looking forward to your positive response.

Regards,
Jayneil.


More information about the BangPypers mailing list