-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from IPlayZed/ADC
PR for uploading to uni.
- Loading branch information
Showing
33 changed files
with
622 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"configuration": "PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=none", | ||
"board": "esp32:esp32:esp32", | ||
"sketch": "project/src/Main/Main.ino", | ||
"sketch": "project/Main/Main.ino", | ||
"output": "build", | ||
"port": "/dev/ttyUSB0" | ||
"port": "COM3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
# Thesis on Precision Air Quality Measurements Over Network via the MQTT Protocol using ESP32 MCUs | ||
|
||
## Main milestones and their subgoals | ||
|
||
- [x] SDK | ||
- [x] WiFi connection | ||
- [x] Peripheral communication | ||
- [x] Communication with a cloud storage provider | ||
- [x] Investigate possible cloud providers. | ||
- Possible providers are: [ESP-IDF supported Cloud Frameworks](https://docs.espressif.com/projects/esp-idf/en/v4.4/esp32/libraries-and-frameworks/cloud-frameworks.html). | ||
- The choice fell on [Azure IoT](https://azure.microsoft.com/en-us/overview/iot/). | ||
- TBA | ||
- TBA | ||
- [ ] PCB implementation | ||
- [ ] Collect data and export it | ||
- [ ] Printable formal thesis | ||
- [ ] *(Optional)* Create a frontend for interactive data representation | ||
|
||
## These links are useful resources I have used, grouped by topics: | ||
This project aims to create an expandable smart net of air quality sensors. I wish to provide firmware, a backend solution for data processing, communication and a hardware prototype. | ||
|
||
### Containerization | ||
In theory almost all the hardware, software and infrastructure can be swapped out if one complies with the interfaces described in the project, but due to the nature and complexity of the system, some might not integrate as well. | ||
|
||
## Development tools used | ||
|
||
- [Docker Compose Syntax: Volume or Bind Mount?](https://maximorlov.com/docker-compose-syntax-volume-or-bind-mount/) | ||
- [Visual Studio Code](https://code.visualstudio.com/) | ||
- [Arduino Expansion Pack](https://marketplace.visualstudio.com/items?itemName=mpty.pack-arduino) | ||
- [C/C++ Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack) | ||
- [IoT Telemetry Simulator](https://github.com/azure-samples/iot-telemetry-simulator/tree/master/) | ||
- [VSCode Remote Development Docoumentation](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-types) | ||
|
||
## Libraries used in firmware | ||
|
||
The following libraries and board definition(s) should be installed via the Arduino framework. | ||
|
||
The versions referenced here are guaranteed to compile and function as expected, but you can try upgrading them if you want to, however it is possible that between versions there might be incompatibility. It is also possible that if you wish to build and flash firmware which communicates with a cloud platform with Azure, you might have to update the cloud configuration if not using the Azure templates in this repository. Always consult the documentation properly. | ||
|
||
- [esp32 by Espressif Systems](https://github.com/espressif/arduino-esp32) (version 2.0.7) (Board definition for Arduino) | ||
- [DHT sensor library by Adafruit](https://github.com/adafruit/DHT-sensor-library) (version 1.4.4) | ||
- [ArduinoJSON](https://github.com/bblanchon/ArduinoJson) (version 6.21.0) | ||
- [Adafruit MCP3008 by Adafruit](https://github.com/adafruit/Adafruit_MCP3008) (version 1.3.1) | ||
- [Azure SDK for C by Microsoft Corporation](https://github.com/Azure/azure-sdk-for-c) (version 1.1.3) | ||
|
||
## Useful links | ||
|
||
### Containerization | ||
|
||
- [Docker Compose Syntax: Volume or Bind Mount?](https://maximorlov.com/docker-compose-syntax-volume-or-bind-mount/): For configuring the telemetry simulator. | ||
- [VSCode Remote Development Docoumentation](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-types): For developing remotely or on immutable systems. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Licensed under: GNU GENERAL PUBLIC LICENSE Version 2 | ||
|
||
#include "src/tasks/Tasks.hpp" | ||
|
||
void setup() | ||
{ | ||
Tasks::configureLocalPeripherials(); | ||
Tasks::initializeConnection(); | ||
} | ||
|
||
void loop() | ||
{ | ||
Tasks::doMeasurements(); | ||
Tasks::sendTelemetry(); | ||
Tasks::Helpers::startSleep(); | ||
} |
4 changes: 2 additions & 2 deletions
4
project/src/Main/Common.cpp → project/Main/src/common/Common.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// Licensed under: GNU GENERAL PUBLIC LICENSE Version 2 | ||
|
||
#include <time.h> | ||
#include "Common.h" | ||
#include "Common.hpp" | ||
|
||
uint32_t getSecsSinceEpoch() | ||
{ | ||
return (uint32_t)time(NULL); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef COMMON_CONFIG_HPP | ||
#define COMMON_CONFIG_HPP | ||
|
||
#include "../network/Network.hpp" | ||
|
||
#define DEFAULT_INBOUND_DATA_SIZE_BYTES 128 | ||
#define DEFAULT_SERIAL_BAUD_RATE 9600 | ||
#define DEFAULT_TIME_TO_SLEEP_IN_S 30 | ||
#define DEFAULT_DELAY_FOR_SERIAL_CONNECTION 5000 | ||
|
||
#define CONFIG_SERIAL_BAUD_RATE DEFAULT_SERIAL_BAUD_RATE | ||
#define CONFIG_TIME_TO_SLEEP_IN_S DEFAULT_TIME_TO_SLEEP_IN_S | ||
#define CONFIG_DELAY_FOR_SERIAL_CONNECTION DEFAULT_DELAY_FOR_SERIAL_CONNECTION | ||
|
||
namespace Configurations | ||
{ | ||
namespace Common | ||
{ | ||
namespace Defaults | ||
{ | ||
constexpr uint8_t INBOUND_DATA_SIZE_BYTES = 128; | ||
constexpr uint16_t SERIAL_BAUD_RATE = 9600; | ||
constexpr uint16_t TIME_TO_SLEEP_SEC = 30; | ||
constexpr uint16_t DELAY_FOR_SERIAL_MILISEC = 5000; | ||
} | ||
|
||
const uint8_t INBOUND_DATA_SIZE_BYTES = Defaults::INBOUND_DATA_SIZE_BYTES; | ||
const uint16_t SERIAL_BAUD_RATE = Defaults::SERIAL_BAUD_RATE; | ||
const uint16_t TIME_TO_SLEEP_SEC = Defaults::TIME_TO_SLEEP_SEC; | ||
const uint16_t DELAY_FOR_SERIAL_MILISEC = Defaults::DELAY_FOR_SERIAL_MILISEC; | ||
} | ||
} | ||
|
||
#endif // COMMON_CONFIG_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.