• This repository has been archived on 03/Dec/2022
  • Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    JavaScript
  • License
    GNU General Publi...
  • Created almost 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

UI component for the Nomadic Pi a Raspberry Pi based car computer. Allows interaction with MPD and GPSD backend services.

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

  • Install all of the required dependencies.
  • Edit the application config file at config/config.ini and enter your Here.com API details - Required for speed limit and weather information. In order to translate the cars location from a latititude, longitude pair to a human readble address you will also need to get an API key from locationIQ.
  • Also check the GPSD daemon setting in application config file - Should work with the defaults on most setups
  • From the command line run the start.sh script to start an instance of the internal PHP webserver on port 8000.
  • Open a browser ( Chrome or Chromium recommended ) and visit localhost:8000 to see the application. Keep in mind that it has been designed with the Raspberry Pi Official touch screen in mind i.e 800x468 so if your on a desktop / laptop you may want to use developer tools to switch to a 800x468 viewport. To get get a more realistic idea of what the UI will look like when viewed on the end device.

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:

  • Ironing out issues with return trips on the trip meter. At the moment the issues seem sporadic and needs further collection of real "on road" data to debug.

  • The ability to control the screen brightness on the official Raspberry Pi Touchscreen using the display controller board v1.1 and above.

  • The ability to save a play queue to the MPD filesystem as a playlist

  • PHP script that acts as a podcast agregator finding and downloading new episodes as they are released and then making them available to the MPD daemon.

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/.

More Repositories

1

google-places

PHP wrapper class for the Google Places API
PHP
82
star
2

procedural_dungeon

PhaserJS plugin for the procedural generation of dungeon layouts for games.
JavaScript
34
star
3

s3-video

Wordpress plugin allowing the management and playback of video files stored in an Amazon S3 (Simple Storage) account.
PHP
12
star
4

panoramio

Panoramio PHP wrapper class for the data API
HTML
10
star
5

Street-View-images

PHP class allowing the retrival of images for a location using the Google Street View Images API
PHP
6
star
6

nomadicpi

Car computer built with Python and QT intended for use on small form factor systems like the Raspberry Pi.
Python
6
star
7

flash_cards

Laravel based flash card application to aid the process of memorising data.
PHP
6
star
8

btc-markets

Simple PHP based system for retrieving and storing cryptocurrency market data ( Bitcoin, Litecoin and Ethereum ) from the Australian exchange BTCmarkets.
PHP
5
star
9

CryptoCoins

Script for storing crypto currency market data from the coinmarketcap.com API to a MySQL database for analysis.
PHP
4
star
10

planetary_dictator

A file manager built with electron for managing files on an IPFS node from the desktop.
JavaScript
3
star
11

DirectSMS

PHP class for the DirectSMS.com.au API
PHP
2
star
12

png_crush

PHP script that will recursively compress all .png images under a directory path using the tinypng.com API
PHP
2
star
13

Wordpress-Date----Timestamp-Converter

JavaScript
1
star
14

Brightcove-Wordpress

Wordpress plugin for the integration of the Brightcove platform
PHP
1
star
15

google-pagespeed

Wrapper class for getting a speed report using the Google page speed API.
PHP
1
star
16

DaemonWatch

Web application based on Zend Framework that can periodically connect and check the status of services on remote hosts
PHP
1
star
17

cryptocoaster

Dynamically generated side scroller game using Bitcoin market data from the last 24 hours.
JavaScript
1
star
18

Hash-Calculator

Simple plugin allowing a SHA1 / MD5 hash calculator into a Wordpress page or post. To use simply the shortcode [hash_calculator] where you would like the calculator to be Displayed.
PHP
1
star