yaourdt / tasmota-to-mgos

A minimal firmware for OTA (over the air) flashing Mongoose OS from Tasmota, Tuya stock, or compatible firmware types.
GNU General Public License v3.0
63 stars 15 forks source link

Update with curl responds with error 500 -12 write failed #3

Open adoerler opened 3 years ago

adoerler commented 3 years ago

Hi,

thanks for providing this OTA helper. Switching to tasmota worked like a charm. I'm trying to revert back to stock firmware of a Shelly Dimmer 1.

The intermediate firmware was flashed successfully and I can access it via http which returns:

Index of

Name | Modified | Size
hwinfo_struct.json | 01-Jan-1970 00:00 | 112
conf0.json | 01-Jan-1970 00:00 | 3
 
Mongoose/6.18

But curl responds with

curl -i -F filedata=@./SHDM-1.zip http://10.42.42.44/update
HTTP/1.1 500 Internal Server Error
Server: Mongoose/6.18
Content-Type: text/plain
Connection: close

-12 Write failed

I'm using this firmware http://shelly-api-eu.shelly.cloud/firmware/SHDM-1.zip.

Did I miss something?

Best regards\ Andreas

Veldkornet commented 3 years ago

I also have this problem with my Shelly Plug-S

jimmyw commented 3 years ago

Same issue with Shelly Plug -S.

Here is a log:

mgos_ota_core.c:486     FW: shelly-plug-s esp8266 1.0 20210415-131046/v1.10.3-g23074d0
esp_ota_backend.c:185   Slot 1, FW: shelly-plug-s.bin -> 0x108000, FS fs.bin -> 0x1bb000
mgos_ota_core.c:504     0.21% total, esp_init_data_default_v08.bin 128 of 128
esp_ota_backend.c:205   Failed to read 64 bytes from 0x1bb000
esp_ota_backend.c:338   Start writing fs.bin (262144) @ 0x1bb000
mgos_mongoose.c:66      New heap free LWM: 39144
esp_flash_writer.c:77   Erase sector 443 (0x1bb000) -> 1
mgos_ota_core.c:811     Update finished, result -12 (Write failed)
jimmyw commented 3 years ago

The orignal firmware says that its

Booting rom 0 (0x8000)

Maybe its not 0x7000?

amnesiemaniac commented 3 years ago

Is there any chance to get my Shelly Plug S back to life? How can I help?

jimmyw commented 3 years ago

Not without soldering a serial adapter, and flashing Tasmota manually.

Letzdeal3 commented 3 years ago

Hi, also have the issue with Shelly Plug-S, Tried it first on Shelly 2.5 since I knew I could re-flash without any issues. That worked perfectly. I really dont want to open up the plug if I dont have to. Any help would be great!

USe x7000 file for Plug and x1000 for SW2.5 as instructed.

ReggiePark commented 2 years ago

any updates on this?

Just tried it on my Shelly Plug-S and got this:

HTTP/1.1 500 Internal Server Error Server: Mongoose/6.18 Content-Type: text/plain Connection: close

nbranquinho commented 2 years ago

Hello.

I have the same error with shelly RGBW2

curl -i -F filedata=@./SHRGBW2.zip http://10.42.42.44/update
HTTP/1.1 500 Internal Server Error
Server: Mongoose/6.18
Content-Type: text/plain
Connection: close

-12 Write failed
nbranquinho commented 2 years ago

I got this log:

[Dec  9 11:41:45.805] mgos_http_server.c:180  0x3fff060c HTTP connection from 10.42.42.51:58284
[Dec  9 11:41:46.911] mgos_ota_core.c:252     Starting, timeout 600, commit timeout 0, mem 42904
[Dec  9 11:41:46.911] mgos_mongoose.c:66      New heap free LWM: 38504
[Dec  9 11:41:46.911] mgos_ota_core.c:486     FW: rgbw2 esp8266 1.0 20211109-130009/v1.11.7-g682a0db
[Dec  9 11:41:46.911] esp_ota_backend.c:185   Slot 1, FW: rgbw2.bin -> 0x108000, FS fs.bin -> 0x1bb000
[Dec  9 11:41:46.911] mgos_mongoose.c:66      New heap free LWM: 38016
[Dec  9 11:41:46.911] mgos_ota_core.c:504     0.20% total, esp_init_data_default_v08.bin 128 of 128
[Dec  9 11:41:46.911] esp_ota_backend.c:205   Failed to read 64 bytes from 0x1bb000
[Dec  9 11:41:46.911] esp_ota_backend.c:338   Start writing fs.bin (262144) @ 0x1bb000
[Dec  9 11:41:46.911] esp_flash_writer.c:77   Erase sector 443 (0x1bb000) -> 1
[Dec  9 11:41:46.911] mgos_ota_core.c:811     Update finished, result -12 (Write failed)
nbranquinho commented 2 years ago

I hope this information helps... I've flashed the shelly RGBW2 (wired) with the mgos512k-0x7000.bin firmware with ESPHome-Flasher and after that, I upload the SHRGBW2.zip file with the curl command and worked!

ReggiePark commented 2 years ago

