Skip to content

md-firmware (Gateway)

ESP32-S3 gateway firmware that bridges CAN bus door controllers to the Doorson cloud via MQTT.

Stack

  • Framework: ESP-IDF v5.5.2
  • MCU: ESP32-S3
  • Language: C++
  • CI/CD: GitHub Actions (builds on tag push)

What It Does

  • CAN (TWAI) communication with door controllers
  • MQTT client for cloud connectivity (device registration, commands, telemetry)
  • BLE WiFi provisioning (NimBLE)
  • OTA firmware updates
  • HTTP configuration server with basic auth
  • LED status indicators + button hold actions

Project Structure

main/
  main.cpp
  common.h
  shared_state/
  utils/
  modules/      # CAN, MQTT, BLE, OTA, HTTP, LED, button
tests/          # host-based unit tests (cmake, no ESP-IDF needed)

Build Profiles

ProfileDescription
prodProduction cloud endpoint
stageStaging endpoint
testTest endpoint
devLocal development endpoint

Building

bash
idf.py build
idf.py -p /dev/ttyUSBx flash monitor

Docker build environment: espressif/idf:v5.5.2

CI/CD

GitHub Actions workflow triggers on tag push:

  • v*.* — release build
  • v*.*-rc* — release candidate

Creates GitHub releases with built firmware binaries.

Host Tests

bash
cd tests
cmake -B build
cmake --build build
./build/tests