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:
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:
/dev/ttyUSB0
meshlog.db
is created, and initialize the schema with schema.sql
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.