/TLA

Traffic Light Assistant - Client

Primary LanguageJavaScript

Traffic Light Assistant (TLA)

It is the core and most essential component/subsystem of a Heads-Up Display (HUD) system and of the purposed Dynamic Traffic Network (Check DTN_Presentation.pptx). The HUD is just a TLA with a screen hooked up to it that allows for the display of a User Interface.

Hardware

The required components to build and operate a TLA are:

  • Beaglebone Black C
  • Global Positioning System (Adafruit Ultimate GPS Breakout)
  • DC/DC Converter to supply 5V to the Beaglebone Black C
  • Cellular Module (Nova Cellular) or Ethernet cable

For the Beaglebone Black C and GPS module setup, refer to the following link as it provides all the necessary assistance http://www.toptechboy.com/tutorial/beaglebone-black-gps-lesson-1-hooking-up-the-adafruit-ultimate-gps/

Software

You will need to properly set up your Beaglebone Black C. I have provided I guide that should help you with the setup process.

  • Download and read carefully the Step-by-Step_BBB_Setup_Manual.docx document included in the repository.

For the next steps, it is assumed you are familiar with the command line / Terminal and UNIX commands

Type and run the following commands in order

  • sudo ntpdate pool.ntp.org
  • sudo apt-get update
  • sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus -y
  • pip install pyserial

You may find this link helpful https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/uart

Deployment

Assuming you have successfully setup your TLA (both hardware and software), you are now ready to deploy the Client Application.

READ THIS ENTIRE SECTION BEFORE ATTEMPTING TO DEPLOY THE APPLICATION

  1. Download the repository
  2. Zip up the following folders/files
    • config
    • lib
    • src
    • index.js
    • package-lock.json
    • package.json
  3. Open your command line / Terminal and transfer the zipped-up folder to your beaglebone (it is assumed your beaglebone is turned on and connected to the Internet)
    • scp /path/to/file username@a:/path/to/destination
  4. Open a new command line / Terminal and ssh into your beaglebone
  5. Unzip the previously transferred zipped folder
    • unzip file.zip -d destination_folder
  6. Navigate into the unzipped folder
  7. Install the dependencies included in the package.json file (NOT the devDependencies)
    • npm install
  8. Run the TLA Client Application
    • npm start

IMPORTANT INFORMATION

  • This TLA Client Application works along with the TLA Server. Both projects are still under development.

GPS Package

JSON structure of the sent data package from the TLA to the Server on every update request (PUT)

{
    "macAddress": "e8:eb:11:4b:a5:ad",
    "username": "Traffic Light Assistant #1",
    "gpsPackage": [
    {
        "date": "12/03/18 (dmy)",
        "time": "06:18:28 (hms)",
        "status": "Active GPS",
        "lat": "42.12860833333333N",
        "lon": "80.09039666666666W",
        "speed": "0.29632000000000003 kmh",
        "direction": "274.55"
    },
    {
    "date": "12/03/18 (dmy)",
    "time": "06:18:28 (hms)",
    "status": "Active GPS",
    "lat": "42.12860833333333N",
    "lon": "80.09039666666666W",
    "speed": "0.29632000000000003 kmh",
    "direction": "274.55"
    },
    {
    "date": "12/03/18 (dmy)",
    "time": "06:18:28 (hms)",
    "status": "Active GPS",
    "lat": "42.12860833333333N",
    "lon": "80.09039666666666W",
    "speed": "0.29632000000000003 kmh",
    "direction": "274.55"
    },
    {
    "date": "12/03/18 (dmy)",
    "time": "06:18:28 (hms)",
    "status": "Active GPS",
    "lat": "42.12860833333333N",
    "lon": "80.09039666666666W",
    "speed": "0.29632000000000003 kmh",
    "direction": "274.55"
    },
    {
    "date": "12/03/18 (dmy)",
    "time": "06:18:28 (hms)",
    "status": "Active GPS",
    "lat": "42.12860833333333N",
    "lon": "80.09039666666666W",
    "speed": "0.29632000000000003 kmh",
    "direction": "274.55"
    },
    {
    "date": "12/03/18 (dmy)",
    "time": "06:18:28 (hms)",
    "status": "Active GPS",
    "lat": "42.12860833333333N",
    "lon": "80.09039666666666W",
    "speed": "0.29632000000000003 kmh",
    "direction": "274.55"
    },
    {
    "date": "12/03/18 (dmy)",
    "time": "06:18:28 (hms)",
    "status": "Active GPS",
    "lat": "42.12860833333333N",
    "lon": "80.09039666666666W",
    "speed": "0.29632000000000003 kmh",
    "direction": "274.55"
    },
    {
    "date": "12/03/18 (dmy)",
    "time": "06:18:28 (hms)",
    "status": "Active GPS",
    "lat": "42.12860833333333N",
    "lon": "80.09039666666666W",
    "speed": "0.29632000000000003 kmh",
    "direction": "274.55"
    },
    {
    "date": "12/03/18 (dmy)",
    "time": "06:18:28 (hms)",
    "status": "Active GPS",
    "lat": "42.12860833333333N",
    "lon": "80.09039666666666W",
    "speed": "0.29632000000000003 kmh",
    "direction": "274.55"
    },
    {
    "date": "12/03/18 (dmy)",
    "time": "06:18:28 (hms)",
    "status": "Active GPS",
    "lat": "42.12860833333333N",
    "lon": "80.09039666666666W",
    "speed": "0.29632000000000003 kmh",
    "direction": "274.55"
    }
    ]
}