โœ… All published PCBs are tested and working

Collect data from up to 16 beehives.
Self-hosted. Open source.

HiveHub is an ESP32-based data collector for beehive sensors and scales. It tracks weight, temperature, humidity, in-hive sound and vibration, and power state for up to 16 hives per ESP32, and sends everything to your own FastAPI + PostgreSQL backend.

What it measures

Up to 16 hives per ESP32. Every sensor below is optional and compiled in per device โ€” start with weight and add the rest as you build.

โš–๏ธ

Up to 16 scales

NAU7802 load-cell channels (I2C, with an optional TCA9548A mux on the breakout PCB) give each colony its own scale โ€” up to 16 hives per ESP32.

๐ŸŒก๏ธ

Per-hive temperature

DS18B20 probes on a shared 1-Wire bus, or an in-hive BLE sensor as an alternative source.

๐Ÿ”Š

In-hive sound

Stereo INMP441 I2S microphones with per-band FFT energy to catch piping and stress.

๐Ÿ“ณ

Comb vibration

An in-hive BLE sensor (e.g. HiveInside) captures the ~20 Hz pre-swarm signal microphones miss.

๐Ÿ’ง

Ambient T & humidity

A selectable I2C sensor records weather context alongside the hive readings: SHT4x (default), SHT3x, or a BME280 that also adds barometric pressure.

๐Ÿ›ฐ๏ธ

Off-grid power telemetry

Optional MAX17048 LiPo fuel-gauge data (voltage, state-of-charge, alerts) for unattended deployments.

๐Ÿ“ถ

BLE sensors

Pair any BLE-Sensor (in-hive or BLE-Scale) โ€” no extra wiring. See supported devices or request support for new devices

๐Ÿ’พ

SD cache & backup

Local buffering when uploads fail, plus an append-only persistent measurement backup.

๐Ÿ

HiveTraffic ready

Optional entrance traffic counting of incoming and outgoing bees over BLE/GATT.

๐Ÿ”‘

Claim-code pairing

Claim devices from HivePal without touching the database โ€” just a pairing code.

๐Ÿ“ก

OTA & remote commands

Over-the-air updates, remote calibration, reboot, Wi-Fi reset and config versioning.

๐Ÿง 

Rule-based insights

The backend auto-evaluates weight, temperature, sound and vibration into colony insights.

๐Ÿ“Š

Built-in dashboard

An optional, login-free web dashboard served straight from the backend โ€” charts, status, device configuration and OTA/calibration controls. Try the demo โ†’

Hardware at a glance

A mains-or-solar ESP32 board plus off-the-shelf modules on pin headers โ€” no SMD soldering required for the core build. All published PCBs are tested and working.

Core (recommended)

Seeed XIAO ESP32-C6 on the Scale Module V0.4 with off-the-shelf modules on pin headers: NAU7802 load-cell ADC ยท MAX17048 battery gauge ยท TPS63020 buck-boost ยท TP4056 USB-C charger ยท DS3231 RTC ยท microSD ยท SHT40 ยท DS18B20 probes ยท setup button ยท BLE in-hive sensors.

Optional: up to 16 scales

The NAU7802 breakout PCB adds a TCA9548A I2C mux with up to 8ร— NAU7802 โ€” 16 scales in total per HiveHub.

Optional off-grid

CN3791 MPPT solar charger ยท 6 V solar panel ยท LiPo or 18650 pack โ€” the MAX17048 reports the battery state with every measurement.

The full build guide with BOM, prices, wiring and setup lives on the Build your own page; pin maps are in docs/wiring.md.

Set up your own HiveHub

Five steps from clone to live data. The firmware is a PlatformIO project; the backend is a Docker Compose stack. Building the hardware too? Start with the full build guide.

1

Get the code

Clone the repository and open the firmware project in PlatformIO (VS Code extension or CLI).

git clone https://github.com/MacNite/HiveHub.git
cd HiveHub
2

Stand up the backend

Bring up the FastAPI + PostgreSQL stack with Docker Compose. The API listens on port 31115.

cd docker
cp .env.example .env
# edit API_KEY, HIVEPAL_SERVICE_API_KEY, DB password, volumes
docker compose up -d

See docker-install.md or truenas-install.md for hosting details.

3

Configure the device

Recommended: configure the device from its on-device provisioning portal. After flashing, hold the setup button to start the HiveHub Wi-Fi access point, connect to it, and set Wi-Fi, backend, hives and sensors right on the device. Those settings live in the device's storage and survive OTA updates.

Optionally pre-seed a brand-new device before first boot with the in-browser config tool (it generates an optional secrets.h) โ€” or skip it and pair everything from the portal.

โš™๏ธ Open the config tool

Manual route: cp firmware/include/secrets.example.h firmware/include/secrets.h and edit it.

4

Flash the firmware

Drop your secrets.h into firmware/include/, then build and upload.

cd firmware
pio run --target upload
pio device monitor   # 115200 baud
5

Claim & watch the data

On first boot the device sends measurements with its claim code. Two ways to watch it:

Built-in dashboard (no account): set ENABLE_LOCAL_DASHBOARD=true and open http://<your-host>:31115/dashboard โ€” a login-free web UI with charts, status, OTA and calibration for a single-owner self-host (see the live demo).

HivePal (multi-user app): claim the device from HivePal with POST /api/v1/app/devices/claim for accounts, sharing and mobile access.

Field configuration without reflashing: press the setup button to open the HiveHub-Setup-XXXX Wi-Fi provisioning portal at http://192.168.4.1.

Dig deeper

๐Ÿ“Š Built-in dashboard

The login-free web dashboard served from the backend โ€” how to enable and use it.

Live demo โ†’ ยท docs โ†’

๐Ÿ“˜ API reference

Device & HivePal endpoints, schemas and the measurement payload.

docs/api.md โ†’

๐Ÿ”Œ Wiring

Full pin map, pull-ups and the load-cell wiring reference.

docs/wiring.md โ†’

๐Ÿ“ณ Vibration (BLE)

Per-hive vibration monitoring and the ~20 Hz swarm signal, from an in-hive BLE sensor.

docs/accelerometer.md โ†’

๐Ÿ“ถ BLE sensor

Pairing the HolyIot 25015 in-hive beacon.

docs/holyiot-ble-sensor.md โ†’

๐Ÿง  Insights

The rule-based colony detector catalogue and its sources.

How insights work โ†’

๐Ÿ›ฐ๏ธ Off-grid notes

LiPo (MAX17048) power-telemetry behaviour and the wake/deep-sleep cycle.

docs/offgrid-firmware-notes.md โ†’

๐Ÿ“ก Device not supported?

Get your wireless device added โ€” request support as a GitHub issue and capture the data with nRF Connect.

How to get it added โ†’