Thursday, June 2, 2011

Test a serial port

Use a loopback cable: connect pin 2 and 3. Data sent out come back on the receive line.

optionally configure it to disable echoing: stty -F /dev/ttyS0 -echo
Otherwise the characters are sent again and again in an infinite loop...

in a console read from the line: cat /dev/ttyS0
in another console write to the line: echo "test message" > /dev/ttyS0

check if it is printed in the first console...

No comments:

Post a Comment