Dash app for ESP32-GPSRTK2 rover
Dev get started (VScode)
Local Dash app setup
- right click on project root folder > select open in terminal
python -m venv .venv
to setup python virtual environment for this project. TIP: copy from here and right click in terminal to paste-and-execute.- Dialog should come up asking you want this env as interpreter for project: answer yes.
- If no to (3) on blue ribbon at bottom of VSCODE, on left click on interpreter, chose the venv one you just created.
- Might get some bits and both e.g. 'install pylint' etc. click install for them.
pip install -r requirements.txt
to install packagespip install -e .
to make editable- Run
./dash_app/index.py
to run with dev server. (Running./production.py
runs usinggunicorn
in production environment)
Dependancies/ packages
Use pip-chill
to freeze requirements file, rather than pip freeze
and delete dash_app
line that's created.
pip-chill > requirements.txt
Mosquitto MQTT broker server
MQTT messaging used to communicate between Dash app and the rover (on same wifi network). You need to install Mosquitto to act as a broker (separate process to Dash app server). I have developed on Windows machine, so instructions need to be adjusted for Linux:
- Could not Mosquitto v2 working with Websockets MQTT (which Dash app uses), so using v1.6.9 (d/l here). Installed in standard location at
c:\program files\mosquitto
- Running
start_broker.bat
from cmd line in VSCode will start broker, usingmosquitto.conf
config file included. Alternatively userunme.py
to start broker and dash app.
./start_broker.bat
- You'll need to modify
config.toml
,start_broker.bat
and/ormosquitto.conf
if anything changed, eg:
- (Websockets) ports need to match. Default port set to 8083.
- Install location for Mosquitto not as above default.
- You may need to fiddle with Firewall/ Anti-virus software to permit connections.
Configuration file ('config.toml')
Config file for Dash app (based on my WIP template). Self explanatory, mostly.