Table of Contents
Envy is a distribuited-system based on the client-server model that allows you to manage, store and control your home environmental statistics.
The system is composed by this entities :
- Web server,
- MCU server,
- Device-DB,
- Client-DB,
- Home-DB,
- MCU set,
- Web app.
A express app that present the following feature :
-
User provisioning :
- sign-up,
- login,
- change password,
- change username,
- change email,
- logout.
-
User's home provisioning :
- name,
- state,
- city,
- street,
- street number,
- room number.
2.a room :
- name,
- floor,
- sensors.
-
User authentication.
-
User session.
-
User home recap (devices, allarms, rooms).
-
Periodic home enviromental statistic recap.
-
Periodic room enviromental statistic recap.
A express app that present the following feature :
-
MCU provisioning :
- sign-up,
- login,
- sign-up sensors,
-
MCU authentication.
-
MCU session.
-
MCU status.
-
MCU allarms.
-
Warm restart.
-
Query sensor data.
-
MCU-DB management.
Every time time that the server make a request to a specific MCU, the mcu perform the measure that are releated to the request and submit the result. This data are stored by the server into the database.
A client, can interact with the system throught a website that allow him to check and display the current status of devices and sensors and monitoring the enviromental statistics.
The database is managed only by the MCU server application.
For each MCU store :
- hardware specification
- sensor list
- network info
- MCU activity
- planned routine
For each sensor store :
- model
- type
For each measure store :
- result
- timestamp
- sensor ID
For each routine store :
- related MCU operation
- timestamp creation
- timestamp last enable
- timestamp last disable
The client database is managed only by the web-server application.
For each web client store :
- username
- password
- last login
- last logout
- activity time
...
For each user home store :
- name
- state
- city
- street
- room set
- device
- enviromental statistic
- [1] Develop of Envy board hardware.
- [2] Develop of Envy board firmware.
- [3] Setup VM host and networking.
- [4] Develop of Envy board server application.
- [5] Develop of Envy board db.
- [6] Testing of Envy board db.
- [7] Debug of server-mcu event handler.
- [8] Develop of Envy web server application.
- [9] Develop of client db.
- [10] Testing of client db.
- [11] Develop of home db.
- [12] Testing of home db.
- [13] Testing of Envy web server application.
- [14] Develop of Envy web application.
- [15] Develop of Envy web application.
- [16] Debug of client-web server event handler.
- C++
- Javascript ECMAScript 6
- HTML 5
- CSS
- Love
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
A server machine that is compatible with :
- Node.js v14.21.3
- MongoDB v6.0.5
One or more mcu with :
- 60 kbyte of ROM.
- Compatibility with Arduino framework.
- Network access.
- ADC 10bit res.
- 3 GPIO port.
One or more of this component :
- (0, n) DHT 11/22 digital humidity temperature sensor.
- (0, n) HC-SR-501 PIR sensor.
- (0, n) Photoresistor.
- (0, n) Led.
- arduino-libraries/Ethernet@^2.0.0
- bblanchon/ArduinoJson@^6.18.5
- adafruit/DHT sensor library@^1.4.3
- ricaun/ArduinoUniqueID@^1.1.0
- khoih-prog/WebSockets2_Generic@^1.9.0
- socket.io
- express.js
- chart.js
- cookie-parser: 1.4.6,
- cors: 2.8.5,
- express: 4.18.2,
- mongodb: 5.2.0,
- node: 14.20.0,
- socket.io: 4.6.1,
- uuid: 9.0.0
- Download and install Node.js v14.20.3
- Download and install MongoDB v6.0.5
- Download and install the Platformio vscode extension.
- Download the Arduino Framework for your mcu model and all the libraries.
- Configure the IDE with your device info.
- Build your board.
- Flash the envy board firmware.
this is the content of the platformio.ino files used in test :
[env:nucleo_f401re]
platform = ststm32
board = nucleo_f401re
framework = arduino
lib_deps =
arduino-libraries/Ethernet@^2.0.0
bblanchon/ArduinoJson@^6.18.5
adafruit/DHT sensor library@^1.4.3
ricaun/ArduinoUniqueID@^1.1.0
khoih-prog/WebSockets2_Generic@^1.9.0
upload_protocol = stlink
monitor_speed = 115200
- Clone the repo
git clone https://github.com/UniCT-WebDevelopment/Envy.git
- Move to envy dir
cd download_dir_/envy
- Run the server.
node app.mjs
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Gianluca Trigili - gianluca.trigili@gmail.com
Project Link: https://github.com/UniCT-WebDevelopment/Envy