Custom firmware on Xiaomi (Yeelight) night lamp

SWD debugger attached to Yeelight BLE module

The Xiaomi Mi Motion Activated Night Light is a relatively cheap device that comes with a Xiaomi MHCB05P BLE module (the same module is used in the latest Xiaomi electric scooters).

I was able to dump the existing firmware, since the flash was not read-out protected. After this, I compiled and download my own code to the module.

The LED strip of the light is connected to P0_0 of the BLE module and I flashed some classic Blinky code that turns the GPIO pin on and off in a fixed interval.

Running Blinky custom firmware on Yeelight

Going further

The next step is publishing a BLE service that allows turning the lamp on and off. It would also be interesting to make use of the motion sensor and broadcast messages over BLE whenever motion is detected.