SonOff DIY Mode - OTA Unlock & Convert to Tasmota - Automated

Tags: #<Tag:0x00007fc20a5fe6b8> #<Tag:0x00007fc20a5fe4b0> #<Tag:0x00007fc20a5fe208>

Picked up some of the new Sonoff Mini’s recently with the plan to build them into some light switches. Consensus is that the stock ewelink firmware leaves a bit to be desired, but their new DIY mode does make it doable to OTA unlock & re-flash - with a few hoops. Also varying warnings that their Windows app triggers some antivirus warnings for unknown reasons.

Found a couple of reasonably comprehensive guides on doing it manually without using the App, including the following two, but it’s pretty roundabout and time consuming.

Long story short - I used tuya-convert recently to convert some cheap hardware store wifi plugs to tasmota - quite a tidy package and process. Also this week had another 6 sonoff mini’s arrive that I wanted to convert as well, so I re-wrote some of the functions, and added a few of mine own to automate the process in tuya-convert fashion. :slight_smile:

They still need to have the diy/ota mode jumper fitted refer earlier links for photos, but it’s a whole lot easier than re-soldering them.

If it’s of use to people, you’re welcome to use it. There’s a few bits where the code isn’t as tidy as it could be, but it works, so that’s good enough for me. Install it alongside a tuya-convert install on a pi or similar and it’ll do the device id read, ota unlock, and reflash the firmware all a bit under a minute.

Enjoy. :stuck_out_tongue:

1 Like

Will give it a try next week :grinning:

Let me know how you go. I couldn’t find anyone else who had published scripts to automate it yet, so I made my own. It also enables IP masquerading/NAT on the RPi so the sonoff can access the internet during the unlock stages, and then uses the existing python webserver the tuya project has to serve the tasmota (or in theory espuna) firmware they bundle.

After that it’s just connect to your wifi network as usual, reset 5 & update tasmota, and complete configuring the template, and MQTT, etc.