No description
Find a file
2026-01-28 20:22:52 +01:00
marax.ino marax.ino aktualisiert 2026-01-28 20:20:00 +01:00
README.md Dateien nach „/“ hochladen 2026-01-28 20:22:52 +01:00

MaraX ESP8266 Monitor

ESP8266 firmware for monitoring a Lelit MaraX espresso machine via UART and a VL53L1X time-of-flight (ToF) sensor. The device exposes a live web UI, publishes telemetry to MQTT, and supports OTA updates. Configuration is stored in LittleFS and editable through the web UI.

Features

  • Live dashboard and status pages served from the ESP8266
  • MQTT publishing for temperatures, heater/pump state, water level, and device status
  • VL53L1X ToF distance sensor mapped to water level percentage
  • UART parsing for MaraX telemetry
  • OTA firmware updates
  • AP fallback (ConfigAP) when Wi-Fi or config is missing

Hardware

  • ESP8266 (targeted at Wemos D1 Mini)
  • MaraX UART connection on GPIO14 (D5)
  • VL53L1X ToF sensor on I2C:
    • SDA: D2
    • SCL: D1

Web Endpoints

  • / Live dashboard (temperatures, water level, heater/pump)
  • /status Status + UART log
  • /config Configuration form
  • /save POST to save config and reboot
  • /distance Raw ToF distance (mm)
  • /live.json Live data JSON
  • /status.json Status JSON
  • /log?since=<version> Incremental UART log

Configuration

On first boot (or if config is missing), the device starts an AP named ConfigAP. Connect and open the IP shown by your OS to access /config.

Configuration fields:

  • SSID / Password
  • MQTT server, port, topic
  • ToF min / max (mm) used to map distance to water level (0100%)

Config is stored in LittleFS as /config.txt with one value per line in this order:

  1. SSID
  2. Password
  3. MQTT server
  4. MQTT port
  5. MQTT topic
  6. ToF min (mm)
  7. ToF max (mm)

MQTT Topics

Base topic is the configured MQTT topic. The firmware publishes:

  • Raw UART line to <base>
  • Parsed data:
    • <base>/mode
    • <base>/version
    • <base>/steamTemp
    • <base>/targetSteamTemp
    • <base>/hxTemp
    • <base>/boostCountdown
    • <base>/heaterOn
    • <base>/pumpOn
  • ToF and water level:
    • <base>/tof (avg mm)
    • <base>/tof_raw (last mm)
    • <base>/waterlevel (0100%)
  • Status:
    • <base>/status/uart
    • <base>/status/tof
    • <base>/status/uart_last_ms
    • <base>/status/wifi_rssi
    • <base>/status/ip
    • <base>/status/uptime_s
    • <base>/status/wifi_reconnects
    • <base>/status/uart_invalid_count
    • <base>/status/uart_last_invalid
  • Heap:
    • <base>/heap/free
    • <base>/heap/frag
  • Boot info:
    • <base>/status/reset_reason
    • <base>/status/reset_info
    • <base>/status/sdk_version
    • <base>/status/build_name
    • <base>/status/build_time
  • Device IP published once at connect: <base>/ip

Build & Flash

This is a standard Arduino sketch. Ensure the following libraries are installed:

  • ESP8266 core
  • ESPAsyncTCP
  • ESPAsyncWebServer
  • PubSubClient
  • LittleFS (ESP8266)
  • Adafruit VL53L1X

Then build and upload marax.ino using Arduino IDE:

  1. Install the ESP8266 board package in Boards Manager.
  2. Select your board (e.g. "Wemos D1 Mini") and the correct port.
  3. Install the listed libraries via Library Manager (or add them manually).
  4. Open marax.ino and click Upload.

Notes

  • UART parsing expects a 7-field, comma-separated line (MaraX format). Invalid frames are counted and published.
  • When OTA is in progress, the JSON endpoints return {"ota":true} with HTTP 503.