e32wamb: ESP32-C6 Hue White Ambiance Replacement

A Zigbee-based firmware for the ESP32-C6 microcontroller designed to replace the driver in Philips Hue White Ambiance ceiling lights. Built using the ESP-IDF framework, it provides a custom implementation for smart lighting control and integration.

e32wamb: ESP32-C6 Hue White Ambiance Replacement

Overview

The e32wamb project is a specialized firmware designed for the ESP32-C6, specifically targeting the replacement of the original driver in Philips Hue White Ambiance lights, such as the “Beng Ceiling Light.” This project represents a deep dive into reversing existing smart home hardware and providing a high-performance, open-source alternative that integrates seamlessly into Zigbee networks.

Technical Architecture

Built on the ESP-IDF (Espressif IoT Development Framework), the project leverages the ESP32-C6’s native support for 802.15.4 protocols. It utilizes the Zboss Zigbee stack to implement the necessary clusters for a White Ambiance light, allowing for color temperature and brightness control. The firmware runs on FreeRTOS, which is the standard real-time operating system for ESP-IDF projects, ensuring reliable task scheduling and resource management.

Key Components

  • Zigbee Integration: The firmware enables the ESP32-C6 to act as a Zigbee router/end-device, supporting standard light control clusters.
  • Manufacturing Tools: The repository includes esp_zb_mfg_tool.py, a utility for generating Zigbee factory NVS partition images. This allows users to customize parameters like MAC addresses and manufacturer codes.
  • Partition Management: A custom partitions.csv defines the memory layout, including dedicated storage for Zigbee configuration (zb_storage) and factory data (zb_fct).
  • Security: The project incorporates mbedTLS for cryptographic operations, specifically configured for Zigbee security requirements like CCM* and ECJPAKE.

Hardware and Implementation

The project is the result of a reversing effort aimed at understanding how Philips Hue drivers operate and how they can be replaced with modern, more flexible hardware like the ESP32-C6. While the project is currently a work in progress, it provides a functional base for developers looking to build their own smart lighting solutions.

Current Limitations

As an evolving project, there are a few known areas for improvement:

  • OTA Support: Over-the-air updates are not yet implemented.
  • Gamma Correction: Light transitions (fades) currently lack gamma correction, which may affect the perceived smoothness of dimming and color temperature changes.

Getting Started

The build system is designed to be portable, utilizing a Docker-based environment (in-docker.sh) to ensure consistent compilation results. Developers need to configure their own Trust Center keys and can use the provided manufacturing tool to flash unique Zigbee identities to their devices. The project uses standard ESP-IDF tools like idf.py for building and esptool.py for flashing the resulting binaries to the ESP32-C6 hardware.