WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Pi3 -> Pi3 communication over GPIO  (Read 1405 times)

Offline jefferee

  • Newbie
  • *
  • Posts: 31
Pi3 -> Pi3 communication over GPIO
« on: August 16, 2017, 07:17:00 PM »
So I'm using a Pi3, with multiple FTDI USB/RS-232 adapters attached, and having issues with the USB bus periodically locking up. Can't really diagnose what's going on, because when the USB locks up, I can't communicate with the Pi over ethernet, or connect a keyboard.

Is there a good way to connect another Pi3 over the serial UART pins? I've edited my console settings as recommended  here, but no joy. Even from a clean install the -sh process appears to be locking down /dev/ttyS0 and /dev/ttyAMA0.

PiCore version is 8.1.4.

Any ideas? Or maybe I should set up a cron job to save dmesg output to the SD?

Offline jefferee

  • Newbie
  • *
  • Posts: 31
Re: Pi3 -> Pi3 communication over GPIO
« Reply #1 on: August 21, 2017, 12:49:25 PM »
What I ended up doing, for anyone (probably me) googling this later:

Checked mmcblk0p1/config.txt on both Pis, to ensure both had the lines
Code: [Select]
enable_uart=1to enable the serial console, and
Code: [Select]
dtoverlay=pi3-disable-btto disable the bluetooth (this line is specific to Pi 3). I did this so that the console can be run through the (better) /dev/ttyAMA0 interface, rather than /dev/ttyS0.
In 8.1.4, both lines were included in config.txt by default.

Modified mmcblk0p1/cmdline3.txt on both Pis:
Changed console entries on the server to
Code: [Select]
console=ttyAMA0,115200 console=tty1and removed all
Code: [Select]
console=entries on the client.


Modified /opt/bootlocal.sh, to change terminal startup.
Commented out the stock serial terminal startup line
Code: [Select]
/usr/sbin/startserialtty &on both machines.
On the server only, added the line
Code: [Select]
/opt/serialtty.sh &(we'll get to that script next).

On the server, created a script /opt/serialtty.sh
Code: [Select]
#!/bin/sh

# Start serial terminal on Raspberry Pi
while :
do
  /sbin/getty -L /dev/ttyAMA0 115200 vt100
done
This forces the console to use /dev/ttyAMA0, so it assumes bluetooth is disabled.

...et voila!