To ensure that all the software interdependencies can work, it’s easiest to start with a clean installation.

So, we need to set up the following:

  • Fresh install of Raspbian
  • PiTFT Setup
  • Python development libraries
  • Wiring Pi library
  • Wiring Pi Python wrapper
  • PiPhone python script

Raspbian Setup

This project is easiest to start with a pre-prepared rasbian image from Adadfriut that's got all the setup done for the PiTFT touchscreen, saving a lot of time. There's also a script for Pi's that already are up-and-running. 

There are two versions of the 2.8" PiTFT, the resistive and the capacitive. You can find links to the images and/or setup scripts here:

Once the PiTFT is running, we first need to change the orientation of the screen, as we want the keypad to appear in portrait mode. We can do this by editing the adafruit modules config file:

sudo nano /etc/modprobe.d/adafruit.conf

Change the 'rotate' parameter for the fbtft_device to zero, save the file and exit the editor. 

options fbtft_device name=adafruitct28 rotate=0 frequency=32000000

Connect a monitor and keyboard (or use a USB-to-serial console cable), power the Raspberry Pi from a USB phone charger or powered hub, and work through the usual first-time boot configuration.

The following options are required:

  • Expand Filesystem

The following are very useful and recommended:

  • Under Internationalization Options, select Change Timezone and Change Keyboard Layout to match your region.

The following are optional:

  • Under Advanced Options, select Hostname to give this Pi a unique name (such as “picam”) to distinguish it from other Raspberry Pi’s on the network.
  • Under Advanced Options, select SSH to enable command line access from the network (helpful for further configuration and troubleshooting).
  • Other settings can be configured to your liking.

The following should not be used:

  • Overclock. This is a portable, battery-operated project and an overclocked Pi will draw more current. Overclocked systems are also more likely to corrupt the SD card filesystem. Do not enable this option.

Once the basic system configuration is done, you can also set up wireless networking if you plan on using this capability. This guide may be of assistance.

PiTFT Setup

Once the Pi is fully configured and on the network, work through the relevant PiTFT tutorial, one for the Resistive version and one for the Capacitive version.

For the Resistive Version: Adafruit PiTFT — 2.8" Touchscreen Display for Raspberry Pi

For the Capacitive Version: Adafruit 2.8" PiTFT - Capacitive Touch

You may want to read up about the PiTFT and stuff you can do with it. If you're using the ready-to-go image then a cursory review on how to install is handy. Once you have a Pi that boots to a login prompt on the 2.8" TFT, you’re in good shape. 

You'll also need to calibrate the touch screen!

Likewise, the optional tactile buttons on the PiTFT are not required for this project. You can install the buttons for other things if you like, but the PiPhone software is entirely touchscreen-based.

PiPhone Software Setup

Now we get the PiPhone python script and icons.


Now give it a try. The software must be run as root (using the sudo command) in order to access the TFT display

cd PiPhone-master 
sudo python

If all goes well, after a few seconds’ initialization you should see the Lapse Pi splash screen , Followed a couple of seconds later by the time-lapse information.

If this doesn’t happen, an error message should give some sort of troubleshooting guidance; missing library or driver, etc. This is why we recommend working through the TFT tutorial first.

Once youve got that working, have the Pi boot straight into the PiPhone software by editing/etc/rc.local and adding the following lines before exit 0

# Start PiPhone software at boot
cd /home/pi/PiPhone-master

Next time you reboot you should see the text console and then it will start the PiPhone software.

Serial Port Setup

There is almost zero setup in the serial port, we just have to make it available for comminucating with the FONA. This involvles simply disabling the getty that's running by default, which normally allows us to log into the Raspberry Pi over the serial port. Since we now want to connect the FONA to this serial port, we don't want a login prompt to be sent to the FONA. 

Open /etc/inittab file

sudo nano /etc/inittab

and cange the line that contains the getty for /dev/AMA0 by putting a # infront of it:

#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

I'd suggest not deleting the line, as you may want to comment in back in later.

This guide was first published on Nov 24, 2014. It was last updated on Nov 24, 2014.

This page (Pi Setup) was last updated on Sep 06, 2014.

Text editor powered by tinymce.