Skip to content

vicinityh2020/vas-adapter-hits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VAS Adapter HITS

Adapter used to connect the Value-Added Services and expose them to the VICINITY neighborhood.

Prerequisites

Before running this adapter, ensure that you have the following in place:

  • Python 3.6.5+

    Ubuntu 14.04 and 16.04:

    $ sudo add-apt-repository ppa:deadsnakes/ppa
    $ sudo apt-get update
    $ sudo apt-get install python3.6

    Ubuntu 17.10

    comes with a pre-installed 3.6, use python3 to invoke it

    Windows 10

    Download binary from: https://www.python.org/downloads/
    Make sure to update your Environment Variables

  • PostgreSQL 9.6+

    Ubuntu 17.04 - 17.10

    $ sudo apt-get install postgresql-9.6

  • RabbitMQ server for message passing between the worker and the adapter

    Ubuntu 14.04+

    $ sudo apt-get install rabbitmq-server

  • Configured and working VICINITY Client Node

Installation

  1. Clone this repository using git clone

  2. Inside the project directory run pip install -r requirements.txt to install the necessary requirements

  3. Update your database connection settings in vas-adapter-hits/vas_adapter/settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': '',
        'USER': '',
        'PASSWORD': '',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

Inside the project directory run
$ python manage.py makemigrations
$ python manage.py migrate

Run

Run the adapter on a port of your choice

$ python manage.py runserver <your_host>:<your_port>

Example:

$ python manage.py runserver 127.0.0.1:9000

Celery worker

Celery worker (make sure rabbit-mq server is up and running on your machine)
$ celery -A proj worker to execute tasks
$ celery -A proj beat to schedule tasks

Admin Page

In order to access the admin page, you must first create an admin user by python manage.py createsuperuser, then fill out the username and password (feel free to leave other fields blank).

You may then access the page at http://<your_host>:<your_port>/admin

Database data

  1. Log in to your admin page
Adding a parking lot
  1. Under the API table, click Add next to "Parking Lots"
  2. Fill out the parking lot information
Adding a parking space
  1. Under the API table, click Add next to "Parking Spaces"
  2. Fill out the sensor information. Make sure that the sensor is
Adding a parking reservation
  1. Under the API table, click Add next to "Parking Reservations"
  2. Fill out the reservation information

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages