Skip to content
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

Unable to update Shelly Dimmer 2 to stock 1.10.x firmware #7

Open
CReimer opened this issue Mar 23, 2021 · 81 comments
Open

Unable to update Shelly Dimmer 2 to stock 1.10.x firmware #7

CReimer opened this issue Mar 23, 2021 · 81 comments

Comments

@CReimer
Copy link

CReimer commented Mar 23, 2021

Just wanted to let you know that it is not possible to update stock Shelly firmware beyond 1.9.6 after using tasmota-to-mgos. It's stuck on an "Index of" page.

Tried that with 4 different Shelly Dimmer 2 devices. Flashing a full binary backup from before installing Tasmota the first time, fixes it on all these devices.

Something is different between Stock Shelly Firmware and "Returned-To-Stock" Fimware using tasmota-to-mgos.

BTW: I tried replacing hwinfo_struct.json with the correct one for my Shelly Dimmer 2, but still unable to update to 1.10.

@jaamarcelis
Copy link

I have the same problem. @CReimer Can you provide me the binary backup of your Shelly Dimmer 2? Or is it not possible to flash an other binary backup to an other device?

@CReimer
Copy link
Author

CReimer commented Mar 24, 2021

I used one of these. https://github.com/Mollayo/Shelly-Dimmer-2-Reverse-Engineering/tree/master/shelly%20stock%20firmware

I knew that my hw_revision was 20200629, but @Mollayo also provides one for hw_revision 20200904. I don't think it actually matters much, but after having trouble updating to 1.10 I think it's best to use one which fits your hardware the best

@jaamarcelis
Copy link

Thanks!

@joracadu
Copy link

Hello, I have been stuck in the same issue. I have downloaded one of the firmwares, but now I don't know how to upload it to the Shelly. How is it done?
Thanks!

@CReimer
Copy link
Author

CReimer commented Jun 10, 2021

You need to connect your Shelly via Serial connection to your PC and use a tool like Tasmotizer. You can select a custom bin file and flash the original Shelly firmware that way

@megakid
Copy link

megakid commented Dec 11, 2021

I also came to this point, bummer - will extract from wall and reflash!

@ydeschoe
Copy link

anybody a solution for this, I have the same, latest version I can use is 1.9.4, when I go to 1.10.1 I always get the index page and not the dimmer start page.

@borft
Copy link

borft commented Jan 11, 2022

Nope, had the same problem. In the end solved it by connecting a serial cable and flashing with esptool. This, however, doesn't really solve the issue, especially for shellies that are already in the wall. So it would be great if this issue can be solved!

@To0wnn
Copy link

To0wnn commented Jan 11, 2022

Hi,

mgos512k-0x7000.bin I can flash en wifi hotspot comes online I follow the instructions and it is not working.
If I flash the 1.7 or 1.8 bin it is not working.
Also tried the guide for shelly 1 to create firmware.bin also not working

Any suggestions?

@Dilergore
Copy link

I have the same issue. Would be good to be able to flash it back in an OTA way.

@To0wnn
Copy link

To0wnn commented Jan 12, 2022

Found a way! Made a backup of different dimmer (that i already installed in the ceiling).
esptool.py --port /dev/ttyUSB0 --baud 115200 read_flash 0x00000 0x400000 ~/Dimmer2.bin

Download and extract:
Dimmer2.zip

Install esptool
pip3 install esptool

First:
esptool.py --port /dev/ttyUSB0 --baud 115200 erase_flash

Second:
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_freq 80m 0x000000 Dimmer2.bin

Connect to the dimmer wifi, do a factory reset (not sure if nessesary) and your all good to go for a new setup!

@Dilergore
Copy link

Found a way! Made a backup of different dimmer (that i already installed in the ceiling). esptool.py --port /dev/ttyUSB0 --baud 115200 read_flash 0x00000 0x400000 ~/Dimmer2.bin

Download and extract: Dimmer2.zip

Install esptool pip3 install esptool

First: esptool.py --port /dev/ttyUSB0 --baud 115200 erase_flash

Second: esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_freq 80m 0x000000 Dimmer2.bin

Connect to the dimmer wifi, do a factory reset (not sure if nessesary) and your all good to go for a new setup!

I would rather not remove the device from its current location, I would really appreciate if there would be a way to do this without plugging it to my computer :)

@To0wnn
Copy link

To0wnn commented Jan 13, 2022

I would rather not remove the device from its current location, I would really appreciate if there would be a way to do this without plugging it to my computer :)

If that happens let me know 😊
Some hobby cost time 😋

@optilude
Copy link

Just to elaborate on this a little bit - and see if anyone might have a solution.

I have a new Shelly Dimmer 2. I tried to flash it OTA to Tasmota, which worked, but I couldn't get the Tasmota firmware to behave (the light would turn on and then off again after a few seconds). I pulled it out of the wall and used another Dimmer 2, with the stock firmware, and that works fine. So I decided to forgo Tasmota and stick with standard Shelly firmware.

I was going to USB-flash it, but in the process of putting the flasher pins into the device, the black plastic around the pin sockets disintegrated (I must've done something wrong) so it's now nearly impossible to get a connection to the USB flasher.

I re-connected the Shelly to power, and managed to get it to tasmota-minimal.bin, then used tasmota-to-mgos to get it into an intermediate state, then ran curl -i -F filedata=@./SHDM-2.zip http://10.42.42.44/update where SHDM-2.zip is a file I downloaded from the Shelly website after inspecting the API. This completed successfully.

At this point, a wifi network shellydimmer2-XYZ appeared as expected. On connecting to it and then to 192.168.33.1 I get a file listing that looks like this:

image

That looks like a web server directory listing to me. So I imagine that Mongoose 6.18 is running as expected, but whatever files were put there with the curl command do not conform to the required format.

Re-flashing from serial isn't an option for me, so if there is any way to rescue it, that would be amazing. I can ping the device for example, so it's responsive. I'd need some way of getting the right firmware to it though!

@Mollayo
Copy link

Mollayo commented Jan 16, 2022

There are two MCU in the Shelly dimmer 2: the ESP8266 and the STM32. The web page with the file listing that you see is because the ESP8266 is not able to talk with the STM32. When you flash the dimmer with the Tasmota firmware, the firmwares of both MCU (i.e. ESP8266 and STM32) are modified. Then when you flash the dimmer with the Shelly firmware, only the ESP8266 firmware is modified. The firmware of the STM32 MCU is still the Tasmota version.

One solution would be:

@optilude
Copy link

Thank you @Mollayo - very insightful.

In my particular case, a serial flash isn’t an option. I am fairly confident MongooseOS is running on it, and whilst I haven’t tested it yet I think it’s likely that the /update POST end point is still operational.

Is there any way to recover it OTA?

@Mollayo
Copy link

Mollayo commented Jan 16, 2022

I see. Then you might be able to change the firmware from Shelly to Tasmota with the mgos-to-tasmota tool: https://github.com/yaourdt/mgos-to-tasmota.
With your Internet browser: http://shellyip/ota?url=http://dl.dasker.eu/firmware/mg2tasmota-ShellyDimmer2.zip

Once the Tasmota firmware has been installed, you can then flash this firmware https://github.com/Mollayo/Shelly-Dimmer-2/blob/master/shellyDimmer2.ino.generic.bin.gz. You will then be able to change the STM32 firmware as described above.

@optilude
Copy link

Thank you again @Mollayo!

Just to check I got this right:

Originally, I went from stock firmware to Tasmota using mgos-to-tasmota. I then installed the template and custom STM32-aware firmware as per https://templates.blakadder.com/shelly_Dimmer_2.html. That didn’t work well with my light (but worked fine in terms of Tasmota itself, networking etc) so I used tasmota-to-mgos as per the instructions on this package to flash (using the /update HTTP endpoint) SHDM-2.zip I downloaded from the Shelly website.

What you suggest is:

  • Use mgos-to-tasmota again as before to get to a basic Tasmota setup
  • Use the normal Tasmota web interface to flash your shellyDimmer2.ino.generic.bin.gz file
  • Connect to new AP and use it to flash STM32 with your stm_3F_02.bin
  • Then use the /update endpoint with curl to flash SHDM-2.zip again
  • Owe you a coffee

Did I get that right?

@optilude
Copy link

Wait - no, this doesn't work, because at present my Shelly is not yet connected to my wifi network. It exposes its own AP (shellydimmer2-XYZ) and I can reach it on 192.168.33.1 but I don't have the UI to configure wifi, only the aforementioned directory listing.

The mgos-to-tasmota approach relies on the Shelly itself being able to download firmware from an external website, so it needs to have a route to the internet, which means I'd need some way of configuring its networking before I could proceed as above.

@Mollayo
Copy link

Mollayo commented Jan 16, 2022

You can actually setup a web server on your computer to serve files. See here: https://stackabuse.com/serving-files-with-pythons-simplehttpserver-module/.

Actually, I am trying to reproduce the steps. The conversion from the broken Shelly to Tasmota using the mgos-to-tasmota utility does not seem to work. The firmware is uploaded. But after reboot, the device becomes unreachable. It does not create the AP. I am investigating the problem.

@optilude
Copy link

optilude commented Jan 16, 2022 via email

@Mollayo
Copy link

Mollayo commented Jan 16, 2022

Ok. It might take one or two days.

@Mollayo
Copy link

Mollayo commented Jan 16, 2022

I think I found a way to change the malfunctioning shelly firmware to the tasmota firmware.

Actually, the mgos-to-tasmota tool assumes that the device is already connected to the Internet; this is required to get the tamosta binary to complete the conversion from ngos to tasmota. But since the WiFi credentials are not available (the shelly device works as a WiFi AP), the device does not connect to the home router; it does not create an AP neither. The only way to recover is to flash it with serial connection.

One solution would be to use a modified version of mgos-to-tasmota firmware in which the SSID and password of your WiFi network have been saved. This can be done by following the instructions here: https://github.com/yaourdt/mgos-to-tasmota#build-the-firmware-yourself
The modifications to be done are in the file https://github.com/yaourdt/mgos-to-tasmota/blob/main/mos.yml:

  • Delete the three lines:
    • ["wifi.ap.enable", false ]
    • ["wifi.sta1.ssid", "mgos-recover" ] # fallback SSID
    • ["wifi.sta1.pass", "RJoPuKC3u5" ] # fallback password
  • Add the three following lines
    • ["wifi.ap.enable", true ]
    • ["wifi.sta.ssid", "Your SSID" ]
    • ["wifi.sta.pass", "Your password" ]

Once the mgos-to-tasmota firmware has been compiled, you need to setup a web server to make this firmware available to the shelly device. See here: https://stackabuse.com/serving-files-with-pythons-simplehttpserver-module/.

Then the update is done with the following instruction: curl http://192.168.33.1/ota?url=http://192.168.33.2:8000/fw.zip. 192.168.33.1 is the IP address of your Shelly device and 192.168.33.2 is the IP address of your computer. Your computer is assumed to be connected to the AP of the Shelly device. fw.zip is the file name of the mgos-to-tasmota firmware that has been previously compiled.

The steps are very tricky. It would be better to try first on another device that you can flash with serial connection in case things go wrong.

I can also provide you the modified version of the mgos-to-tasmota firmware.

@optilude
Copy link

optilude commented Jan 16, 2022

Worth a try.

Any idea what the MODEL build var should be for a Dimmer 2?

Figured it out. It’s referenced in mos.yml

@Mollayo
Copy link

Mollayo commented Jan 16, 2022

I think you better wait. I was doing the tests with an esp8266. When I tried on a real shelly dimmer, it did not work as expected. There are still some problems.

@optilude
Copy link

optilude commented Jan 16, 2022

Ok. I'll hold fire. In the meantime, I've installed mos, cloned the mgos-to-tasmota firmware, and edited the mos.yml wifi config as suggested. Currently trying to figure out how to build it (it's failing with Error: Post "https://build.mongoose-os.com/api/fwbuild/2.20.0/build": net/http: TLS handshake timeout at the moment, but I'm still reading the docs on how the mos build command actually works).

Update: Installing docker and running mos build with the --local flag works. I now have build/fw.zip but I'm not going to attempt the "local" OTA mgos-to-tasmota yet per your last message.

@Mollayo
Copy link

Mollayo commented Jan 16, 2022

I found that my Shelly dimmer is dead. It is just sending some garbage data over the serial line. Actually, I saw a flash light when I was uploading the firmware. I should have removed the bulb.
That problem might not be related to the mgos-to-tasmota firmware. The dimmer was a spare device on which I was doing some experiments with the STM32 firmware. This could be the reason of the bricked device.

Most probably, the above method works but I cannot guaranty this. If you decide to go, please let me know the result. I can help you for the next steps (which hopefully will be easier).

@optilude
Copy link

I mean, it's not going to get any more useless than it already is, so why not try...

So I did this:

$ curl http://192.168.33.1/ota?url=http://192.168.33.2:8000/fw.zip
{"status":"updating","has_update":false,"new_version":"","old_version":"20211109-131033/v1.11.7-g682a0db"}

I've confirmed that http://192.168.33.2:8000/fw.zip resolves, i.e.:

$ curl -O http://192.168.33.2:8000/fw.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  859k  100  859k    0     0  49.3M      0 --:--:-- --:--:-- --:--:--  167M

$ unzip fw.zip 
Archive:  fw.zip
 extracting: dimmer-l51-0.4.6/manifest.json  
 extracting: dimmer-l51-0.4.6/dimmer-l51.bin  
 extracting: dimmer-l51-0.4.6/esp_init_data_default_v08.bin  
 extracting: dimmer-l51-0.4.6/fs.bin  
 extracting: dimmer-l51-0.4.6/rboot.bin  

$ ls dimmer-l51-0.4.6/
dimmer-l51.bin                  esp_init_data_default_v08.bin   fs.bin                          manifest.json                   rboot.bin

I've also confirmed that this zip file is similar in layout the "official" one fromhttp://dl.dasker.eu/firmware/mg2tasmota-ShellyDimmer2.zip. If I put my extract in a folder custom and the official one in official:

$ diff custom/ official/
Binary files custom/dimmer-l51.bin and official/dimmer-l51.bin differ
Binary files custom/fs.bin and official/fs.bin differ
diff custom/manifest.json official/manifest.json
2,3c2,3
<   "build_id": "20220116-175045/v0.4.6-gf2f935a-main-dirty",
<   "build_timestamp": "2022-01-16T17:50:45Z",
---
>   "build_id": "20210118-130502",
>   "build_timestamp": "2021-01-18T13:05:02Z",
22,23c22,23
<       "cs_sha1": "27db0d41678994fcf1fa01cad5c0e1f854c9cd7f",
<       "cs_sha256": "ddf1d02e745af6854550c60ee653602dae76c65665bb9f32e8319e708a001351",
---
>       "cs_sha1": "14028087936bd9ef52444bd5ceb7589c70fca073",
>       "cs_sha256": "aa1808f2eade39df7a88106ab70ad8a5ff4ddacd93d9e4e5a491416c489221cd",
32,34c32,34
<       "cs_sha1": "202b3ef817078f2be0e88bc14f75b71a74660fb3",
<       "cs_sha256": "ed7aa7ef56ab296957574e1b78ead0da497d3f5c3b632d75ce48244ea5631f00",
<       "size": 613248,
---
>       "cs_sha1": "597853f133fc0628b9d7339a97bcbef7ae852afe",
>       "cs_sha256": "8c8f9c973f0e72ea3408bd2d57135f6c929794346a85ac03232f83a21620d58c",
>       "size": 621120,

However, the device never reboots or does anything noticeable, i.e. I'm still connected to its shellydimmer2-XYZ access point.

Is there any way to get a log or any error messages out of it?

@Mollayo
Copy link

Mollayo commented Jan 16, 2022

The shellydimmer2-XYZ AP is the AP of your dimmer ? If every thing goes well, your dimmer should connect to your home router. You should be able to see it in your home network.

@optilude
Copy link

Red herring. My Mac firewall was refusing the inbound connection.

The command completed and the shellydimmer2-XYZ AP disappeared. But I can't find it on my normal wifi network :(

This is what was in my mos.yml

# Custom configuration
config_schema:
  #### sys ####
  - ["debug.level", 2]                     # 0 = ERROR, 1 = WARN, 2 = INFO, 3+ = DEBUG
  #### wifi ####
  # - ["wifi.ap.enable",             false ]
  - ["wifi.sta.enable",             true ] # join wifi as client
  - ["sta_connect_timeout",           30 ] # timeout for wifi connection / seconds
  # - ["wifi.sta1.ssid",    "mgos-recover" ] # fallback SSID
  # - ["wifi.sta1.pass",      "RJoPuKC3u5" ] # fallback password
  - ["mg2x", "o", {"title": "Settings for this firmware"}]
  - ["wifi.ap.enable", true ]
  - ["wifi.sta.ssid", "MyNetwork" ]
  - ["wifi.sta.pass", "MyPassword" ]

I've double-checked the the SSID and password are correct (obviously modified in the paste above).

One question - why is it wifi.ap.enable = true? Could it be trying to broadcast its own AP with the same SSID as my home network?

If not, I imagine it's now unrecoverable. But nevermind. A huge, huge thank you for doing so much to help figure out a path!

@Mollayo
Copy link

Mollayo commented Jul 10, 2022

A new version of the firmware is available here: https://github.com/Mollayo/Shelly-Dimmer-2.

Let me know what error code you have now.

The error codes:
STM32_ERR_UNKNOWN=1, /* Generic error /
STM32_ERR_NACK=2,
STM32_ERR_NO_CMD=3, /
Command not available in bootloader */
STM32_ERR_ADDR_NOT_ALIGNED=4,
STM32_ERR_WRONG_DATA_LENGTH=5,
STM32_ERR_FAILED_TO_SEND_CMD=6,
STM32_ERR_WRITE = 7,
STM32_ERR_READ = 8

@eric1905
Copy link

Hi @Mollayo
I just tried the new shellyDimmer2.ino.generic.bin file from your repo and tried to upload both STM32 firmware files.
I get the following error:
failed to upload the STM32 firmware with error code 2

@Mollayo
Copy link

Mollayo commented Jul 10, 2022

I have uploaded another version of the firmware to check if the initialisation of the STM32 is successful. Can you try this ? Same location: https://github.com/Mollayo/Shelly-Dimmer-2

@eric1905
Copy link

Hi @Mollayo
It seems like the init is not working:

failed to init the STM32 for uploading the firmware

@Mollayo
Copy link

Mollayo commented Jul 10, 2022

It means that the esp8266 cannot even talk to the STM32. How is the Shelly device connected ? Is it connected through a serial connection to your computer ? Or is your Shelly device connected to the power line ?

@eric1905
Copy link

I flashed the firmware via serial. After that I tried to upload stm firmware while the dimmer is connected via serial.
When I attach it to the power line I get the following error:
failed to upload the STM32 firmware with error code 2

@Mollayo
Copy link

Mollayo commented Jul 10, 2022

Did you thy to flash the original Shelly firmware via serial connection ?

@Mollayo
Copy link

Mollayo commented Jul 10, 2022

Two old versions of the stock firmware are available here: https://github.com/Mollayo/Shelly-Dimmer-2-Reverse-Engineering/tree/master/shelly%20stock%20firmware

@eric1905
Copy link

I think I already tried to flash those versions, but I will try again

@eric1905
Copy link

Ok now it is working.
And maybe it already worked yesterday. After flashing those firmware I tried to acces the shelly UI by beeing still connected via serial and not via power line.
I now flashed the firmware, attached it to powerline, pressed the reset button for 10 seconds and now it is working.

Thank you for your support :) Yesterday I thought I bricked the stm chip :D

