Skip to content

Part 2. Serial

Rachel edited this page Jul 21, 2016 · 8 revisions

The Fona is just a bit tricky to setup with the Pi because it communicates with a serial connection (hence the UART pins, TX, RX). By default any Raspberry Pi uses its hardware serial pins for the kernel serial console, so this needs to be disabled.

Adafruit's method didn't work for me on the Zero (which didn't surprise me), so I poked around and figured out that it's super easy. All you need to do is edit the /boot/cmdline.txt file (use sudo if you receive a permissions error). nano /boot/cmdline.txt Remove any reference to ttyAMA0 or ttySerial0. Save the file with Ctrl-X and reboot your Pi to apply the change.

To test the serial connection, we are going to install PPP and the serial console "screen" on the Zero. You need an internet connection for this part (yeah, an internet connection needed to setup an internet connection, I know) so plug in that WiFi dongle.

sudo apt-get update

sudo apt-get install ppp screen

Now we're going to try out our newly installed screen:

screen /dev/ttyAMA0 115200

Don't freak out - you should see a completely blank window with a cursor at the top. Type in the letters "AT", capitalized and everything, and hit enter. You should see an "OK" appear - that's the Fona talking back to you! You've verified that the serial connection is working and can exit with Ctrl-A and typing :quit.