Coder Social home page Coder Social logo

elahd / esp2ino Goto Github PK

View Code? Open in Web Editor NEW
53.0 5.0 4.0 26.54 MB

OTA Third Party Firmware Flasher for the original Wyze Plug (WLPP1) and Wyze Bulb (WLPA19).

License: MIT License

CMake 0.18% C 72.52% Python 1.76% JavaScript 5.09% Shell 0.22% HTML 18.31% Batchfile 0.01% SCSS 1.92%

esp2ino's Introduction

GitHub release (latest by date) GitHub all releases GitHub Buy Me A Coffee

☠☠☠

Wyze recently changed their API in a way that prevents esp2ino from being loaded onto their devices. If you're technically inclined, see this GitHub issue for a workaround. Otherwise, check back here for updates...

☠☠☠


esp2ino

Formerly Wyze Plug Flasher

Free your ESP8266-based smart home devices from vendor lock-in. esp2ino loads Arduino-based third-party firmware (Tasmota, ESPurna, ESPEasy, etc.) on to ESP8266-based devices over-the-air.


Purpose

The ESP8266 is a cheap and ubiquitous microcontroller that powers many consumer smart home devices, most of which are agents of vendor lock in. esp2ino lets you install your own Arduino-based firmware onto ESP8266-based devices over the air — that is, without physically opening the device.

Supported Devices

  1. Wyze Plug (model WLPP1)
  2. Wyze Bulb (model WLPA19)

Theoretically, esp2ino can convert most new ESP8266 based devices. See Contibuting in the wiki for more information.

How it Works

Manufacturer firmware for ESP8266-based devices are usually built on the ESP8266 RTOS SDK. This SDK is maintained by Espressif, the chip's manufacturer. ESP8266_RTOS_SDK's bootloader cannot boot Arduino-based firmware. In order to boot Arduino-based firmware, you have to replace the ESP8266_RTOS_SDK bootloader. There are now two options for doing this:

  1. Serial Connection: Physically open the device and load firmware over a serial connection while the device is offline. This is easy on some devices, but is destructive and time-consuming on others.
  2. esp2ino: Force the device to load esp2ino. Once installed, esp2ino replaces the ESP8266_RTOS_SDK bootloader with Arduino's eboot bootloader while the device is running. It then loads the Arduino-based firmware of your choice onto the device. After performing this critical task, esp2ino deletes itself.

⚠️ Warnings & Liability Disclaimers

  1. This is a one-way conversion. esp2ino has a backup function, but the only way to restore your device from the backup is over a serial connection. That is, you'd need to open your device and solder wires to its PCB.
  2. This is alpha software with alpha-level code quality and stability. It has not been thoroughly tested. You're more likely to brick your device with this loader than you are with a more mature project like Tuya-Convert.
  3. This project is not supported by or otherwise affiliated with Wyze or Espressif Systems. It's a hobby project maintained by an individual, built for personal use, and shared without any guarantees.
  4. Loading third party firmware may void your warranty.
  5. Loading third party firmware may brick your device 🧱, cause it to catch fire 🔥, or just cause unexpected behavior 🤪. Liability for this falls on you!

This software is provided as-is with no guarantees as to quality, features, functionality, or safety. Use of this software is entirely at your own risk. You agree to not hold the author liable for damage, loss of life, financial damages, loss of functionality, etc.


Install Instructions

See install page in the wiki.


Contributing

See the Contributing page in the wiki or just buy me a coffee.


esp2ino vs tuya-convert

esp2ino borrows concepts from tuya-convert. For background, tuya-convert has two basic parts:

  1. Firmware loader. This tricks the IoT device into accepting third party firmware by emulating Tuya's cloud infrastructure.
  2. Intermediate firmware. This firmware modifies the device's bootloader to accept Arduino-based firmwares.