@Mollayo
Copy link

Mollayo commented Jul 10, 2022

Good news.

I know that if you connect the Shelly device through serial connection, it can happen that the esp8266 cannot communicate with the STM32. This is because the same serial connection is used for communicating with the STM32 and for flashing the Shelly device.

@klein0r
Copy link

klein0r commented Sep 26, 2022

One solution would be:

Strange:

  1. Used a serial connection to flash https://github.com/Mollayo/Shelly-Dimmer-2/blob/master/shellyDimmer2.ino.generic.bin
  2. Removed the serial connection and joined the AP wifi of the Shelly
  3. Used the web interface to update the STM32 with the linked file (successful)
  4. Established the serial connection again and flashed the stock firmware v1.8.4 https://github.com/Mollayo/Shelly-Dimmer-2-Reverse-Engineering/blob/master/shelly%20stock%20firmware/shelly_dimmer_2%2020200904-094614%20v1.8.4%40699b08ac.bin
  5. I still get a directory listing when opening 192.168.33.1

Screenshot 2022-09-26 at 15 21 27

@Mollayo
Copy link

Mollayo commented Sep 26, 2022

Your Shelly device should be connected to the power line; the serial connection should be disconnected. Then, the ESP8266 should be able to communicate to the STM microcontroller. The above page should not appear anymore.
In fact, when you connect your shelly device with the serial connection, the communication between the ESP8266 and the STM becomes unstable since it uses the same serial connection.

