O'Reilly logo

Raspberry Pi Android Projects by Gökhan Kurt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting it all together

In the next two sections, we will put together what we have done so far. First, we'll begin by sending data to the Google Docs sheet. Then, we will build an Android app to show the data on a map.

Sending measurements

We will use a Python script to access GPS data on the Pi that we'll need to run on system reboot. For this purpose, add the following code at the end of the /etc/rc.local file:

sudo killall gpsd
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock
sudo rfcomm connect hci0 00:1D:A5:15:A0:DC &
sleep 1m
current_time=$(date "+%Y.%m.%d-%H.%M.%S")
file_name=/home/pi/log_sender.txt
new_filename=$file_name.$current_time
sudo /home/pi/pyobd-pi/sender.py > $new_filename 2>&1 &

Here, we can restart the GPS services, connect to the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required