This is an Django Application for Device Controller Library used to control board pins using a website.
-
Install python 3.7 or above
-
Clone repository
git clone https://github.com/dmdhrumilmistry/DeviceControllerWebInterface.git/ -
Change directory
cd DeviceControllerWebInterface -
install requirements
pip install -r requirements.txtuse
pip3andpython3on linux distros instead ofpipandpython. -
Migrate DB using
python manage.py makemigrations python manage.py migrate -
Connect Arduino Board to Host machine
-
Upload sketch on the board using Arduino IDE.
Use Device Controller Library to program Boards. View example
-
Update COM port and other configurations in the /controller/views.py according to the uploaded sketch file
-
Create admin account
python manage.py createsuperuserEnter details
-
Start Application using
python manage.py runserver 0.0.0.0:8000 -
Login to admin account and Create devices based on the sketch requirements
Various users can be created from admin page
-
Visit Running website to control devices
http://127.0.0.1:8000/ # for localhost http://[local_ip]:8000/ # for local networkAllow incoming and outgoing connections on port 8000 of firewall settings on the host machine to access the web app.
The host machine can be exposed to the internet using ssh/port forwarding methods to access the website over the internet. Before exposing the website to internet, generate a new secret key for the django app
- Generate and copy new key
python3 generate_new_key.py - update secret key in ArduinoController/settings.py on line 23
# SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'your_new_key'


