BeaconAir – Track your Pi

Startup Procedure

To start BeaconAir, you need to do three things:

  • 1. Turn on the Bluetooth dongle by entering:
sudo hciconfig hci0 up
  • 2. Change to the BeaconAir directory and start up the BeaconAir python program with
sudo python BeaconAir.py

in its own terminal window or

sudo nohup python BeaconAir.py &

from the command line.

  • 3. Change to the RasPiConnectServer directory and start the RasPiConnect Server with
sudo sh startserver.sh

in its own terminal window or

sudo nohup sh startserver.sh &

from the command line.

If you use nohup, you can close the terminal window and the program keeps running in the background until you reboot or kill the program.

All of the debug data goes into a file nohup.out in the start directory. If you want to watch what is going on using nohup, go to the program directory and type

tail -f nohup.out

on the command line.

Making BeaconAir Start on Bootup

A script on the Raspberry Pi named /etc/rc.local runs when Linux first boots. To edit it, you will need root privileges:

sudo nano /etc/rc.local

Then, you can add Listing 7 to the file before the exit 0 statement.

Listing 7

Start on Boot

sudo hciconfig hci0 up
date >> /var/log/RasPiConnectServer.log
echo "Starting RasPiConnectServer..." >> /var/log/RasPiConnectServer.log
nohup /home/pi/RasPiConnectServer/startserver.sh >>/var/log/RasPiConnectServer.log 2>&1 &
date >> /var/log/BeaconAir.log
echo "Starting BeaconAir.." >> /var/log/BeaconAir.log
cd /home/pi/BeaconAir/
nohup sudo python BeaconAir.py >>/var/log/RasPiConnectServer.log 2>&1 &

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Pi in the Palace

    Welcome to the sixth issue of Raspberry Pi Geek magazine. In case you haven't done the math, six issues for a bimonthly magazine means we're celebrating our one year anniversary! We had a great year, and so did the amazing Raspberry Pi computer. It seems like we were just writing about the 2 millionth Raspberry Pi, and now the Foundation has announced the 3 millionth unit. 

  • Connecting a weather station to your Arduino

    After losing one weather station to tropical winds, the author reboots and designs a PCB that connects to an Arduino and monitors weather instruments.

  • Getting BLE to behave on the Pi

    BLE is a convenient choice for wireless communication where WiFi and Internet connectivity aren't available, but getting it to work on a Raspberry Pi can be a minefield of compatibility problems. We look at the main concepts and debugging tools you will need to get the most out of BLE on your Pi.

  • WiFi and the Raspberry Pi

    This SwitchDoc column looks at various uses for the inexpensive ESP8266 WiFi/processor combination.

  • The Switch Doc rebuilds his cat toy launcher with 3D printing

    To explore the possibilities of 3D printing, we rebuild the cat toy launcher that debuted in Issue 5.