The wait is over. Sonoff MiniR4 Extreme has been released today and you can get one for yourself from the Itead store – it will cost you $9.90. I held off with the Tasmota flashing guide, as things on the internet are short-lived and no one but a handful of privileged influencers had one at home. Now, that you can get one for yourself – let’s talk Tasmota. If you are interested to see what you going to give up – check out my original article which covers the use of the single channel relay with eWeLink.
Sonoff MiniR4 Extreme and custom firmware
Things have changed a little in the Tasmota world, so I’ll be trying the new web tool to get the process accomplished. It worked great with my other ESP32 boards it should work just fine to flash Tasmota on Sonoff MiniR4 Extreme. If only, someone had the time to port the excellent Tasmotizer to support ESP32 boards for all-in-one flashing needs.
From my original teardown, I know that Sonoff MiniR4 Extreme uses ESP32 to connect to the internet and control the logic for the single-channel relay inside. It’s located on a small daughter board soldered at a 90-degree angle. As the daughter board comes with dev pads linked to the pins responsible for flashing firmware – my job today is much easier.
Tools
You’ll need a soldering iron and FTD Flasher to complete the process. Take my advice and don’t cheap out on the FTD flasher. I have far too many emails that report issues during the flash process, usually solved using a more robust serial adapter. While you are splashing out, it would be a miss not to plug the MiniWare TS101 as the soldering iron of choice. The recently acquired JimiHome tool set also comes in handy if you take apart a lot of electronics.
One more shill from me: a multimeter is a must if you want to learn more about devices like Sonoff MiniR4 Extreme, although not needed for this guide. It’s nice to have a professional one, but inexpensive multimeters that measure DC and have continuity are what you need. I have been using ANENG AN8008 (best £10 spent) – which is perfect. It’s what I used to confirm the pin layout.
GPIO hunt
The switch is as simple as they get. Only a couple of inputs/outputs and ESP32-DOWD-V3 are in charge. To find out what’s what, I need a datasheet for this IC. As the most important pins are already exposed as dev pads, I just need to confirm where is VCC. A quick probe of the VDDA 1 pin reveals the connection to the U2 pad on the underside of the main board.
It’s time to wire things out according to the table below:
FTD Serial | Sonoff MiniR4 Extreme |
VCC (3.3V) | U2 |
GND | GND |
RX | TX |
TX | RX |
I soldered up a couple of wires (a good colour scheme helps) to the dev pads of the Sonoff MiniR4 Extreme – with connectors for the pins from my FTD1232 module. To enter the bootloader mode, you have to hold the button located on the daughter board (mapped to GPIO00) as you power the Sonoff MiniR4 Extreme. After that, you can start flashing.
Flashing Tasmota on Sonoff MiniR4 Extreme
You will lose the original firmware, and without a backup, you won’t be able to restore it back as it’s linked to the MAC address of the device. The web tool won’t create a backup for you – for that, you need to use a CLI tool to backup, erase and flash new firmware. I’m not going back, so the web interface for flashing Tasmota on Sonoff MiniR4 Extreme is just fine for me.
Open the Tasmota flash tool web interface (link) and connect your Sonoff MiniR4 Extreme in the bootloader mode (hold down the button as you connect the module to power). Do not power the module with mains. Your FTD module will supply enough current unless you have a dodgy module or your USB socket is not able to deliver 500mA of current.
Select tasmota.bin
(the tool will show you compatible ESP ICs) and start the process. It should take about 3 min to complete. At this point, your Sonoff device will reboot and if you have enough juice in your FTD1232 adapter it might even display a WiFi access point. If that doesn’t happen, don’t worry.
Setting it up
De-solder the wires, close up the unit, and power on Sonoff MiniR4 Extreme again via mains – it should advertise SSID with tasmota in its name. I know it’s tempting to leave the FTD adapter connected just in case, but don’t do that!
Once connected to Tasmota AP – visit 192.168.4.1 in your browser, enter your WiFi credentials and your Tasmotized Sonoff MiniR4 Extreme will reboot again. You should be able to find it on the network with a tool like Fing App.
Mapping outputs
Your device has Tasmota, but it doesn’t know everything about the hardware. Visit the configuration menu to set it up. There are 2 ways of finding what’s what – the tedious way – probing each component on the board and tracing it back to ESP32 then looking it up in the datasheet, or if you have flashed enough of these, you know which pins are likely used for what.
If you want to learn how to find the pins, read more. Otherwise, just use the template below to configure everything:
{"NAME":"Sonoff MiniR4 Extreme","GPIO":[32,1,1,1,1,1,1,1,0,1,1,1,1,1,1,576,0,1,1,1,0,1,224,160,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1}
Start with pins labelled as GPIO in the datasheet, as these are likely to be used first. After blindly trying a couple in the range of 20-30 I quickly found that the relay and switch are mapped to GPIO26 and GPIO27. I already knew about the physical button linked to the GPIO00 – what gave me a couple of tries to find was the LED – which is assigned to GPIO19.
Relay 1 | GPIO26 |
Switch 1 | GPIO27 |
Button 1 | GPIO00 |
LED (inverted) | GPIO19 |
There is no golden rule. To find all pins takes a little time and patience. It’s good to make notes as you go, in case you forget which pins have been checked and tested by you.
Shop with Sonoff
Take a look at the ZigBee and WiFi range of the devices compatible with eWeLink:
Final Thoughts
Now that you flashed Tasmota on Sonoff MiniR4 Extreme, you can enjoy REST, MQTT and more integrations. If you don’t have your relay yet – visit the ITEAD store and get one for yourself. Alternatively, if ZigBee is your thing, check out the article on MiniR4’s twin: Sonoff ZBMiniL2 – a no-neutral in-wall switch that uses ZigBee protocol instead. There is a care package from ITEAD coming my way with some interesting devices, so if you want to know what’s next – keep in touch! If you have any questions, feel free to leave them in this Reddit thread.
🆓📈 – See the transparency note for details.