GROUU · Nodes · WiFi Sensor Node
Developed · firmware published

WiFi Sensor Node

The reference template for local sensing on GROUU: an ESP32 that reads a sensor and publishes JSON over WiFi + MQTT, with reconnect logic and over-the-air updates. Complete, documented firmware you can clone, configure and flash.

ESP32 DHT22 MQTT · PubSubClient ArduinoOTA PlatformIO
Level of development

What's published

This node is complete as a firmware template. It runs on a stock ESP32 dev board, so there's no custom PCB — just source, a minimal parts list, and documentation.

Firmware / code Full source, PlatformIO and Arduino, on GitHub. ✓ Available
Parts list ESP32 dev board + DHT22 + pull-up. Breadboard-simple. ✓ Available
Custom PCB Not required — runs on the stock dev board. — N/A
Documentation Config, topics, libraries and full code walkthrough. ✓ Available
How it works

Connect, publish, stay reachable

Joins WiFi with automatic reconnect.

Publishes / subscribes over MQTT via PubSubClient.

Reads DHT22 and sends {"t2":x,"h2":x} every 3 s.

OTA updates, armed remotely via a control topic.

Accepts a remote reboot command.

🔧📷 Wiring diagram / photo: ESP32 + DHT22 on breadboard
Configuration

Set these for your site

Each node is named by the GROUU convention, so its topics derive automatically:

Grouu[Installation][Type][ID]
Installation
<your-site>
Type · ID
<type> · <n>
WiFi
<ssid> / <password>
MQTT broker
<broker-host>:1883
Sensor
DHT22 on a GPIO pin
MQTT topics

Publish, control, log

Derived from the host name — swap in your own:

<host>/sensors
Publishes the JSON reading every 3 s
system/set/<host>
Subscribes for control — OTA_ON / REBOOT
system/log/<host>
Publishes connection & status logs

Libraries: WiFi, Adafruit_Sensor + DHT, ArduinoJson, PubSubClient, ArduinoOTA.

Firmware & parts

Clone it, wire two parts

src/main.cpp — read the DHT22, publish JSON over MQTT

void publishValues() {
  JsonDocument doc;
  char output[80];
  float newT = dht.readTemperature();
  float newH = dht.readHumidity();
  if (isnan(newT)) {
    Serial.println("Failed to read from DHT sensor!");
  } else {
    doc["t2"] = newT;
    doc["h2"] = newH;
    serializeJson(doc, output);
    client.publish(MQTT_room_sensors_PUBLISH_TOPIC.c_str(), output);
  }
}
PartRoleSource
ESP32 dev boardMCU + WiFi (the PlatformIO env targets a XIAO ESP32-C3)
DHT22 (AM2302)Temperature + humidity, data on pin D7
4.7k–10k pull-upOn the DHT data line
MQTT brokerAny — e.g. the GROUU StackServer Stack
How to reuse

Four steps to a running node

01
Clone

Pull the WiFi node folder from the repo.

02
Configure

Set installation, WiFi and broker; wire the DHT22.

03
Flash

Build & upload with PlatformIO.

04
Point at a broker

Any MQTT broker — e.g. the GROUU Stack.