@DaafSamson
Copy link

@klein0r @Mollayo ,

Thank you (and all the others) so much!

I can confirm that I have restored my shelly's with this procedure!

I am tempted to believe that the cause at start might have been that all steps were taken by my while on serial connection!

@humphrep
Copy link

@Mollayo I am trying to revert back to a shelly firmware from Tasmota. I was able to go to your https://github.com/Mollayo/Shelly-Dimmer-2/blob/master/shellyDimmer2.ino.generic.bin.gz firmware using the OTA interface on Tasmota. I then changed the STM32 firmware with your interface to the stm_3F_02 firmware. I then updated it to the shelly firmware, but I still got the Index of page if I use anything newer than the 1.9.4 firmware. When I installed the STM32 firmware it said it was successful. Do you have any suggestions, I don't have the ability to connect via serial. Thanks in advance!

@Mollayo
Copy link

Mollayo commented Dec 29, 2022

Is your device connected to the power line or is it connected to a PC?

@humphrep
Copy link

Is your device connected to the power line or is it connected to a PC?

It's connected to the power line. I never took it out of the wall. Here is what I tried:

  • I was alreast on Tasmota 12.3.1
  • I upgraded to Tasmotra 12.3.1 Minimal via OTA
  • I upgraded to ShellyDimmer2.ino.generic.bin.gz via OTA
  • I connected to the Wi-Fi of the Device (xx_xx_xx_xx_xx_xx)
  • I browsed to 192.168.4.1
  • I enter my home Wi-Fi Credentials and it reboots coming up on my home network
  • I went to the Setup page and chose the Update the STM32 Firmware button, and upgraded to stm_3F_02, which the page says firmware update succeeded.
  • I tried to upgraded the firmware to shelly_dimmer_2 20200904-094614 [email protected] from your site but got an OTA Error 4

