elahd / esp2ino

OTA Third Party Firmware Flasher for the original Wyze Plug (WLPP1) and Wyze Bulb (WLPA19).
MIT License
51 stars 4 forks source link

Support for Wyze Bulb Color #7

Open Adrian-at-CrimsonAzure opened 3 years ago

Adrian-at-CrimsonAzure commented 3 years ago

Opening this issue for discussion more than anything.

What would it take to bring support to the new RGB+CCT Wyze Bulb? I know it has an ESP32 inside and (as per #5) I'm aware that the ESP32 isn't supported by this tool yet.

Any chance just changing the build target to the ESP32 instead of the ESP8266 would work? I know there is some cross-compatibility in the libraries available for both. I'm willing to break one open to get serial access and dump the firmware if that would help.

elahd commented 3 years ago

Hey: Unfortunately, "porting" to the ESP32 requires writing entirely new firmware that's specific to that platform. Wyze builds their firmware on Espressif's SDKs. The ESP8266 and ESP32 have different, incompatible SDKs with different APIs. I can't use a generic framework like Arduino or MicroPython, either, because those frameworks aren't compatible with Espressif's OTA framework.

I do want to make a version for the ESP32 -- I just need to find the time. I also want to make the flashing process for this and the ESP32 easier than it is now. The ideal workflow would be a "single-click" python installer that directs the Wyze device directly to GitHub for the wyze plug flasher and Tasmota binaries. The current flashing process sucks.

I have a copy of the firmware from an ESP32-based Wyze Plug. A firmware dump from the new bulb would be great for testing (if you already plan to crack it open).

Thanks!

jtauke commented 3 years ago

Any details on dumping firmware from an esp32? I've got a couple of the color bulbs and I'd do what I could to get towards local control of them.

elahd commented 3 years ago

Schematics for the ESP32-based Wyze Plug are here. The new Wyze bulb is probably the same.

There are two options for pulling firmware. Whatever method you choose can also be used to flash Tasmota onto the chip, so this isn't a total waste of effort.

For either option, use a brand new bulb or factory reset an existing bulb. This will clear the WiFi credentials and account data from the extracted firmware. You can post the firmware here to email it to me. (I don't want to post my email address to the crawlable web. Click on "Email Me" at elahd.com.)

Extract via Serial

This is probably the easiest method.

  1. Connect a USB-to-Serial adapter to the ESP32 according to the "ESP - FTDI" mapping in the schematic. You can try connecting the serial adapter using test clips, but if that doesn't work you'll need to solder wires directly to the board.
  2. Follow these instructions to backup the firmware. You can use the instructions here to install Tasmota once the backup is complete.

Extract directly from flash chip

This method is a huge pain in the ass, but it was the only one that worked for me. I'm a mediocre solderer and burned off the serial pads on my Wyze plug.

  1. Use individual test clips or a SOIC8 test clip to connect a usb-to-serial adapter directly to the ESP32's flash chip. You'll need a fancier adapter for this -- one based on the FT2232H chip. (This board will also work for the extract via serial method.) Make the connections as shown here.
  2. Use an SPI flash extractor to read the data. Some options are pyspiflash and flashrom.

Thanks for your help!

digiblur commented 3 years ago

I did open one of the bulbs. You will have to destroy it to get to the ESP chip. They filled it entirely with the gray epoxy that I have seen before on bulbs. I assume for heat build up issues. Other disappointing thing was no cool white channel. Only warm white. It would have been awesome to have 5 channels.

Adrian-at-CrimsonAzure commented 3 years ago

Other disappointing thing was no cool white channel. Only warm white.

How does the bulb do color temperature then? Are you sure they aren't using dual channel white LEDs?

digiblur commented 3 years ago

It was mixing in blue and green on the warm white.

Adrian-at-CrimsonAzure commented 3 years ago

It was mixing in blue and green on the warm white.

Impressively convincing, I could have sworn they were built like the cheap MiLights with dedicated white/warm white LEDs.

digiblur commented 3 years ago

Afraid not, the box I just got in a couple days ago..

Warm white image

Daylight image

Cool White image

They even have them labeled as warm LEDs if you had doubts but the color gives it away too.
image