This is the codebase for a mesh network of IoT devices used to sense and report environmental data, made with ESP8266 and ESP32 microcontrollers, the PainlessMesh library, and various sensors to measure temperature, humidity, ambient noise, vibration, and whatever other data you want.
The nodes in the network are made up of these devices:
- Edge node - ESP32/ESP8266 coupled with a Raspberry Pi
- Other nodes - ESP32/ESP8266 standalone.
- Ivor Benderavage - @ivorysoap
- Humam Shwaikh - @HumamShwaikh
The Raspberry Pi logger, (rpi_logger directory) runs continuously and stores messages received by the Pi (through the master node via serial connection) in a SQLite3 DB. To run it:
- Make sure the master node is connected to Pi via USB using port
/dev/ttyUSB0 - Make sure
meshlog.dbis created, and initialize the schema withschema.sql - Make sure you have all the dependencies:
- sqlite3
- libsqlite3-dev
Then build it using the following command:
g++ -Wall main.cpp serialMonitor.cpp rs232.c -o a.out -std=c++11 -lsqlite3
Finally, run:
./a.out
All the nodes run one of the following .cpp files:
logServer.cpp- run by the central server.logClient.cpp- run by the nodes in the mesh.
In platformio.ini, you have to
use the src_filter option to exclude and
include the files to be built and
uploaded. For example,
src_filter = +<logClient.cpp> -<logServer.cpp> will exclude
logServer.cpp.