4

I am attempting to pass data through my serial port and see the result. I have added myself to the group for /dev/ttyS0 and run

cat < /dev/ttyS0

on one terminal for reading of data. To write I tried

echo -e '123' > /dev/ttyS0

The commands don't throw any errors, but I don't see any output on the first terminal. Any ideas on what I'm doing wrong?

0

You are missing the loop-back connection/jumper. The serial port send data through pin 3 and receive them through pin 2.

As you are using same port, connect 2 ↔ 3 with a wire.

Reference: Wikipedia: Loopback

  • That may be an option I can try, but I was hoping that I can intercept the data or progmatically set it up to send to itself or another serial device without needing cables and such. Is this even possible? – MrJman006 Oct 16 '15 at 13:15
  • @MrJman006, No, that is not possible for real serial port (It has separate FIFO's for Input and Output with separate send & receive physical lines). Not the same as network interfaces, because port are logical and there is always virtual loopback interface setup by default (try: ifconfig -a, see lo) – user.dz Oct 16 '15 at 14:34

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.