This is my single project for all IoT devices I develop. I'm sharing it in hope to help others with their own IoT projects.
Sensor devices measure environmental data like temperature or humidity and send the values to centralized database.
I use InfluxDB + Grafana for collecting and presenting the sensor data.
My development environment:
Step by step:
-
Buy hardware. See
platformio.ini
for the hardware I use. Assemble the headers, sensors etc. -
Select or add new env in
platformio.ini
, adjustbuild_flags
. -
Copy
include/config.h.templ
toinclude/config.h
and fill the credentials for Wi-Fi etc. -
Run
./pio_init
to apply the changes (and install optional libraries) -
Connect the device and run
pio run --target upload
to program it. -
Debug with
pio device monitor
.
Provides centralized control of all connected devices. Each device has to actively query for new firmware and commands.
URLs:
/update
- ArduinoOTA firmware update (each device gets its own firmware)/control
- Control commands for each device, headers contain "X-Seq" which indicates a change/write
- sensor data, forward to InfluxDB
Implementation:
- Python + frontend web server (nginx)
Here I'll document the assembled devices, with links to the parts and also some photos.