- Notifications
You must be signed in to change notification settings - Fork0
bbusse/compost-sensor
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository contains recipes for building software for embedded systems. While the range of applications is manifold,the examples given here relate to application for gardening / farming.
It builds an ESP32 firmware in acontainer providing anESPHome build environment
Configuration files for the firmware target are kept in aseperate repository and fetched during build
Different kinds of sensors are used for various applications, mostly for measuring temperature and humidity but alsoatmospheric pressure and fine dust where applicable
This file must contain all the necessary variables
An example is given below, adjust to your needs
WIFI_SSID="farm-nerds"WIFI_PASSPHRASE="farm-nerds-passphrase"HA_API_KEY="6C6eGlbYMw1sEYlURtpIOquRlSIk58sq9Bz46m5XDsk="HA_OTA_PASSWORD="LjwgwKMVvRlMNWom68T/lA6nR5AwFmqA"
To create an individual random HA_API_KEY
# Create keyhead -c32 /dev/random | uuencode -m
Configuration yaml files for ESPHome need to be supplied as build argument
and are fetched fromesphome-cfg
DS18B20 / BME280
$ podman build . -t compost-0 --build-arg-file=argfile.conf --build-arg ESPHOME_CFG=compost-0.yaml
DHT22 / AM2302
$ podman build . -t greenhouse-1 --build-arg-file=argfile.conf --build-arg ESPHOME_CFG=greenhouse-1.yaml
BME280
$ podman build . -t seedling-box-0 --build-arg-file=argfile.conf --build-arg ESPHOME_CFG="seedling-box-0.yaml"
BME680
$ podman build . -t weather --build-arg-file=argfile.conf --build-arg ESPHOME_CFG=weather.yaml
$ export VARIANT=compost-0$ podman run localhost/${VARIANT}$ podman cp $(podman ps | awk '/'${VARIANT}'/ {print $1}'):/home/build/.esphome/build/${VARIANT}/.pioenvs/${VARIANT}/firmware.bin .
$ pip install esphome
Connect your ESP32 for flashing
# Flash a bootloader$ esptool.py write_flash 0x0 ~/Downloads/esp32_bootloader_v4.bin# Flash the firmware$ esptool.py write_flash 0x10000 firmware.bin
ESPHome
ESPHome Source Code
ESPHome Releases
ESPHome Configuration Files
AS3935 Datasheet
BME280 Datasheet
DHT22/AM2302 Datasheet
DS18B20 Datasheet