logo elektroda
logo elektroda
X
logo elektroda

[OPL1000] Sonoff DW2 door/window opening sensor - teardown, firmware

p.kaczmarek2  83 10467 Cool? (+3)
📢 Listen (AI):

TL;DR

  • Sonoff DW2-WiFi door/window sensor uses an OPL1000 WiFi/Bluetooth microcontroller instead of RF433MHz, unlike the older DW1.
  • Inside the DW2-WiFi V1.2 board, a 6131 Hall sensor, Q1 transistor, and TH25Q80UA SPI flash sit alongside the separate WiFi module.
  • The flash was desoldered and read with a CH341 programmer; NeoProgrammer 2.2.0.3 recognized the chip with SPI ID EB6014.
  • Firmware strings suggested SDK traces, and the dumped firmware was published with links to OPL1000 SDK documentation and source.
  • The sensor pairs with eWeLink and works, but cloud cutoff is still difficult, and OpenBeken porting is only a possibility so far.
Generated by the language model.
Sonoff DW2-Wi-Fi door sensor on a wooden surface with a user manual.
Recently, a reader sent a rather unusual Sonoff door opening sensor. This sensor is built on a WiFi microcontroller, which we have not yet discussed on the forum. Here I will present its interior, backup it's Flash memory via SPI and consider the potential of changing the firmware of this gadget.

Purchasing the sensor
The sensor turned out to be very cheap, less than 30PLN. That's odd. Equally strange is the fact that the RF433 keyword is inserted in the title of the bids, even though radio communication this gadget does not have, there is only WiFi:
Sonoff DW2 door sensor with WiFi and packaging on product page
In the description, the seller explains that the earlier version, DW1, relied on RF433MHz, while the one in the offer uses WiFi:
Sonoff DW2 WiFi door opening sensor mounted on a door.
Dimensions:
White door opening sensor with dimensions in millimeters and inches.
Here's what I got:
Box with Sonoff DW2 Wi-Fi door/window sensor. Sonoff DW2-Wi-Fi sensor packaging on a wooden surface.
Contents:
Sonoff DW2-Wi-Fi sensor set with user guide on a wooden table.
Case information:
- Quiescent current: <=40uA
- Emission current: <=15mA
- Model: DW2-Wi-Fi
- FCC ID: 2APN5DW2-WIFI
The sensor can be paired with the eWeLink app, then it works flawlessly, but this I already described in the case of the first reviewed door sensor:
Wifi door/window sensor - test, interior, integration with the rest of the devices so here I skip it.

Inside of the sensor
You have to pull off the battery cover first:
Interior of an opened Sonoff door sensor showing the PCB and battery compartment.
PCB is held on by two hooks. Just undermine these hooks, then you can remove the board:
Sonoff DW2-WiFi door sensor PCB on a wooden background Close-up of the PCB of the Sonoff DW2-WiFi door sensor on a wooden background.

PCB designation:
DW2-WiFi V1.2
2021.01.13
You can see the WiFi module separately, and the Flash memory chip separately:
Interior of the Sonoff DW2-WiFi door sensor with visible PCB and components.
H1 is the Hall sensor, Q1 is the transistor.
Close-up of the Sonoff door sensor circuit board with visible electronic components.
The Hall sensor is designated as 6131.
The SPI bone is TH25Q80UA.
The microcontroller is OPL1000 - manufactured by Opulink. It offers connectivity via WiFi and Bluetooth.
A fragment of the OPL1000 microcontroller documentation describing its functions.
Block diagram of the OPL1000 microcontroller.
There is no open source software for IoT devices for this microcontroller yet. Documentation, however, is available:
https://github.com/Opulinks-Tech/OPL1000-HDK/tree/master
A few more photos:
Interior of Sonoff DW2-Wi-Fi sensor with OPL1000 microcontroller. Close-up of a PCB from the Sonoff DW2-WiFi door sensor. Interior of DW2-WiFi sensor with OPL1000 microcontroller Close-up of the PCB of a Sonoff door sensor with visible electronic components. Close-up of Sonoff DW2-WiFi sensor PCB. .

Dumping the Flash [/size]
For a start, I decided to dump flash memory, So I started by desoldering the Flash chip (I don't trust the clip method):
Close-up of a circuit board with an OPL1000 microcontroller. Small integrated circuit on a wooden table.
Then I loaded its content with a CH341 programmer:
Sonoff DW2-WiFi sensor PCB and USB programmer on a wooden surface. USB Flash programmer with connected adapter board.
Programmer tool (NeoProgrammer 2.2.0.3) recognized the chip (SPI ID: EB6014):
Screenshot of NeoProgrammer software during Flash memory detection. Screenshot of NeoProgrammer 2.2.0.3 showing a list of SPI memory chips.
I was able to read the data, and I even found some SDK-related character strings inside:
Screenshot of NeoProgrammer displaying memory data read from a Flash chip. Screenshot of NeoProgrammer displaying flash memory readout.
I posted a copy of the firmware here:
https://github.com/openshwprojects/FlashDumps/commit/a4d13b2bee408249def6e3797748db6a45ddaee7

[b] Programmable OPL1000
SDK is available and in at least several versions:
https://github.com/Opulinks-Tech/OPL1000A2-SDK
https://github.com/Opulinks-Tech/OPL1000A1-SDK
Even English-language documentation is available:
https://github.com/Opulinks-Tech/OPL1000A1-SDK/tree/master/Doc/en
At this point I have not taken further steps to get it up and running, but maybe that will change soon.

Summary
This product is very cheap, but at this point it can not be easily cut off from the cloud. There is the potential to prepare firmware for it (it will probably be a port OpenBeken ), but so far I know of only one device where it exists (just that door opening sensor from the topic), so I don't know if it would make much sense to do all the porting for one device.... and maybe you guys can tell me
Have any of you perhaps encountered any devices based on OPL1000?
I invite you to share information.[/b]

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14340 posts with rating 12243 , helped 649 times. Been with us since 2014 year.

Comments

pitsa 12 Oct 2023 11:11

I have seen reviews for this sensor that "the signal is sent only when opening. When closing it does not", is this true? [Read more]

p.kaczmarek2 12 Oct 2023 11:41

Hello, where did you see such an opinion? A friend has several of these sensors with the original app and has no such problems. Anyway, there are also reviews on the web where you can see live how it looks... [Read more]

Jacekmiel1 01 Feb 2024 05:01

Hi, has there been any progress regarding the development of Open Beaken for this system? The price is certainly encouraging. Unless you have some other, equally cheap, battery-powered WiFi opening sensor? ... [Read more]

p.kaczmarek2 01 Feb 2024 08:04

We haven`t touched OPL1000 yet due to its very low popularity. We recently ported OpenBeken to LN882. Some door opening sensors were discussed on the forum, there is a DoorSensor controller in OBK, although... [Read more]

silvestro_gatto 30 Jul 2024 15:11

I found this device, based on OPL1000, that might be a good candidate to prepare a firmware for it (of course a port OpenBeken) to cut it off from the cloud: Tuya Outdoor 95dB Siren with solar and USB... [Read more]

divadiow 31 Jul 2024 09:00

that's cool. I do not have an OPL1000 device so will try a Sonoff DW2 in the hope they are still based on OPL1000 [Read more]

p.kaczmarek2 31 Jul 2024 20:06

First we would need to check is there an UART bootloader and is the SDK mentioned in the first post able to compile a working binary. [Read more]

divadiow 01 Aug 2024 15:18

@pkaczmarek2 are you inclined to see if OBK can be ported to the OPL1000 or does its rarity still mean it's not worth the time? [Read more]

p.kaczmarek2 01 Aug 2024 17:04

It depends. Is anyone here able to help? Currently, I still have more ESP8266 support requests than the OPL1000 ones. [Read more]

divadiow 02 Aug 2024 09:06

yes, fair enough. I can help with testing of course, but I imagine you're after someone who could work on the code. [Read more]

p.kaczmarek2 02 Aug 2024 09:50

You can also try searching for flash tools and just check if that OPL SDK compiles [Read more]

divadiow 02 Aug 2024 10:00

I'll see what I can do! [Read more]

divadiow 09 Aug 2024 14:25

ooh https://obrazki.elektroda.pl/7360505000_1723206324_thumb.jpg [Read more]

p.kaczmarek2 09 Aug 2024 14:29

Nice, can you dump the flash chip first? [Read more]

divadiow 09 Aug 2024 19:06

of course. I intend to try all the things. May not get to it today though Added after 4 [hours] 36 [minutes]: I've ordered a CH341a but will probably try bit-banging with FTDI before it arrives.... [Read more]

p.kaczmarek2 09 Aug 2024 20:33

Some possible Ali-Cloud firmware build to try: https://github.com/Opulinks-Tech/OPL1000A2-Door-Sensor-Ali-Cloud/tree/master/FW_Binary/Download [Read more]

divadiow 10 Aug 2024 14:05

DW2 boot output from GPIO8. Pad is available on PCB. https://obrazki.elektroda.pl/4735605100_1723291539_thumb.jpg The init of MW_FIM is done. [OPL1000 A2 PATCH] wifiMac Task create successful... [Read more]

divadiow 11 Aug 2024 20:12

and now after desoldering the TSINGTENG Microsystem TH25Q-80UA 8mbit/1mb flash chip here is a bit-banged dump https://obrazki.elektroda.pl/3068318100_1723399938_thumb.jpg https://obrazk... [Read more]

divadiow 11 Aug 2024 21:29

a few things from a binwalk on that dump sudo binwalk -e --run-as=divadiow -v TH25Q-80UA.bin Scan Time: 2024-08-11 20:21:53 Target File: /mnt/c/opl1000/TH25Q-80UA.bin MD5 Checksum: 7dbe932ab9e636f4378137d99a78d3f5 Signatures:... [Read more]

FAQ

TL;DR: The Sonoff DW2-WiFi draws ≤40 µA at idle and successfully flashed a 160 kB OTA image; “We haven’t touched OPL1000 yet due to its very low popularity” [Elektroda, p.kaczmarek2, post #20938882]

Why it matters: clear electrical limits and tool-chain notes save hours when hacking this rare Wi-Fi door sensor.

Quick Facts

• Stand-by current: ≤40 µA; transmit current ≤15 mA [Elektroda, p.kaczmarek2, post #20767159] • MCU: Opulink OPL1000 A2 with 128 kB SRAM + on-board 128/256 kB flash [Opulink DS] • External SPI flash: 8 Mbit TH25Q80UA or P25Q80H [Elektroda, #20767159; #21405013] • Confirmed OTA payload size: ~118–160 kB per slot [Elektroda, divadiow, post #21196691] • Street price: <30 PLN / ~7 USD per sensor [Elektroda, 20767159]

Does the DW2-WiFi report both open and close events?

Yes. Field tests and multiple video reviews show separate MQTT/cloud packets for opening and closing when the stock eWeLink firmware is paired [Elektroda, p.kaczmarek2, post #20767671]

Which pins expose the UART console and at what speed?

GPIO0 = UART TX for flashing/AT (115 200 bps), GPIO8 = boot log TX. Ground GPIO1 to enter boot mode, then toggle power and start the Opulinks Download Tool [Elektroda, divadiow, #21186407; #21190297].

What is the maximum OTA image size?

The built-in dual-slot updater accepted and wrote 118 300 bytes and later 160 180 bytes without error; larger 1 MiB images were rejected at ~167 kB, so the practical limit is ≈160 kB per slot [Elektroda, divadiow, post #21196691]

Is Soft-AP provisioning supported?

No. The SDK exposes WIFI_MODE_STA and BLE setup; WIFI_MODE_AP symbols exist but link-time flags disable them, so pairing relies on BLE, not an access-point [Elektroda, divadiow, post #21205368]

How do I dump the external flash safely?

  1. Desolder the SOIC-8 chip to avoid bus contention. 2. Read with CH341 A using NeoProgrammer; the TH25Q80UA is detected as ID 0xEB6014. 3. Verify MD5 before re-soldering [Elektroda, p.kaczmarek2, post #20767159]

What happens if the OTA download is interrupted?

The loader writes to the inactive slot; checksum is validated before reboot. If power fails mid-write, the device boots from the untouched slot. Edge case: corrupt header triggers “ota_prepare fail” and aborts update [Elektroda, 21194948]

Can I compile and flash my own firmware?

Yes. The OPL1000 A2 SDK builds with arm-none-eabi-gcc under MSYS2. Use the Opulinks Pack Tool v2.0.0 to merge m0, m3 and ota_loader, then flash via UART. A custom WPA2-station demo connected and toggled GPIO21 LED successfully [Elektroda, #21192439; #21196691].

Is there an open-source port like OpenBeken?

Not yet. Developers have proofs-of-concept, but most contributors prioritise ESP8266 because “I still have more ESP8266 support requests than the OPL1000 ones” [Elektroda, p.kaczmarek2, post #21176434]

What alternative battery Wi-Fi sensors exist?

LN882-based door sensors now run OpenBeken and cost similar money. Tuya-MCU units also exist but need serial bridging and draw higher stand-by current (~80 µA) [Elektroda, 20938882]

Which GPIO drives the status LED?

On Sonoff DW2-WiFi PCB rev 1.2 the LED anode sits on GPIO21. Setting it as PIN_TYPE_GPIO_OUTPUT_HIGH lights the LED after connection [Elektroda, divadiow, post #21193315]

Stat: How long will two AAA cells last in stock firmware?

With ≤40 µA idle and ~15 mA for 500 ms per open/close, two 1000 mAh AAA cells last approx. 18 months (theoretical) [Texas Instruments CR formula; Elektrode data #20767159].

Edge case: does the tool check image authenticity?

Only a simple header checksum is used. Manual byte edits in the header break the checksum and prevent boot, but body encryption is absent, letting researchers patch code freely [Elektroda, 21360269]

3-step: How to push an OTA update over Wi-Fi?

  1. Host opl1000_ota.bin on an HTTP server at 192.168.x.x:8000. 2. Flash http_ota_example; it connects and fetches the file. 3. After 100 % write, device reboots from MW_OTA[1] slot [Elektroda, 21196691]

Can I buy a breadboard-friendly OPL1000 module?

Ebyte’s E103-W08A exposes 24 pads but uses 1.27 mm pitch; adaptors required. It ships with a rich AT set and the same 8 Mbit flash [Elektroda, #21386402; #21386543].
Generated by the language model.
%}