Skip to content

Part 2. Serial

Rachel edited this page Apr 3, 2017 · 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, 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:

sudo screen /dev/ttyAMA0 115200

Note: If using a Pi Zero W, use the command sudo screen /dev/serial0 115200 instead. This is because the BLE is running on ttyAMA0. Tip credit: Brandon Wright

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.

If this doesn't work for you, make sure that you rebooted the Pi after changing the /boot/cmdline.txt file and check to see if the red LED on the Fona is blinking rapidly. If the red LED is blinking quickly, there might be a wiring issue, so go back and double check.

<< Part 2: Wiring- Part 3: Using the Cellular Connection >>