br0ck / Orange-Relay

Build a relay control system in Python, with a Django web interface on a OrangePi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Orange-Relay

Build a relay control system in Python, with a Django web interface on a OrangePi

Installing Armbian via a little tutorial for the base os.

Using the OPi.GPIO python library although pyA20 might be another option.

Setup the PyCharm environment

Windows:

  1. Install Python
    • Make sure to install pip and PATH as part of the installation of python
  2. pip install --user virtualenv
  3. python -m venv OR_env
    • This will create the virtual environment
  4. OR_env\Scripts\activate
    • This will activate the virtual environment
  5. pip install OPi.GPIO
    • This will install the OPi.GPIO library
  6. pip install Django
  7. Setup the Django project
    • django-admin startproject OR_web .
      • Starts the project
    • Add below to to settings.py under INSTALLED_APPS
    # My Apps
    'OR_web_GUI',
  8. Setup the Django database (default is sqlite)
    • Run in terminal python manage.py migrate
    • NOTE: Any changes to models in models.py will change the way the database works. Please use the following instructions after every change:
      • In the terminal python manage.py makemigrations OR_web_GUI
      • In the terminal python manage.py migrate
  9. python manage.py startapp OR_web_GUI
  10. Start the Django server with python manage.py runserver

Git Workflow/Branch control:

Following some of the framework laid out in Vincent Driessen's Article this repo will use master as full release and autodeployment ready code, with development being the primary working/nightly build branch. Hotfixes, bugfixes and new feature dev should each occur on their own branch then merged without fastforward into development or in the case of hotfixes, master.

Release names:

For simplicity and ease of use each release will be version numbered and then titled after The Muppets

Compatibility for dev

For the moment, because of the differences in windows vs linux select system calls we are importing FakeRPi as GPIO on ORi.GPIO load failure.

About

Build a relay control system in Python, with a Django web interface on a OrangePi

License:MIT License


Languages

Language:Python 71.0%Language:HTML 19.1%Language:JavaScript 9.8%