README preview — how these render on GitHub (temp page):front pageble-listenersht30-nodeds18b20-nodesdi12-readermodbus-readeranalog-readercwsi-nodeloadcell-water

Open Agriculture Technology

The OAT Sketch Library

ESP32 firmware that reads your sensors and lands every measurement somewhere you own.
No cloud account. No subscription. No lock-in. Your data goes where you point it.

licenseApache-2.0 schemaoat-ods/0.3 platformESP32 | S3 | C3 | C6 siteopenagriculturetechnology.com


Every sketch here does the same honest job: read a sensor, turn the reading into a small self-describing message, and push it to an endpoint the grower chooses — a webhook or an MQTT broker. That's the whole contract. The endpoint can be Home Assistant, a database on a Raspberry Pi, a spreadsheet-feeding script, or the free test endpoint where you can watch your first reading arrive.

BLE sensors
Wired probes
1-Wire · I²C · SDI-12
RS-485 · analog
OAT node
(one ESP32, this firmware)
oat-ods over
webhook or MQTT →
YOUR endpoint
Home Assistant · database
test bench · anything
Dashboards · alerts
records you keep

The message format is oat-ods — one JSON envelope for every sensor, so your endpoint can't tell a $600 research instrument from a $12 thermometer. It's all one stream of data you keep.

The sketches

Sketch Reads Interface Status
BLE Sensor Listener Govee-class Bluetooth sensors — temperature, humidity, soil, CO₂, and ~120 device types BLE (no wiring) Liveflash from the browser
SHT-30 Node Accurate air temperature + humidity, one or two sensors per board I²C Liveflash from the browser
DS18B20 Node Sealed temperature probes, up to ten on a single wire 1-Wire Liveflash from the browser
SDI-12 Reader Research-grade soil, water and weather instruments (Apogee, METER, Acclima…) SDI-12 bus Source — build & flash
Modbus / RS-485 Reader Industrial Modbus RTU sensors, multi-drop over long runs RS-485 Source — build & flash
Analog & 4–20 mA Reader The huge install base of analog and current-loop sensors ADS1115 (I²C) Source — build & flash
CWSI Node Canopy temperature — the earliest water-stress signal — with a no-contact IR eye MLX90614 (I²C) Source — build & flash
Load-Cell Watering Node Pot weight and water use, plus a local weigh-and-water loop HX711 Source — build & flash

Status, honestly: Live means compiled images are published and you can flash from the browser on the site — no IDE, no command line. Source means the code is complete and openly licensed, but you build it yourself (five minutes with PlatformIO, below).

Set up one OAT node and you have set up all of them. The sketches share one core: the same captive-portal setup page, the same Wi-Fi flow, the same push engine (HTTPS-preferred, HMAC-signed, batched), the same 60-second health heartbeat, the same two-way USB console. Only the sensor read differs.

Quick start

Live sketches — no toolchain at all:

  1. Open the sketch's page on the site (links above) in Chrome or Edge.
  2. Plug in the ESP32 and click Install (ESP Web Tools, straight from the browser).
  3. Join the node's own Wi-Fi (OAT-…), and its setup page walks you through Wi-Fi, delivery, and naming.
  4. Point delivery at the test endpoint and watch your first reading arrive.

Source sketches — build it yourself:

pipx install platformio          # or: pip install --user platformio
cd oat-sdi12-reader              # any sketch directory
./build.sh

Each sketch's platformio.ini pins its dependencies; build.sh produces one merged, flash-at-offset-0 image per supported chip in out/.

What a reading looks like

Every measurement becomes one small record inside a signed batch — canonical measurement names and SenML units from the shared vocabulary, with provenance down to the physical sensor:

{
  "stream": "gh2-soil",
  "measurement": "soil_moisture",
  "value": 34.2,
  "unit": "%",
  "agg": { "window_s": 300, "samples": 10, "method": "mean" },
  "source": { "physical_id": "sdi12:0" }
}

Swap the probe and the stream's history carries on — the stream is the durable identity, and the physical sensor is recorded per reading.

Coming next

Listed so the library shows its shape — not yet written: 915 MHz RF Listener (Ecowitt/Fine Offset weather sensors via the rtl_433 device universe) · LoRa Field Node + LoRa Bridge (point-to-point, no network server, no subscription) · Soil-Moisture Node (capacitive starter) · Rule-Driven Relay (the Control-side conversation, with fail-safe defaults spelled out).

Repository layout

oat-<sketch>/        one directory per sketch: .ino, platformio.ini, build.sh, README
lib/oat_ods/         the shared oat-ods encoder + measurand vocabulary
lib/oat_sign/        the shared HMAC push signer
lib/oat_node_core/   the shared node core (config, Wi-Fi, portal, push engine)
oat-node-template/   the starting point for a new sketch
docs/                images and shared documentation

Licensing

Contributing

Contributions are welcome — fixes, new device decoders, whole new sketches on the node template. By submitting, you agree your contribution is yours to give and is licensed under this repository's terms (we may relicense reference implementations for compatibility; you always keep your own rights to your own work). We're a small crew: issues and pull requests get honest attention, not instant attention.

About

OAT — Open Agriculture Technology — is an open collective around one idea: appropriate technology for growing things — the right tool for the need, the budget, and the environment, spanning DIY and commercial. The Library teaches it, the Solution Store frames it around real needs, and these sketches are the firmware half of the promise: your sensors, your data, somewhere you own.

An OpenCDC initiative.