At this point I did the following:

  • Installed the mgos512k-0x7000.bin firmware, it was successful and rebooted
  • I connected to the mg-xxxxxx network
  • I ran the following command to put the 1.9.4 firmware on the shelly curl -i -F filedata=@./SHDM-2.zip http://10.42.42.44/update
  • I then connected to the Shelly Wi-Fi, to put it back on my home Wi-Fi (The Shelly page is successfully showing here)
  • It tells me there is a firmware update available, so I tell it to upgrade to 1.12.1
  • I am now back to the index page, and if I manually browse to /ota I get the following - {"status":"idle","has_update":false,"new_version":"20221027-104444/v1.12.1-ga9117d3","old_version":"20221027-104444/v1.12.1-ga9117d3"}

I can then take it back to tasmota, and put the shelly 1.9.4 firmware back on and I can function at that level. I just can't get beyond it.

Thanks.

@Mollayo
Copy link

Mollayo commented Dec 29, 2022

If my understanding is correct, you managed to install the shelly firmware version 1.9.4. This firmware was fully functional (you could access to the web interface of the device and switch on/off the light. Then, the problem appeared when you installed the firmware version 1.12.1; the device stopped working (i.e. the web server shows the index page instead of the configuration page).
Then the source of the problem could be that you cannot directly update from v1.9.4 to v1.12.1 (this is the case for tasmota). One solution would be to update with intermediate versions, for instance from v1.9.4 to 1.9.6 to 1.10.4 to ... to 1.12.1.

@Mollayo
Copy link

Mollayo commented Dec 29, 2022

Previous shelly firmware can be found here: https://www.shelly-support.eu/shelly-firmware-archive/.

@humphrep
Copy link

It seems the highest I can go is 1.9.6, everything above that gives me the index page. :(

@Mollayo
Copy link

Mollayo commented Dec 30, 2022

This is really bizarre. Before using Tasmota, which version of the Shelly firmware did you use ? Was it version 1.9.6 or some earlier version ?

@borft
Copy link

borft commented Dec 30, 2022

I' had the exact same problem. The only workaround I could find, was dumping the firmware from a working shelly dimmer (on the original firmware) using a serial connection, and flashing that firmware to the one running tasmota, also using a serial connection.

In all other cases, I end up with the directory index, as soon as I try to go past 1.9.6.

@humphrep
Copy link

I have been doing more research, and it seems the device is ending up in a test mode, which can be seen by the red light on the back flashing. There is a procedure to exit the test mode, but that doesn't seem to work. I can temporarily get it out of the test mode by holding the reset button while powering it on, but the next reboot puts it back in the test mode. I have a case open with Shelly. I am pretty sure the firmware itself is fine, or booting with the reset button would have an issue as well.

@Mollayo
Copy link

Mollayo commented Dec 30, 2022

When the index web page is shown, this means that the ESP8266 MCU is not able to communicate with the STM MCU. One cause could be that the two MCU use different protocols because of the mismatch of their firmware version.
A possible solution to this problem:

I cannot test myself this procedure; I do not have any working shelly device. Please let me know if it works.

@humphrep
Copy link

I was thinking it's the firmware mismatch as well, but then why would it boot successfully if I hold the reset button while powering it up? I have already used the https://github.com/Mollayo/Shelly-Dimmer-2 to update the STM firmware. Unfortunately, I can only do this via OTA I can't get a serial connection to the Shelly. Again, though I am pretty sure I have the right STM firmware, since I was able to update it with your firmware and the STM update process completed successfully, and the lights work great when on 1.9.6 or 1.12.1 (assuming I have powered it on with the reset button pressed).

@fabian1512
Copy link

For me, the restore to the shelly firmware worked according to the instructions of Mollayo. Many thanks for that.
This has already worked with one SHDM2. But here I have observed that the function "warm-up" no longer worked. I first attributed this to the transformer.
However, I have now brought the second SHDM2 back to the shelly-fw - here I now have the same problem that the warm-up no longer works: I can not turn on the lamp to eg 10%, only after I have turned it on to about 80%, I can dim back to 1%.

I have also observed that the wifi signal is now displayed much worse.

Is this perhaps due to the firmware version for the STM MCU?

@Mollayo
Copy link

Mollayo commented Jan 17, 2023

The strength of WiFi signal has nothing to do with the STM microcontroller. It solely depends on the esp8266 firmware. Maybe there's a way to change the signal strength in the setup webpage of the Shelly device.

@VV3sl3y
Copy link

VV3sl3y commented Jan 20, 2023

First of al, thanks for putting al the work in this project to re-flash stock firmware on the shelly devices.

I've done some testing and ran into the same issue when updating OTA. It's possible to get it working on V1.9.4, but when updating beyond that version it just shows then filelist.
The weird thing is that it does not brick when being updated through the shelly_dimmer_2 20200904-094614 [[email protected]] via FTDI.

One thing I did notice is that the page from the 'bricked' version mentiones that it runs Mongoose V6.18. When playing around with CURL on the bin FTDI build it mentiones that it runs Mongoose V6.11
Both running from the stm_F3_02.bin firmware

Might the issue during update come from the Mongoose version? Is there a way to retrieve the same older Mongoose version V6.11 to try this one?
Still kinda hopeful that I do not have to dismount the current shelly devices I have to revert to the shelly firmware and have the option to update the firmware

@holycow234234
Copy link

I was able to get my Dimmer 2 going again based on the instructions from this post: https://www.shelly-support.eu/forum/thread/6349-how-to-load-stock-firmware-via-serial/?postID=96483#post96483

What I did:

  1. Flash shelly 1.8.4 bin backup from https://github.com/Mollayo/Shelly-Dimmer-2-Reverse-Engineering/blob/master/shelly%20stock%20firmware/shelly_dimmer_2%2020200904-094614%20v1.8.4%40699b08ac.bin via Tasmotizer
  2. Disconnect serial device.
  3. plug shelly into mains power
  4. Connect shelly to wifi with internet
  5. Allow device to upgrade firmware via internet, i.e. click upgrade firmware and don't mess with OTA url.

This is working for me so far. It has continued to work through power cycles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests