Configuring the serial port

  • Thread starter Juan Luis Medina
  • Start date
J

Juan Luis Medina

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.tcgetath(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
 
D

Diez B. Roggisch

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,

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top