2

Is it possible to do some echo on /dev/ttyS8 serial device in one terminal window, and in second to cat /dev/ttyS8 and display data from that file?

6

If you stick a serial loopback adapter in the specified serial port: Yes.

Serial Loopback Adapter
Pinout:
* Receive and transmit (2 & 3)
* Request to send and Clear to send (7 & 8)
* Data carrier detect, Data set ready and Data terminal ready (1, 6 & 4)

If you want to debug an application talking through a serial port, you could use this command:

socat /dev/ttyS0,raw,echo=0 SYSTEM:'tee input.txt | socat - "PTY,link=/tmp/ttyV0,raw,echo=0,waitslave" | tee output.txt'

(From https://unix.stackexchange.com/a/225904/127903)

  • So if I echo something to /dev/ttyS8 it goes out to UART port, and I cannot see it with cat, only with loopback adapter? – Junior Aug 27 '15 at 13:47
  • You need the loopback adapter. Serial transmit and receive pins are clearly defined. You can't get a response unless you receive your transmitted data via loopback adapter. – Jesse K Aug 27 '15 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.