Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Python serial port

  1. #1

    Default 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?

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Python serial port

    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).

  3. #3

    Default Re: Python serial port

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

  4. #4

    Default Re: Python serial port

    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?

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Python serial port

    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.

  6. #6

    Default Re: Python serial port

    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

  7. #7
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Python serial port

    Sorry, I'm not familiar with Python.

  8. #8

    Default Re: Python serial port

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

  9. #9
    Join Date
    Jul 2008
    Location
    Voorhout, Netherlands
    Posts
    262

    Default Re: Python serial port

    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...

  10. #10

    Default Re: Python serial port

    still not working even though i changed name

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •