Python serial port

How can i use usb-serial converter to perform serial operations using python.pySerial does not mention it ,i guess?And how can we view our ports in linux as we do using device manager in Windows?

A USB to serial converter has ports just like the normal serial ports, only with different names, such as ttyUSB0, etc. You’d have to test it. Not all converters are supported, only those with a chipset recognised by a Linux driver. I think the ones with the Prolific pl2303 chip are ok. There are a few other chipsets, see the drivers in /lib/modules/2.6.27.25-0.1-default/kernel/drivers/usb/serial/ (for openSUSE 11.1 with all updates to this moment).

I guess i have pl2303 usb-serial.How do i test it out.Ho do i know which port i am using?

Ok i managed to comunicate serially using pySerial,but only using Idle. but when i use it within Geany or Gedit,i get following errors
Traceback most recent call last
File “serial.py”,line 3,in module
import serial
File"/home/nipun/serial.py",line 5,in module
ser=serial.Serial()
Attribute error:module object has no attribute Serial

how can i make it work?

Do a dmesg just after you have plugged in the converter, that will give you the USB device IDs. Then using those IDs, do a search to see what chip it is.

I have been able to perform serial communication both ways,now the with help of Idle,but when i run a full program,get the error as explained above

Sorry, I’m not familiar with Python.

ok,will try to figure that out.i found my port id using /var/…message
Thanks a lot for that

nipunreddevil wrote:
> Ok i managed to comunicate serially using pySerial,but only using Idle.
> but when i use it within Geany or Gedit,i get following errors
> Traceback most recent call last
> File “serial.py”,line 3,in module
> import serial
> File"/home/nipun/serial.py",line 5,in module
^^^^^^^^^^^^^^^^^^^^^^^^^^

Namespace clash.
Rename this file, so Python can find the correct module…

Thanks worked for me.

still not working even though i changed name

Thanks,got it working
Had forgotten to delete previous file -serial.py

Hello,

I am new to python language. and my boss told me learn it that to serial communication using python. but i couldnt get any documents regarding that. So could please post any manuals for python for serial communication …

thanks in advance

Take a look at pyserial on sourceforge, it will make your life easier, of
course you can also program it low level in python. A serial port is
essentially a file and you can in principle use the stadard i/o functions
with it.

http://pyserial.sourceforge.net/


openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram