logo elektroda
logo elektroda
X
logo elektroda

Tiny Sonoff Mini R4 M relay - compatible with Matter, but not reprogrammable

p.kaczmarek2  6 375 Cool? (+3)
📢 Listen (AI):
Sonoff MINIR4M relay with visible terminals and connected wires
The Sonoff MINIR4M is a small, in-box relay that allows you to easily turn a simple lighting or electrical device into a Wi-Fi-controlled building automation component. With Matter support, it can work with different ecosystems (Apple Home, Google Home, Alexa) without being locked into a single app.
Disassembled Sonoff MINIR4M relay with labeled components and safety feature descriptions
In this material, I will test its performance in the eWeLink app, take a look inside the device and see if it is possible to change the factory firmware.

We bought the Sonoff Mini R4 M for £30. This is a little more expensive than the cheapest Tuya products, but maybe it's worth it? All we get in the kit is the product itself and the manual:
Sonoff MINI Extreme smart switch box with Matter and smart home logos Back side of Sonoff MINI R4M packaging with technical details and distributor label Sonoff MINIR4M relay beside Quick Guide V1.2 manual
The product is really compact - its dimensions are only 39.5 x 33 x 16.8 mm. It can be hidden in a deeper box just behind a regular switch, which it will also handle. It operates on 100 - 240 volts.
Sonoff MINIR4M module with technical markings and QR code on the casing
It's time to plug it in and test the application:
Sonoff MINIR4M module with labeled terminals and connected power wires

Test with the eWeLink app
We download the app and create an account. The product works with a 2.4 GHz Wi-Fi network. We put it into pairing mode. The phone finds the device:
Device pairing screen with 2.4 GHz Wi-Fi selected and password input field visible eWeLink app screen showing pairing mode and searching for devices animation. App screen showing instructions to set up Sonoff device by scanning the QR code
This is the Matter device - you need to scan the QR code here too. It is located on the casing:
QR code scanning screen in app with flashlight button and setup without QR option eWeLink app screen showing SONOFF MINIR4M device detected Pairing screen for MINIR4M device in eWeLink app on smartphone
This way we get remote control of the device from within the app. The app also asks us for updates, which it proposes to do at night between 2:00 and 4:00.
eWeLink app screen showing Sonoff MINIR4M relay in off state Automatic update prompt for Sonoff MINIR4M in the eWeLink app eWeLink app screen showing Sonoff MINIR4M device with power button highlighted
The device offers integrations with platforms such as Amazon Alexa, Google Home, IFTTT, SmartThings, etc. Scenes and automations are offered as standard. Here we additionally have support for control via LAN (local area network), notification and alarm settings when the device is offline. It is also possible to disable the Wi-Fi status LED (network indicator) and set the status when power is restored. This is very convenient!
Device settings screen for Sonoff MINIR4M in the eWeLink app Device settings screen in the eWeLink app showing enabled LAN and network indicator
Switch mode, on the other hand, allows you to handle different types of buttons - bistable and monostable. In addition, you can also separate the relay from the button to rely on automations.
Screenshot of switch mode settings in the eWeLink app Screenshot of Sonoff app showing external trigger modes for relay control
There's news in the status settings after power restoration too. The delayed option I hadn't seen before. There is also inching left - that is, an automatic return to the previous state after a given time. The infographic shows that this is useful for switching off the humidifier, for example.
eWeLink app screen showing power-on state settings for the device eWeLink app screen showing Inching Settings for Sonoff device App screen with illustration showing how to use inching mode for a humidifier.
You can also check the firmware and device version in the settings:
Screenshot of Sonoff MINIR4M device settings in the eWeLink app
There are more options than before. I am impressed.
Now you can pair with Matter and other ecosystems, but I'm curious about something else....

