-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OTA Migrating to Tasmota bicks devices #1663
Comments
I managed to break the device open, solder some connections and re-flash it. Now I'm reproducing the same behavior. I have so far investigated the following:
is there any reliable way to factory reset and flash a sonoff tasmota image? |
Have you tried skipping sonoff-minimal and just uploading full sonoff.bin? They serve the same purpose and will flash the same way, because both Tasmota and ESPurna minimal images use the same Updater API provided by the Arduino Core. It will write new .bin after the current firmware (free space), reboot and then bootloader will overwrite original firmware space with the new one and load it. While we are using similar mechanism to store settings (EEPROM / same flash locations), no configuration is shared and Tasmota will overwrite our settings anyway on the first boot (ref: settings.ino, sonoff-minimal build will skip this part). Also something that we probably should check for - you can't OTA right after serial flash. You need to reboot the board first. |
Just gave the full sonoff.bin a shot, also ended in a bootloop. Specifically, I did this:
Listening at baudrate 74880, I get the following output:
Erasing the flash and flashing the sonoff.bin directly works as expected. |
Is there anyone that can provide a hint on fixing this? This is a major issue for me as it means that flashing espurna will lock you in. In my case, device used can't easily be opened and re-flashed. |
I did just try to update SHP-2 v23 unit with 6.5.0 sonoff-basic.bin (2.4.2 Core) and current ESPurna 1.13.6-dev development version.
Please try to use binaries from https://github.com/mcspr/espurna-nightly-builder/releases if you are unable to build them yourself. The version 1.13.4 from the original post and 1.13.5 might suffer from instability on SHP, in general and especially when upgrading using web interface (ref: #1574, #1587 ) edit: Nightly builds seems to be broken ATM. Need to fix that. Earlier version (0523) should be fine to check |
Is this still an issue? |
Yes, it still doesn't work. Just tried and bricked another device. I used the latest release of espurna (1.14.1) and tried to upgrade to tasmota-lite v8.1.0 using telnet ota. As I was still having issues with espurna and home assistant (discovery doesn't work well - device disappears after restarting home assistant) I just gave this another go and will just buy a new device now. Breaking them open to reflash them is too much of a pain with this specific device. |
When you do open the device, can you download flash contents using esptool.py read_flash and attach them here? https://github.com/espressif/esptool#read-flash-contents-read_flash Is this limited to telnet & web OTA? Have you tried espota.py instead? |
I will try some time later today with 1MB board, but everything works as you described in previous examples:
|
The following now worked for me: thanks for your help! |
FTR, never use tasmota-minimal.bin as the first flash of Tasmota. It depends on config data from previous Tasmota install, and will only work as an intermediary step going from one Tasmota binary to another. This two-step procedure is to enable binaries with a size over half the available flash space within 1M. |
Ah okay, that makes sense, thanks for the info! |
Is the factory reset requires for this migration to work or is it safe to go from working espurna to tasmota gz install? |
You cannot use .gz binaries for first install of Tasmota. The expectation is that a successfully flashed Tasmota should detect that it needs to create a new configuration, basically a "factory reset". |
Thanks - tried doing that but unfortunately the factory reset approach didn't work - thankfully I can flash via FTDI to recover the device. What I did
|
I have some H801 devices I'm trying to move to ESPHome. I had a spare one that had Espurna on it that flashed over flawlessly (by creating the image using ESPHome, downloading the BIN, and then flashing via the Espurna WebUI.) When I went to try a couple that are deployed around the house (and hard to reach) with the same method, They appear to have been bricked in a similar manner as described here. I think the initial test one that worked may have been an older version of Espurna. The problem ones are running 1.14.1 so I wonder if there is a bug in that version? I will be able to recover them by removing them and flashing them directly but I'd rather not have to crawl into the attics and/or get behind soffit to do this for all of them. Has anyone found a reliable way to flash from Espurna to an alternate firmware? Maybe I should try downgrading? |
Have you tried doing a factory reset first before migrating to esphome? |
There is no direct support for OTA migration from one firmware project to another. It may work in "many" cases, but do test with a similar setup before assuming that you can config an already deployed device. And always be prepared for falling back on wired flashing. |
Migration could be helped, though. We workaround Tasmota 'magic number check' by injecting them ourselves :) espurna/code/espurna/system.cpp Lines 708 to 730 in 1169be2
https://github.com/esphome/esphome/blob/2059283707fb0145dcf920d76e90afb6d80a20fb/esphome/components/esp8266/core.cpp#L38-L50 e.g. if while using ESPurna had somehow corrupted SDK sector, rebooting and trying to use softAP or sta will very likely crash Also note that 1.14.1 and any other firmware built using Core 2.3.0, which btw Tasmota also used in older versions, has a bug in OTA size estimation that would allow you to wipe existing fw without actually upgrading. Make sure .bin actually fits, {.bin size} % 4096 == 0 |
Thanks for the input. I found the OTA upgrade worked for me when I created just the basic device in ESPHome (i.e. a minimal device without adding any lights/switches etc.) and chose to download their modern rather than legacy BIN format. Maybe it was the BIN format that was the issue, or perhaps it was size related (but the Espurna Web UI didn't warn about the size and it sounds like that approach should.) Once I had the basic ESPHome flashed I was able to do further OTAs using ESPHome and get my H801s fully configured. |
Bug description
Using OTA to migrate to a Sonoff Tasmota minimal firmware bricks device
Steps to reproduce
Upload sonoff tasmota firmare (tested using web-interface, telnet, with and without prior firmware reset).
Expected behavior
Not bricking the device
Device information
Link to actual product (different brand): https://www.amazon.de/gp/product/B07HHFKWJJ
Another device that I bricked this way was a Jinvoo Curtain switch
Tools used
Windows Chrome Browser, Windows telnet via command line
Additional context
A similar issue had been raised before and closed without further investigation: #993
If someone can test this on a device that can be easily reflashed, it would probably help trying to find the cause of this. In my case, the wifi smart plug can't be opened without breaking it. I've got 2 more of these that I would like to migrate, but would rather not brick them...
The text was updated successfully, but these errors were encountered: