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)
(incl. VAT)