Interior and programming test
Let's check the construction of the unit. We lift the lid. The first thing that catches your eye is the thermowell underneath which is the ESP32:
Sonoff MINIR4M PCB with pink thermal pad on ESP32-C3 module
ESP32-C3, which is the chip from Espressif, this time already with built-in Flash memory. On the board it is possible to identify the RX, TX and GPIO0, but will this give us anything?
Close-up of Sonoff MINIR4M PCB with wires connected to RX, TX and GND pins
I connected a USB to UART converter as a test:
Sonoff Mini R4M module connected to USB-UART adapter and breadboard
Boot log testifies to a locked flash:

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x1 (POWERON),boot:0xd (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
Valid secure boot key blocks: 0
secure boot verification succeeded
load:0x3fcd5978,len:0x38ac
load:0x403cc710,len:0x930
load:0x403ce710,len:0x5804
entry 0x403cc710
I (77) boot: ESP-IDF v4.4.3-4-g30c422c-dirty 2nd stage bootloader
I (77) boot: compile time 02:54:24
I (77) boot: chip revision: 4
I (80) boot_comm: chip revision: 4, min. bootloader chip revision: 3
I (87) boot.esp32c3: SPI Speed      : 80MHz
I (92) boot.esp32c3: SPI Mode       : DIO
I (97) boot.esp32c3: SPI Flash Size : 4MB
I (101) boot: Enabling RNG early entropy source...
I (107) boot: Partition Table:
I (110) boot: ## Label            Usage          Type ST Offset   Length
I (118) boot:  0 esp_secure_cert  unknown          3f 06 0000d000 00002000
I (125) boot:  1 nvs_matter       WiFi data        01 02 00010000 00006000
I (133) boot:  2 nvs_matter_bkp   WiFi data        01 02 00016000 00006000
I (141) boot:  3 nvs              WiFi data        01 02 0001c000 00010000
I (148) boot:  4 otadata          OTA data         01 00 0002c000 00002000
I (156) boot:  5 phy_init         RF data          01 01 0002e000 00001000
I (163) boot:  6 ota_0            OTA app          00 10 00030000 001e0000
I (171) boot:  7 ota_1            OTA app          00 11 00210000 001e0000
I (178) boot:  8 fctry            WiFi data        01 02 003f0000 00006000
I (186) boot: End of partition table
I (190) boot_comm: chip revision: 4, min. application chip revision: 3
I (197) esp_image: segment 0: paddr=00030020 vaddr=3c120020 size=20ee8h (134888) map
I (228) esp_image: segment 1: paddr=00050f10 vaddr=3fc94a00 size=03a0ch ( 14860) load
I (231) esp_image: segment 2: paddr=00054924 vaddr=40380000 size=0b6f4h ( 46836) load
I (243) esp_image: segment 3: paddr=00060020 vaddr=42000020 size=11c504h (1164548) map
I (437) esp_image: segment 4: paddr=0017c52c vaddr=4038b6f4 size=09174h ( 37236) load
I (445) esp_image: segment 5: paddr=001856a8 vaddr=50000010 size=00010h (    16) load
I (445) esp_image: segment 6: paddr=001856c0 vaddr=00000000 size=0a910h ( 43280) 
I (458) esp_image: Verifying image signature...
I (459) secure_boot_v2: Verifying with RSA-PSS...
I (465) secure_boot_v2: Signature verified successfully!
I (474) boot: Loaded app from partition at offset 0x30000
I (474) secure_boot_v2: enabling secure boot v2...
I (479) secure_boot_v2: secure boot v2 is already enabled, continuing..
I (487) boot: Checking flash encryption...
I (492) flash_encrypt: flash encryption is enabled (0 plaintext flashes left)
I (499) boot: Disabling RNG early entropy source...
śţ˙śţcommission_status = 0, flag = 0 matter_ble_complete = 0

-------------no matter wifi data--------

ais_lan_data = data1=m9KL753ODZwYKyeWfAuOH0PvofQe4q/vSPmGlHeMVJ6t94YgXzzPFB3/BfImawnvCgjHQNhw0B8wiq2ty0nGm20OpkRju0dZC06+kpHAJt0JUjV/MzH9XSnvS+SbonJCQZ+ebWO7lzl/re1OefO6Wp7XnQFOg8T/AxBzvWUuR0758VY5nt/d5hCsdOvqWJaYOgZDAlOEc/CJ49tXulus8OvZjJsKyLDYmH1gp8CxmSgyj1LyxYHgcpARI i = 0

ais_lan_data = data2=i3oXacL0TG+vL0zSOopTv5l5wI+7BObJ3+qNsD/6wvsZ1chY0VPzTOfGUEzzeyG6Ns43yJRFGgZuXtPMoTjEtbEfpPgILm86r3CwnX0Kqg7m93HJf8YlvyH7e22t+PmWHc7PnsDtNjJV08j2zV7+CmtVYmGfwItxyS/Fr4otGrIsdLHue0I1RptHZuFMlK1X2GqSBCb7aYy+xnynykpgOvUDwzoxAqC0qm46q36TT8m7PS3io8EThlXfe i = 1

ais_lan_data = data3=fvV0UoRrm7rHFOSkWbJGbBLwZ+fZJPBBa4AgZt639M6Z3ivOY9ARbRx0urAENJqwwJvJEFIzeGj7f3 i = 2

datakey_name = data4 i = 3



esptool is unable to read the batch from this chip, so the firmware cannot be changed. What's left is to replace the ESP32 with another one, and that already requires soldering really small components.
All that's left is to look at the rest of the PCB, for educational purposes only.
Close-up of electronics inside Sonoff relay, visible capacitors and resistor Close-up of Sonoff MINIR4M relay internals showing capacitors and PCB components Close-up view of Sonoff MiniR4M relay internal components, including capacitors and inductor
Inside a transformerless inverter, varistor, capacitor against interference, fuse.... Sonoff has not regretted it.
The circuit is powered by a typical BP2525 + LDO 3.3 V combination.
Close-up of Sonoff Mini R4 PCB with a test probe wire connected
PCB designation: MINIR4 V1.0 2022.01.01 It's been four years....

Summary
Without doubt, this is a highly customisable, compact and convenient product. I'm seeing more and more of these features in these gadgets and here everything has been thought of - even the option to turn off the annoying LED from the Wi-Fi status. Matter compatibility can also come in handy for connecting to different ecosystems, there is only one downside here - you can't change the ESP batch here.
There have already been claims on the forum that Matter certification requires the batch to be locked, so I'm not surprised by how this turned out. We had a similar situation with Sonoff M5-3C-80W . Basically, I can suggest one approach here - if you want to change firmware, you need to buy products without Matter support.
And what is your opinion? Do you use Matter? Have you already encountered a secured ESP32?

About Author
p.kaczmarek2
p.kaczmarek2 wrote 13745 posts with rating 11551 , helped 624 times. Been with us since 2014 year.

Comments

Nargo 10 Jan 2026 11:42

I was also trying on these modules, but the choice fell on the SONOFF BASIC R2 Mini. It can be reprogrammed. I use the R2 Mini from the after-market. [Read more]

p.kaczmarek2 10 Jan 2026 11:54

It seems to me that, if anything, the version without M, the Sonoff Mini R4, can be reprogrammed anyway. Only those versions with M are locked. You can see them by the offers, they are advertised as M... [Read more]

Nargo 10 Jan 2026 13:04

For the time being, I plan to set up basic 2 for corridor lighting and try out the "Magic switch" [Read more]

p.kaczmarek2 10 Jan 2026 13:07

"Magic Switch"? Which ones exactly? I see several different things under that name, from switches to some project on GitHub of a program for Sonoff. [Read more]

Nargo 10 Jan 2026 13:22

Magic Switch https://obrazki.elektroda.pl/2483531700_1768049695_bigthumb.jpg [Read more]

krzbor 10 Jan 2026 20:11

I see you have a device from Matter/Thread. There has already been a lot about IoT on classic WiFi, much less about Zigbee, but I haven't read about Matter on the electrode. Why don't you zoom in on this... [Read more]

%}