esp2ino is different from tuya-convert in the following ways:

  1. Firmware loader. esp2ino currently targets two Wyze products and uses the WyzeUpdater script to push esp2ino's intermediate firmware onto these devices. Tuya-convert targets devices manufactured by Tuya Smart and loads itself onto devices using Tuya-convert's own loader. (Tuya devices are sold under white label by various manufacturers.)
  2. Intermediate firmware. Tuya-convert's intermediate firmware targets devices with firmware built on versions < 3.0 of the ESP8266 RTOS SDK. esp2ino targets devices with firmware built on ESP8266 RTOS SDK versions >= v 3.0.

Sources

esp2ino builds on:

  1. WyzeUpdater
  2. Tuya-Convert
  3. Espressif's ESP8266_RTOS_SDK program samples.
  4. vtrust's esp8266-ota-flash-convert

esp2ino's People

Contributors

dependabot[bot] avatar elahd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

esp2ino's Issues

No effect on WLPP1 with firmware 1.2.0.80

Thanks for publishing and improving this package!

I have been trying 0.3 with two original Wyze Plugs without success. They have static IPs and connect to the Wyze app without issue. Running wyze_updater_macos authenticates and lists devices successfully, and appears to push the bootloader to the plug, but the plug doesn't reboot - its status in the Wyze app changes to offline, but it can be pinged, although it's not serving the esp2ino GUI on port 80 as expected. After a minute or two, without unplugging/rebooting, it shows as online in the Wyze app again and can be controlled.

Has anyone had success with firmware 1.2.0.80?

Support for Wyze Bulb Color

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.

error 3005:UnauthorizedOperation when using update command

