Pyserial - send and receive characters through linux serial port

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Apr 25 21:13:26 EDT 2008


En Fri, 25 Apr 2008 20:22:37 -0300, terry <itskrithika at gmail.com> escribió:

> I am trying to send a character to '/dev/ttyS0' and expect the same
> character and upon receipt I want to send another character. I tired
> with Pyserial but in vain.

I assume you have a device attached to /dev/ttyS0 that echoes back the  
received characters?

> Test Set up:
>
> 1. Send '%' to serial port and make sure it reached the serial port.
> 2. Once confirmed, send another character.
>
> I tried with write and read methods in Pyserial but no luck.

Check the communication parameters (baud rate, parity, etc.), cable,  
connectors, your device... AFAIK a lot of people is using pyserial so I'd  
look the problem elsewhere. Try posting a short code example showing your  
problem.

-- 
Gabriel Genellina




More information about the Python-list mailing list