logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 
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 11960 posts with rating 9995 , helped 572 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]

%}