INFO:root:Pushing firmware URL to device.
Traceback (most recent call last):
  File "wyze_updater.py", line 401, in <module>
    args.action(creds, args)
  File "wyze_updater.py", line 286, in update_devices
    push_update(creds, dev_info['product_model'], mac, url, md5)
  File "wyze_updater.py", line 164, in push_update
    return run_action(creds, model, "upgrade", mac, {"url": update_url, "md5": md5, "model": model})
  File "wyze_updater.py", line 158, in run_action
    return device_api(
  File "wyze_updater.py", line 141, in device_api
    raise RuntimeError('Request failed, error %s:%s' % (rsp['code'], rsp['msg']))
RuntimeError: Request failed, error 3005:UnauthorizedOperation

Is this Wyze denying my request?
Information about my device:

Device type:      Light (WLPA19)
Firmware version: 1.2.0.106

build fails

Can you post which exact version of the SDK you use? I'm trying to build it with this SDK release: https://github.com/espressif/ESP8266_RTOS_SDK/releases/tag/v3.3
ran into the following errors

In file included from /project/wyze_plug_flasher/components/app_update/esp_ota_ops.c:32:0:
/project/wyze_plug_flasher/components/app_update/include/esp_ota_ops.h:24:28: fatal error: esp_app_format.h: No such file or directory
compilation terminated.
/project/ESP8266_RTOS_SDK/make/component_wrapper.mk:291: recipe for target 'esp_ota_ops.o' failed
make[1]: *** [esp_ota_ops.o] Error 1
/project/ESP8266_RTOS_SDK/make/project.mk:571: recipe for target 'component-app_update-build' failed
make: *** [component-app_update-build] Error 2

Wyze Bulb Support

I tried flashing a wyze bulb I had laying around that was not using. While it worked sort of it kept flashing so I think there is something that can be fixed. I know that tasmota has been installed on these but you have to take them apart. Sorry I am not smart enough to understand the OTA flashing I would pop open and flash by soldering but bulbs are a different beast. Not sure if you could see if you can update this for the bulb.
The tasmota template is here.

https://templates.blakadder.com/wyze_WLPA19.html

UnauthorizedOperation flashing Plug

I tried updating the plug to version .80 and got the same result. Any ideas?

Device type: Plug (WLPP1)
Device name: Pump
Firmware version: 1.2.0.59
IP Address: 192.168.4.87

Pushing firmware to this device? [y/N]:y
INFO:root:Pushing firmware URL to device.
Traceback (most recent call last):
File "wyze_updater.py", line 401, in
File "wyze_updater.py", line 286, in update_devices
File "wyze_updater.py", line 164, in push_update
File "wyze_updater.py", line 158, in run_action
File "wyze_updater.py", line 141, in device_api
RuntimeError: Request failed, error 3005:UnauthorizedOperation
[16990] Failed to execute script wyze_updater

Bulb still on when turned off

There seems to be an LED that says on even when the bulb is turned off with the given template

{"NAME":"Wyze Bulb","GPIO":[5728,0,0,0,0,0,0,0,0,416,417,0,0,0],"FLAG":0,"BASE":48}

PXL_20210209_033729413

Any idea why? Is there another GPIO for it? Currently I only have GPIO 13 -> PWM 1 and GPIO 14 -> PWM2

OSError: [Errno 22] Invalid argument: 'https://github.com/elahd/esp2ino/releases/latest/download/esp2ino.bin'

Hello, thank you for your work. I am fairly new at a lot of this firmware flashing stuff. I have Wyze plug WLPP1. I get to the directions where I am to load the esp2ino.bin to the plug and get the following error. The MAC address is correct for my plug, and I got it to list in the command right before this with the list command:
wyze_updater_win.exe list

Any suggestions?

I noticed if I hovered over the esp2ino.bin file on github the address link was different than in the wiki instructions:
https://github.com/elahd/esp2ino/blob/main/release/esp2ino.bin

I also tried this address but got the same error. I have Python 3.9.4 installed on this computer.
Here is a copy and paste from my admin command line.

C:\Users\Chuck\Downloads\esp2ino-main\esp2ino-main\release>wyze_updater_win.exe update -s -d 2CAA8E7BC7E3 -f https://github.com/elahd/esp2ino/releases/latest/download/esp2ino.bin
INFO:root:Trying saved credentials from .tokens.
Traceback (most recent call last):
File "wyze_updater.py", line 399, in
File "wyze_updater.py", line 237, in update_devices
OSError: [Errno 22] Invalid argument: 'https://github.com/elahd/esp2ino/releases/latest/download/esp2ino.bin'
[19332] Failed to execute script wyze_updater

Does not seem to work with the newer model WLPP1CFH-1

I had no problem with an older one that did not have bluetooth like the newer ones do. That one worked perfectly other than I need to type python in place of py. The newer ones do allow me to view the info using "python wyze_updater.py" list
result
INFO:root:Trying saved credentials from .tokens.
Device Type: Plug (WLPP1CFH)
Device MAC: 2CAA8EF1D7A5
Firmware Version: 1.2.0.76
Device Name: ender 5 plus

but the firmware updater command "python wyze_updater.py update -s -d 2CAA8EF1D7A5 -f wyze_plug_flasher.bin" just moves along and does not do anything after the username and password are put in. . The original Wyze firmware is still on it.
This was tried as both ../wyze_plug_flasher.bin wyze_plug_flasher.bin

C:\wpf\WyzeUpdater>python wyze_updater.py update -s -d 2CAA8EF1D7A4 -f wyze_plug_flasher.bin
INFO:root:Trying saved credentials from .tokens.
INFO:root:Checking device, mac=2CAA8EF1D7A5

Device type: Plug (WLPP1CFH)
Device name: ender 5 plus
Firmware version: 1.2.0.76
IP Address: 10.0.0.164

Pushing firmware to this device? [y/N]:y
INFO:root:Serving firmware file 'wyze_plug_flasher.bin' as 'https://10.0.0.29/firmware.bin', md5=c1cd336c04a3c74e315edac00afd117c
Press Ctrl+C when all the updates are done...
.....10.0.0.164 - - [11/Feb/2021 19:26:32] "GET /firmware.bin HTTP/1.1" 200 -

I guess the next step is prying it apart and seeing what is inside.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.