2

Please help me with this problem I have 2 x raspberri pi zero W connected together with serial port

6-6
8-10
10-8
Minicom to minicom works fine
Minicom to cat works fine
echo to minicom works fine
echo to cat does not work

I suspect the problem is with the opening and keeping open the port I use serial0 or AMA0 bluetooth disabled when I stty -a seems to give detail of the tty serial port I did not there was a tty serial port

Is there a way in command line to open a port and keep it open Why can I echo into minicom and cat from minicom but cant get it right echo to cat would appreciate assistance

What I mean by echo and cat are the command line command to send data to serial port, eg

sudo echo "data to serial" > /dev/ttyAMA0

This should send the data to serial to the serial port. You read it by command

sudo cat < /dev/ttyAMA0

So if you have 2 x raspberry pi connected via pins 8 and 10 swapped between the two and ground pin 6 connected to each other you can send the echo command from one pi to the cat command from another

This works when you have the program minicom running on each pi i.e type in one you see it on the other ( we are talking about the terminal windows of each pi ). I can send a command line eg echo from on pi to a minicom on the other and visa versa receiving info with the cat command.

I would like to use purely command line instructions ( echo and cat ) from each pi to communicate. I don't want to use secondary programs like minicom.

My question is How do I do it with purely command line instructions My confusion is in that I think my ports are not being opened properly Can somebody explain to me how to communicate between the two pi's via serial port using command line instructions ( I presume they are echo and cat or even printf).

  • Please clarify exactly what you mean by "echo to cat". – goldilocks May 11 '17 at 13:24
  • hope that explains better? – Kallie May 11 '17 at 14:24
  • 1
    Yes. Worth observing that sudo does not work with redirection (>), so either 1) Those commands do not require sudo, or 2) Those commands do not work. The serial device node is by default set 660 root:dialout, so if your user is a member of dialout, it will work, otherwise not. – goldilocks May 11 '17 at 14:34
  • thanks goldilocks - did not know the sudo part but commands seem to work with minicom Thanks – Kallie May 11 '17 at 14:44
  • I was sure my root dialout is member but will recheck – Kallie May 11 '17 at 14:44

Your Answer

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

Browse other questions tagged or ask your own question.