There are times when I want to use my MacBook as the Raspberry Pi's display. For example, when I go on travel. I would like to continue working on my Raspberry Pi projects. At home, I ssh into the Raspberry Pi using a terminal window on my MacBook. On travel, I need to change the Raspberry Pi so it can connect to the new Wi-Fi and I may need to grab the Raspberry Pi's IP address. So, I can ssh like at home.
This guide shows how to use an FTDI cable to connect a MacBook to a Raspberry Pi using three GPIO pins to display a terminal window on a MacBook
Parts:
FTDI TTL-232R-RPI Serial to USB cable from Mouser $15
Working Raspberry Pi (any model)
MacBook
Step 1. Enable Serial I/O on Raspberry Pi
raspi-config uses TAB, ENTER and ARROW keys to move through its menu. SPACEBAR will toggle a selection.
With a monitor and keyboard attached to the Raspberry Pi, do the following:
$ sudo raspi-config
Select Interfacing Options
Select serial
Enable login shell to be accessible over serial
$ sudo reboot
Disconnect the monitor and keyboard from the Raspberry Pi
Step 2. FTDI Connections
One end of the FTDI cable goes into a MacBook's USB port.
The other end connects to the GPIO pins as shown:
Step 3. Install or Update Drivers on MacBook
Visit this page: http://www.ftdichip.com/Drivers/VCP.htm
Download the driver for your MacBook
Locate the .dmg file (something like: FTDIUSBSerialDriver_v2_4_2.dmg)
Open then dmg
Open the pkg
Follow the installation instructions
The OS blocked the install, so I opened the Security Settings and clicked Allow to let the software install.
It takes a few minutes
Close and move installer to trash.
Eject the FTDI dmg and move it to trash
Step 4. Determine USB Port
Determine USB Port being used by USB-Serial adapter. My MacBook uses a chip from FTDI.
Open terminal window on the MacBook
There are a lot of devices in /dev. Use this command to identify the device:
$ ls /dev/tty.*
/dev/tty.Bluetooth-Incoming-Port
/dev/tty.usbserial-FT9314WH
Here is an alternate way to discover the device:
$ ls /dev | grep FT | grep tty
tty.usbserial-FT9314WH
If neither of the above work, then try this:
Unplug the FTDI cable from the MacBook and run:
$ ls /dev | grep tty
Plug the FTDI cable back into the MacBook, wait a few seconds and run the command again
Identify the difference. This should be the device being used
Step 5. Open a terminal window on MacBook
On a MacBook, open a terminal window. Set up the terminal window preferences as shown:
Terminal, select Preferences, click Advanced tab
xterm and vt100 work, but ansi works better when using nano editor
Set Western ASCII instead of unicode (UTF-8))
Step 6. Check if it works
In a terminal window with the settings above enter:
$ screen /dev/tty.usbserial-FT9314WH 115200
login to Raspberry Pi: username = pi password = raspberry
Troubleshooting:
The USB-serial cable may drop characters. If characters are dropped you may not get a prompt, press Return or enter username and press Enter.
The display may be messed up. Check the settings above are correct.
If recovery mode appears, then micro SD card is not set up correctly. Start over by reflashing the microSD Card.
The prompt for recovery mode is #
Raspbian's normal prompt is $.
NOOBS recovery login and password is: root and raspberry
Screen command shows an error
If an error message like one or more of the following is shown
cannot open line '/dev/tty.usbserial' for R/W: resource busy"
could not find a pty
Then run the command:
$ lsof | grep usbserial
If the port is free then nothing will be displayed, otherwise something like the following will be shown:
screen 2526 Sefi 5u CHR 18,0 0t0 605 /dev/tty.usbserial
The session number follows screen. In the above, it is 2526. Run the command:
screen -x 2526
To terminate the session
Use CTRL-A CTRL-\ to close the session
http://www.ftdichip.com/Support/Documents/InstallGuides/Mac_OS_X_Installation_Guide.pdf