Flight Lines
JavaScript HTML PHP CSS Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Flight Lines


Preparing the Raspberry Pi before deployment

Boot up the RPi, and if you're directly at the terminal (i.e., with a keyboard and monitor plugged in) you will get dropped straight into the raspi-config setup menu.

If you are booting headless, you'll need to start on an Ethernet connection. Figure out what the IP address is and then: ssh pi@[IP address] (default password is raspberry). Once you're logged in, type in sudo raspi-config to get the setup menu.

  • Expand the filesystem

  • Change the root password

  • Internationalisation

    • Change Locale: en_US-UTF-8 UTF-8 (and select it on the second screen)
    • Change Time Zone
    • Change Keyboard Layout
      • Generic 105-key (Intl) PC
      • Other
      • English (US) > English (US)
      • The default for the keyboard layout
      • No compose key
      • No to the X server terminate key
  • Enable camera

  • Finish (and reboot)

  • Edit the wifi configuration

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf 
  • Add the following to the end, then save and exit (ctrl-x, then 'y')
    ssid="Wifi SSID"
    psk="Wifi password"
  • Edit /etc/dhcp/dhclient.conf, and remove the lines related to DNS (domain-name, domain-name-servers, domain-search, host-name, dhcp6.name-servers, dhcp6.domain-search)
  • Edit /etc/network/interfaces, and add the following lines to the wlan0 entry
dns-search phiffer.org
  • Restart the network: sudo service networking restart

At this point, if you're at the terminal, you may want to switch to an SSH session.

  • Install software
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gpac firmware-linux-nonfree crda
  • Set up your wifi adapter region
sudo iw reg set US

At this point you'll have to decide on what to call your location. The name should be a short label, all lowercase, with no spaces. You may want to use hyphens if you want to use multiple words (e.g., "central-park").

  • Edit /etc/hostname to use your location ID

  • Edit /etc/hosts to set the hostname to IP

  • Reboot: sudo shutdown -r now

  • Set up SSH keys

mkdir .ssh
cd .ssh
  • When prompted for a filename, enter the name (my-location) you've chosen
  • Don't choose a password for your private key (press enter twice)
  • Send the public key, [your node name].pub, to Dan via email
  • You may want to copy [your node name].pub to authorized_keys (to make logging in easier), and add the key pair to any computer you might be logging in from frequently
  • Set permissions
chmod 600 *
chmod 700 .
  • Add the following to a new file /home/pi/.ssh/config
Host flserver
     Hostname phiffer.org
     User flightlines
     IdentityFile /home/pi/.ssh/[your node name]
  • Login to the server to establish the .known_hosts file: ssh flserver (yes, then exit)

  • Download flightlines

cd /home/pi
git clone https://github.com/dphiffer/flightlines.git

crontab -e

Install the user cron jobs to start the video capture and sync files.

@reboot /home/pi/flightlines/start.sh >> /dev/null 2>&1
* * * * * /home/pi/flightlines/sync.sh >> /dev/null 2>&1

sudo crontab -e

Install the root cron job to reboot every morning.

50 5 * * * /sbin/shutdown -r now >> /dev/null 2>&1
*/10 * * * * /home/pi/flightlines/check-wifi.sh >> /dev/null 2>&1


Configure a static Ethernet IP address for headless boot in /etc/network/interfaces:

auto eth0
allow-hotplug eth0
#iface eth0 inet manual
iface eth0 inet static

Shutdown before deployment

Everything is ready to go!

sudo shutdown -h now

On-site deployment

You'll need to have a travel wifi router on hand to do a headless final setup. It should be configured to use subnet 10.0.47.x.


Configure the wifi according to the local network in /etc/wpa_supplicant/wpa_supplicant.conf:


Do a sudo reboot, and then login to check that the wifi is working (ping the gateway IP). Make a note of the Pi's wifi IP address using ifconfig wlan0.


Disable the Ethernet static IP, so that the wifi is used as the default network in /etc/network/interfaces:

auto eth0
allow-hotplug eth0
iface eth0 inet manual
#iface eth0 inet static

Do another sudo reboot and then ssh to the Pi using the wifi IP.

All ready

Delete the stopped file, and reboot one more time:

cd /home/pi/flightlines
rm stopped
sudo reboot