[BK7231N on board] Flashing Anko Sunset Lamp (I004055) RGB LED lamp controller

This is a lamp sold by Kmart in Australia. Seems to be made by Mirabella but exclusively for the Kmart Anko brand. It went a bit nuts on TikTok late last year.
User manual:




Good news is (1) it's a 5v device (powered by USB) and (2) it's running a BK7231N inside. Doesn't seem to be a SoC/ESP type chip, just the BK7231N directly on a circuit board. Even more good news is that most of the pins are exposed and labelled on the underside of the board.
Photos:



Pin roles:
- P20 - button
- P6 - PWM (red)
- P7 - PWM (green)
- P8 - PWM (blue)
I was able to flash using LTChipTool (remembering to connect CEN to GND when it starts) using TX1 and RX1. Was a bit hit and miss, sometimes it would freeze at 0 or low %, but I eventually read the data from the chip and uploaded binary.
The LED bulbs are all exposed as a single RGB PWM output from the controller (R=6 G=7 B=8). The button on the controller is pin 20, inverted, with pullup active.
OBK Config:
Code: YAML
ESPHome config (snippet, add your own Wifi etc):
binary_sensor:
- platform: gpio
name: Button
pin:
number: P20
mode:
input: true
pullup: true
inverted: true
output:
- platform: ledc
id: output_red
pin: P6
- platform: ledc
id: output_green
pin: P7
- platform: ledc
id: output_blue
pin: P8
light:
- platform: rgb
id: light_rgb
name: Light
red: output_red
green: output_green
blue: output_blue
Comments
Thanks for posting this! I've got two separate Anko sunset lights flashed now and they're working perfectly! Out of the two I flashed, one was an older revision with a WB3S inside (BK7231T) instead... [Read more]
Hi, could you post the firmware dump here or by creating an issue on tuyacloudcutter repo - then it may be possible to flash this lamp via OTA in the future. [Read more]
Sure thing, is it fine if I hex edit out my WiFi credentials from the dump before uploading? I opened it up in HxD and confirmed I could see my credentials in there. [Read more]
Not sure about this, as it might change the checksums and then the tools for creating cloudcutter profile might fail. But that's only my guess, go ahead and post it without the credentials and we'll see... [Read more]
Here's the file, hoping just replacing the SSID and password chars with bogus data should be fine. If it doesn't work let me know and I'll try get a fresh copy by flashing the original firmware back to... [Read more]
flashed fine for me to a WB3S. V:BK7231S_1.0.5 CPSR:000000D3 R0:1F6FFE41 R1:2223F356 R2:F9ABF3BE R3:7B3DEA2C R4:7F5E3AB8 R13:EFAE59FF R14(LR):07E73BEF ST:14968466 J 0x10000 prvHeapInit-start... [Read more]
Nice, thanks for checking that out! Although I just realised something: that light was behaving very oddly last night after I uploaded the dump, doing stuff like flickering and turning off. Could that... [Read more]
negative, this would not be possible. A coincidence. [Read more]
Thanks for confirming, I thought as much, but I just wanted to make sure. Edit: found the reason it was misbehaving, it was only because the USB extension cable it was plugged into wasn't making the... [Read more]