Installation of Flask Web Portal
Here you will find instructions on how to install Flask web portal.
Prerequisite
Clone the repository
git clone https://github.com/drexelwireless/VarIOT_Portal.gitInstall Python 3.7 or higher
(Linux) Might require to install
apt-get install python-venv
Setting up Virtual Environment
Windows
virtualenv variot_portal_env
./variot_portal_env/source variot_portal_env/Scripts/activate
pip install -r requirements.txt
Linux/Mac
virtualenv -p <python_version> variot_portal_env
source variot_portal_env/bin/activate
variot_portal_env/bin/pip3 install -r requirements.txt
Example of <python_version>: virtualenv -p python3.7 variot_portal_env
Configuration
- Edit the
zigbee2mqttconfiguration file (on Linux this is probably/opt/zigbee2mqtt/data/configuration.yaml) to reflect the following in theadvancedsection: advanced: log_level: debug
- Edit the
- Append the following lines to
/etc/mosquitto/mosquitto.conf: listener 1883 protocol mqtt allow_anonymous true
- Append the following lines to
Run
python run.py
Trouble Shooting - Linux
If you get an error about “No module named …” try
variot_portal_env/bin/python3 run.py
Setup for ssh
Non-Linux
Generate public/private rsa key pair using
ssh-keygenif you don’t have on your machine.Go to
~/.sshCopy the content of your
id_rsa.pubfile.SSH to whichever gateway you are trying to access via ssh on the portal (such as adding a BLE device)
Go to
~/.sshon the gatewayAdd copied content from step 3 to the bottom of
authorized_keys
Linux
Generate public/private rsa key pair using
ssh-keygenif you don’t have on your machine.Run the following from your own machine:
ssh-copy-id <user>@<host>where<user>is the username on the remote host, and<host>is the host name or IP of the remote host