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.
- Install Python
- Make sure to install pip and PATH as part of the installation of python
pip install --user virtualenv
- This will install virtualenv
python -m venv OR_env
- This will create the virtual environment
OR_env\Scripts\activate
- This will activate the virtual environment
pip install OPi.GPIO
- This will install the OPi.GPIO library
pip install Django
- Installs Django framework
- 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',
- 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
- In the terminal
- Run in terminal
python manage.py startapp OR_web_GUI
- Start the Django server with
python manage.py runserver
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.
For simplicity and ease of use each release will be version numbered and then titled after The Muppets
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.