anthony-mills / raspberrypi-carputer

UI component for the Nomadic Pi a Raspberry Pi based car computer. Allows interaction with MPD and GPSD backend services.
https://www.nomadicpi.com/
GNU General Public License v3.0
117 stars 19 forks source link
automotive car car-computer car-location gps gps-device mpd music raspberry-pi trip

Nomadic Pi Car Computer

This repository is the UI component of the Nomadic PI Raspberry Pi based car computer. Visit the Nomadic Pi website for more information on the project and details on building your own car computer or "carputer".

A pre built image file for use with the Raspberry Pi 3 can also be downloaded here.

Prerequisites

The UI acts as a frontend for the MPD and GPSD. So to have the frontend work properly in a live environment these two daemons must be installed and configured.

But for the purposes of development and testing, a fake GPS data set can be used in place of a live GPS stream to make things easier ( see below under "No GPS" for more details ).

The system uses PHP as a gateway for getting GPS and other data from external services. So at minimum the PHP5-common, PHP5-cli and PHP5-curl packages must be installed on the system.

The car computer also uses the HTML5 Filesystem API for the local storage of album art. This HTML5 API is poorly supported so either Chromium or Chrome needs to be used with the application for otherwise the local image cache will not function correctly.

The UI was designed for use on a car computer built on the Raspberry Pi platform ( has been tested with the 2 & 3 Model B ). Combined with the official 7 inch Raspberry Pi touch screen display (800x480).

It is responsive and will run happily at other resolutions. With the majority of development and testing taking place using Chromium on a standard desktop computer.

Installation

Running with out a GPS device

GPS functionality can easily be fudged for development or testing purposes. Without an active GPS fix or even a real GPS device.

To enable the GPS testing mode change the value of the gpsd-debug option in the application config file to true.

This will force the service to read a static GPS json object from the www/php/data/gps_data.json file. By changing the location values in this file a specific location, altitude or speed can be spoofed to test functionality.

Trip Data Log

By default the system will store a data point containing information about the cars location data ( speed, location , altitutude ) every 60 seconds during a trip to a JSON object that persists using the HTML5 local storage API. This allows for the calculation of average speeds etc along with being able to map the trip using Google maps.

The data never leaves the local system but at the end of a trip you may want to delete the data associated with a trip due to privacy reasons. To achieve this simply select the "Reset Tripmeter" option on the Tripmeter page to delete the data under the trip_data key. In another use case a button has now also been added to the Trip Meter page that will download the trip_data JSON object as a file to the system for later analysis / testing / debugging.

A set of real world data set are stored in the www/php/data folder by inserting these into a local storage object under the trip_data key for development and debugging purposes.

Changing the application background

If you would like to change the image used as the application background. Simply overwrite the background.jpg file located in the www/img/ folder with a jpeg image of your choice.

Credits

This project makes the use of a number of third party Open Source libraries. You are all fantastic! Thank you for all your hardwork its much appreciated!

Immediate Roadmap

In the near future the following features are planned:

Further Reading

Screenshots

Home screen while travelling at 54kph and playing music

Browsing the music collection stored on the filesystem

Displaying the current location of a car using Google Maps

Interacting with the current music play queue

Journey Trip Log

Licence

Copyright (C) 2017 Anthony Mills

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.