Installation of Flask Web Portal

Here you will find instructions on how to install Flask web portal.

Prerequisite

  1. Clone the repository git clone https://github.com/drexelwireless/VarIOT_Portal.git

  2. Install Python 3.7 or higher

  3. (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

  1. Edit the zigbee2mqtt configuration file (on Linux this is probably /opt/zigbee2mqtt/data/configuration.yaml) to reflect the following in the advanced section:
    advanced:
      log_level: debug
    
  2. Append the following lines to /etc/mosquitto/mosquitto.conf:
    listener 1883
    protocol mqtt
    allow_anonymous true
    

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

  1. Generate public/private rsa key pair using ssh-keygen if you don’t have on your machine.

  2. Go to ~/.ssh

  3. Copy the content of your id_rsa.pub file.

  4. SSH to whichever gateway you are trying to access via ssh on the portal (such as adding a BLE device)

  5. Go to ~/.ssh on the gateway

  6. Add copied content from step 3 to the bottom of authorized_keys

Linux

  1. Generate public/private rsa key pair using ssh-keygen if you don’t have on your machine.

  2. 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