@nbranquinho, did the same with the Shelly-Plug-S (using ESPtool.py) and the curl command worked.

goeran03 commented 2 years ago

Same problem with ShellyPlugS and mgos512k-0x7000.bin loaded via OTA

Loaded same mgos512k-0x7000.bin with Tasmotizer: working!

ReggiePark commented 2 years ago

@yaourdt are you looking into this, so we don't have to use a wired connection anymore?

niwla23 commented 2 years ago

Same problem with Shelly RGBW2 here.

ShagoY commented 2 years ago

Same problem with Shelly PlugS and mgos512k-0x7000.bin loaded via OTA

curl -i -F filedata=@./SHPLG-S.zip http://10.42.42.44/update
HTTP/1.1 500 Internal Server Error
Server: Mongoose/6.18
Content-Type: text/plain
Connection: close

-12 Write failed
mrbluebrett commented 2 years ago

Same problem with Shelly PlugS and mgos512k-0x7000.bin loaded via OTA

curl -i -F filedata=@./SHPLG-S.zip http://10.42.42.44/update
HTTP/1.1 500 Internal Server Error
Server: Mongoose/6.18
Content-Type: text/plain
Connection: close

-12 Write failed

Same here... Any update?

Diegocampy commented 2 years ago

I'll be back here now too with error 12 on Shelly Plug S. I have read everything but I did not understand if I can restore my 4 plugs.

Diegocampy commented 2 years ago

ok, since returning to my Shelly Plus S is impossible, does anyone know how to get back from Mongoose to tasmota? I think with this command: curl -i -F filedata=@?????????????.zip http://10.42.42.44/update but with which firmware?

kstief commented 2 years ago

I had the same problem with my Shelly Plug-S. I don´t think you are able to flash back tasmota from Mongoose via ota with this Error. You can recover your Shelly by soilder a serial adapter to Shelly and flash back the stock or the tasmota firmware with the esptool. You can find a manual here: https://github.com/qtoggle/espqtoggle/wiki/Shelly-Plug-S

smartmatic commented 2 years ago

I am facing also the same flashing issue with Shelly Plug S.

Is a short-term solution to the error expected?

ReggiePark commented 2 years ago

Is @yaourdt still alive (or interested in this)? There hasn't been any GitHub activity since early last year.

Sillium commented 2 years ago

I'm facing the same problem with a Shelly Plug S. If anyone knows of a workaround to at least get Tasmota back working, that would be sufficient for me.

curl -i -F filedata=@./SHPLG-S.zip  http://10.42.42.44/update
HTTP/1.1 500 Internal Server Error
Server: Mongoose/6.18
Content-Type: text/plain
Connection: close

-12 Write failed
nbranquinho commented 2 years ago

I'm facing the same problem with a Shelly Plug S. If anyone knows of a workaround to at least get Tasmota back working, that would be sufficient for me.

curl -i -F filedata=@./SHPLG-S.zip  http://10.42.42.44/update
HTTP/1.1 500 Internal Server Error
Server: Mongoose/6.18
Content-Type: text/plain
Connection: close

-12 Write failed

@Sillium Try do this

--> [Flash with wires] (https://github.com/yaourdt/tasmota-to-mgos/issues/3#issuecomment-989844567 )

Someone reported that worked on the same device

--> [confirm that works on shelly plug S] (https://github.com/yaourdt/tasmota-to-mgos/issues/3#issuecomment-996598007)

You can find the firmware 0x700 here

pgorod commented 1 year ago

Hi. I just got stuck on the Tasmota-back-to-Shelly-stock-firmware procedure, I am also getting this Write failed error.

So, if I am reading this correctly, there is currently no way to solve this problem for people who are not going to do the wired flashing, right? No way forward to the Shelly stock firmware, and no way back to the Tasmota, right?

:-(

markus-barta commented 1 year ago

Same issue here: -12 Write failed

Any update on how to get out of "Limbo" when soldering is not an option?

Mar1usW3 commented 1 year ago

i have a shelly plug s with also the -12 Write failed error. Is there any fix?

Armadillo1 commented 1 year ago

Trying to recover RGBW2 with 0x7000 firmware. Flashing wired, but getting this, regardless of flashing software (Tasmotizer, esptool, ESP Flasher)

C:\Users\Random\Desktop>esptool.py --chip esp8266 --port COM4 write_flash -z 0x0 mgos512k-0x7000.bin esptool.py v4.4 Serial port COM4 Connecting... Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: c4:5b:be:e0:c0:7c Stub is already running. No upload is necessary. Configuring flash size... Flash will be erased from 0x00000000 to 0x0007ffff... Compressed 524288 bytes to 311031... Writing at 0x0006c74a... (100 %) A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.

C:\Users\Random\Desktop>

simao commented 1 year ago

@Armadillo1 any tips opening the rgbw? Seems the only way is to break it.

Armadillo1 commented 1 year ago

Will just repost what I've posted on reddit - perhaps we can work out how to get my RGBW2 to talk to shelly fw again.

I bought myself a Shelly RGBW2 (based on ESP8266) to control aquarium lights. However since the timers within the shelly software were quite primitive, I decided to give WLED and Tasmota a try, which was relatively easy to flash both OTA and via usb to serial adapter. I am now struggling to get back to the Shelly firmware.

What I have tried so far:

1)Flashing shelly's recovery firmware with ESPTool. It gets briefly stuck at 100% with a subsequent error:

C:\Users\Random\Desktop\RGBW_recovery_firmware_version3>esptool.py --port COM4 erase_flash esptool.py v4.4 Serial port COM4 Connecting... Detecting chip type... Unsupported detection protocol, switching and trying again... Connecting... Detecting chip type... ESP8266 Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: c4:5b:be:e0:c0:7c Stub is already running. No upload is necessary. Erasing flash (this may take a while)... Chip erase completed successfully in 0.0s Hard resetting via RTS pin...

C:\Users\Random\Desktop\RGBW_recovery_firmware_version3>esptool.py --port COM4 write_flash 0x0 RGBW_recovery.bin esptool.py v4.4 Serial port COM4 Connecting... Detecting chip type... Unsupported detection protocol, switching and trying again... Connecting... Detecting chip type... ESP8266 Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: c4:5b:be:e0:c0:7c Stub is already running. No upload is necessary. Configuring flash size... Flash will be erased from 0x00000000 to 0x001fffff... Compressed 2097152 bytes to 387054... Writing at 0x0008cac7... (100 %) A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.

C:\Users\Random\Desktop\RGBW_recovery_firmware_version3> 2) Tried this method: https://github.com/yaourdt/tasmota-to-mgos

With the -12 Write failed error that quite a few people seem to have (fewer with the RGBW2 that I have - some managed to update successfully).

3) Tried different combinations of flashing one firmware after another (different Tasmotas, WLED), ending with Shelly RGBW2 fw last with Tasmotizer (stops at 100% with a similar error as in 1) ).

