Configuring the serial port

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Juan Luis Medina

    #1

    Configuring the serial port

    Hello all, I am working with Python over Linux since some months ago,
    and Im not still very experienced with all this.

    I would like to configure the serial port using Python. In order to do
    this, I know there are some functions under termios module which allow
    me to do it (i.e. termios.tcgetat h(fd)), but I dont know how to get
    the file descriptor to this 'special' file.

    I have tried to get the fd using open('/dev/ttyS1','r') but it doesnt
    work out.

    Do you know if I am in the right way to do the task? is there
    something missing here?

    Any post will be of great help, thanks in advance,

    Juan Luis Medina
  • Diez B. Roggisch

    #2
    Re: Configuring the serial port

    > Do you know if I am in the right way to do the task? is there[color=blue]
    > something missing here?
    >
    > Any post will be of great help, thanks in advance,[/color]

    Install pyserial, you can find it on sourceforge. Its platform-independend
    (supports even java for jython) and gives a nice, clean api. I went through
    all that termios-stuff, and while its possible, pyserial is much better.

    --
    Regards,

    Diez

    Comment

    Working...