The hardware is tasked with the remote monitoring of various weather elements such as, temperature, humidity, heat index, pressure, moisture of soil as well as altitude.
The backend is tasked with storing data, published by the hardware, in the database following the schema specified in the hardware specifications. Additionally, it is responsible for making the stored data in the database accessible to the frontend through API routes.
The frontend plays a pivotal role in delivering three distinct user interfaces. These interfaces encompass displaying components used in hardware, real-time visualization of data generated by the environmental monitoring sensors, and the ability to visualize as well as perform statistical analysis on the data stored in the database. This multifaceted approach ensures a comprehensive and user-friendly experience, empowering users to efficiently interact with and derive insights from the monitoring system.
Download and install Arduino IDE if you haven't already done so. Subsequently, install the following Arduino IDE libraries if they are not currently installed, following the tutorial here:
- FastLED by Daniel Garcia
- esp32 by Espressif Systems, from the Board Manager tab in the Arduino IDE
- ArduinoJson by Benoît Blanchon
- PubSubClient by Nick O’Leary
- DHT sensor library by Adafruit
Always ensure to establish a virtual environment and install the necessary packages from your requirements file if you haven't already done so. Following that, activate your virtual environment and proceed to run your Flask API.
The commands below must executed from a command line terminal in the hydromonitor/backend/ folder
Windows
python -m venv envLinux
python3 -m venv envWindows
.\env\Scripts\activateLinux
source env/bin/activatepip install -r requirements.txtCreate a .env file in the backend/ folder to store the application's environment variables. Refer to the lab manual for the specific information that must be added to this file.
Windows
py run.pyLinux
python3 run.pyVSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Customize configuration See Vite Configuration Reference.
In a command line terminal, execute the first commands in the hydromonitor/frontend/ folder to initiate the dev server for the initial setup.
Once development is complete, run the final command to generate production files. Please be aware that the generation of production files is not part of this course.
Project Setup
npm installRun dev server (Compile and Hot-Reload for Development)
npm run devCreate a production bundle (Compile and Minify for Production)
npm run build