I can still use the shelly with Tasmota, which I don't quite like or possibly ESPHome, which I haven't fully tried to flash yet.

Any ideas? Have I managed to completely screw up my shelly or is this recoverable ?

simao commented 1 year ago

@Armadillo1 yeah but i meant how did you open the shelle to connect to the serial pins? cant open it without breaking it. thanks

Armadillo1 commented 1 year ago

You don't need to open. The headers are accessible from the outside. The 5 black pin holes at the top.

simao commented 1 year ago

Uh damn it, I misread this and thought you had a shelly RGBW bulb. Sorry for the confusion.

agofi commented 1 year ago

Same problem with ShellyPlugS and mgos512k-0x7000.bin loaded via OTA

Loaded same mgos512k-0x7000.bin with Tasmotizer: working!

It worked also for me! loaded the mgos512k-0x7000.bin with Tasmotizer, not need to solder anything, the pins are reachable just removing the upper cover. You have only to find a way to keep in place the pins during flashing procedure.. for opening shelly plug see here.. (There is a screw hidden inside the earth plug) for shelly plug pinout see here. after loading mgos512k-0x7000.bin with Tasmotizer you can send update using CURL (curl -i -F filedata=@./fw.zip http://10.42.42.44/update).

hope it helps!

TBR-BRD commented 1 year ago

I can not download https://dl.dasker.eu/firmware/mgos512k-0x7000.bin Do you have a working source? Thank you

nbranquinho commented 1 year ago

I believe that exists a problem with server. I uploaded temporarily to send to you. mgos512k-0x7000.zip

TBR-BRD commented 1 year ago

I believe that exists a problem with server. I uploaded temporarily to send to you. mgos512k-0x7000.zip

Thank you for your help! Unfortunately it did not work, there is then an http response error. I then took the direct route and flashed a Shelly firmware.

TBR-BRD commented 1 year ago

Firmware: https://www.shelly-support.eu/forum/thread/444-anleitung-firmware-flashen-mit-espeasy-flasher-alle-firmware-bin-dateien-windows/?postID=182323#post182323 direct: https://www.shelly-support.eu/attachment/35600-shelly-plug-s-20200317-143422-v1-6-1-112262fd-bin-zip/ flash with USB serial adapter Shelly App add device Firmware update in the App it works!!! Shelly Plug S with newest firmware

TBR-BRD commented 1 year ago

flash without soldering

photo_2023-02-16 18 59 33 photo_2023-02-16 18 59 41

henriec commented 10 months ago

Firmware: https://www.shelly-support.eu/forum/thread/444-anleitung-firmware-flashen-mit-espeasy-flasher-alle-firmware-bin-dateien-windows/?postID=182323#post182323 direct: https://www.shelly-support.eu/attachment/35600-shelly-plug-s-20200317-143422-v1-6-1-112262fd-bin-zip/ flash with USB serial adapter Shelly App add device Firmware update in the App it works!!! Shelly Plug S with newest firmware

Thanks a Lot!!!!! This is the only working solution I could find! I'm happy!

hnykda commented 7 months ago

Just wanted to share with others that I am unable to get back to Shelly Stock firmware on RGBW2. The classic -12 Write Failed error... So, for those who want to know if they can easily (that is via OTA) get back to stock on RGBW2 - don't.