This is a project carried out by Group 5 in II1302 (Spring 2022) at KTH Royal Institute of Technology.
An imaginary customer wants a cloud-based system for monitoring air quality / temperature. They want to be able to put out sensors in different rooms and connect them all to a common service in the cloud, where the data is displayed.
The overall purpose of this project is to protect human health and equipment. The product can provide incentives to lower the concentration of harmful gases in the workplace to improve the work environment. The project will also give the group experience in projects and system development.
The main goal is to develop a functioning system that meets the requirements. Some sub-goals are: a functional sensor module, integration with the cloud and a functioning web interface.
- Project definition
- Vision document
- GANTT
- Work board
- More about the iterations of the project can be found on the Wiki
- Alexander: Project leader and Environment responsible
- Johan: Architect
- Amiran: Developer
- Bashar: Tester
- Simon: Requirement responsible
To develop, start by cloning this repository.
To develop the webpage, do the following:
- Install Node and npm.
- From the root directory, run
npm install
. This installs all dependencies, including those of theweb/
subpackage, intonode_modules/
. - Set up the files
web/.env.local
(for development), andweb/.env.test.local
(for testing) with the correct credentials.web/.env.local.example
can be used as a template. ⚠ Do not commit your secrets. npm run dev
to start a live development server on localhost.- Develop. 😎
npm test
to run all unit tests.- The
.husky/pre-commit
git hook runs Prettier and ESLint on any staged files before every commit.
The required hardware is:
- AZ Envy (+ USB A to micro B cable)
- FT232RL FTDI USB to TTL adapter (+ USB A to mini B cable)
- Cables for connecting the programming pins (breadboard optional)
To develop the hardware:
- Install Arduino IDE.
- Connect all hardware as shown above. The USB mini B should be connected to your computer.
- Install any drivers needed. The board should show up on a serial port.
- Install libraries in Arduino IDE:
- In Preferences, add
http://arduino.esp8266.com/stable/package_esp8266com_index.json
to Additional boards manager URLs. - In Board Manager, search for and install package
esp8266
(https://github.com/esp8266/Arduino). - In Library Manager, search for and install:
Azure SDK for C
(https://github.com/Azure/azure-sdk-for-c/)PubSubClient
(https://pubsubclient.knolleary.net/)
- Download these repositories as zip files (Code -> Download ZIP) and add them in (Sketch -> Include Library -> Add .ZIP Library...).
- In Preferences, add
- Select the correct board type in (Tools -> Boards -> ESP8266 Boards -> Generic ESP8266 Module).
- Select the correct port in (Tools -> Port -> ...).
- Develop. 😎
- Use the relevant
config.example.h
as a template to create aconfig.h
file with correct credentials. - To upload the sketch:
- Click Upload and wait for the Output to write
Connecting.....
. - Put the board into programming mode:
- Press and hold down the RESET button, then the FLASH button.
- Then release RESET and finally release FLASH.
- After uploading you have to leave programming mode: Press RESET shortly.
- Click Upload and wait for the Output to write
The Webpage is continuosly tested in GitHub Actions. This is the latest status: