Here I'll take a quick look inside a LoraTap/Tuya MC100W contact sensor for door/gate/window open/shut monitoring.
Ali Express purchase
https://www.aliexpress.com/item/1005007268034863.html
https://www.loratap.com/products/mc100w
Box, parts, device internals:

Xradiotech (now Allwinner) XR809 on a Tuya XR3 module
Initial OpenXR809 development can be seen here with another contact sensor https://www.elektroda.com/rtvforum/topic3806769.html
With XR3 module powered directly with 3.3v, the boot log from RXD0 can be captured at 115200 baud
And using the same process as with this P06 XR3 motion sensor the firmware can be dumped using PhoenixMC, the official UART flash tool.
With PB02 and PB03 common grounded with 3.3v PSU, USB-TTL GND and XR GND+
XR3 RXD0 -> USB-TTL RX
XR3 TXD0 -> USB-TTL TX
we read the 2mb flash to file from the debug menu in PhoenixMC
output is flash_A_0x0_L_0x200000.bin at 2,097,152 bytes
Before flashing OpenXR809 I paired it with the Tuya app
Device has schema ID: 000001qrb9, firmware key8ky3d8eshuygm and firmware version 1.0.6.
Easy Flasher can extract some information from the flash dump
Full Tuya config JSON
we also see this in the boot log + a button on P6
I don't see mention of BAT_ADC assignment, but one assumes this should be P08
Flashing OpenXR809 experience (animated gif):
AP broadcast on power-up with PB02 and PB03 no longer grounded
Connection to hotspot requires manually configuring IP on wireless adaptor to 192.168.4.2-254 so 192.168.4.1 can be browsed to (unless this has been merged https://github.com/openshwprojects/OpenXR809/pull/8)
Template import does not work because there is no LittleFS support in OpenXR809
So manual assignment is required. In it's most basic form those are:
which, visually, is as follows
With this the button pushes are acknowledged
the LED flashes when connecting to wifi but is off once connected and the channel assigned dInput_NoPullUp (channel 2) will change state depending on the proximity of the magnet to the sensor on the PCB
Magnet close (door closed)
Magnet removed (door open)
Unfortunately the battery driver does not seem to be present on OpenXR809 and I don't think any deep sleep functions are available so battery operation is not practical - it will need powering from external 3v. I may be corrected on this and XR809 support may get developed to enable these functions.
Flash backup will land at https://github.com/openshwprojects/FlashDumps/tree/main/IoT/XR809 as Tuya_LoraTap_MC100W_Contact_(schemaID-000001qrb9)_key8ky3d8eshuygm_XR3_1.0.6.bin in due course
OpenXR809 boot log
Ali Express purchase
https://www.aliexpress.com/item/1005007268034863.html

https://www.loratap.com/products/mc100w
Box, parts, device internals:










Xradiotech (now Allwinner) XR809 on a Tuya XR3 module
Initial OpenXR809 development can be seen here with another contact sensor https://www.elektroda.com/rtvforum/topic3806769.html


With XR3 module powered directly with 3.3v, the boot log from RXD0 can be captured at 115200 baud
Code: Text

And using the same process as with this P06 XR3 motion sensor the firmware can be dumped using PhoenixMC, the official UART flash tool.
With PB02 and PB03 common grounded with 3.3v PSU, USB-TTL GND and XR GND+
XR3 RXD0 -> USB-TTL RX
XR3 TXD0 -> USB-TTL TX

we read the 2mb flash to file from the debug menu in PhoenixMC


output is flash_A_0x0_L_0x200000.bin at 2,097,152 bytes
Before flashing OpenXR809 I paired it with the Tuya app






Device has schema ID: 000001qrb9, firmware key8ky3d8eshuygm and firmware version 1.0.6.
Easy Flasher can extract some information from the flash dump
Code: Text
Full Tuya config JSON
Code: JSON
we also see this in the boot log + a button on P6
Code: Text
I don't see mention of BAT_ADC assignment, but one assumes this should be P08

Flashing OpenXR809 experience (animated gif):

AP broadcast on power-up with PB02 and PB03 no longer grounded

Connection to hotspot requires manually configuring IP on wireless adaptor to 192.168.4.2-254 so 192.168.4.1 can be browsed to (unless this has been merged https://github.com/openshwprojects/OpenXR809/pull/8)
Template import does not work because there is no LittleFS support in OpenXR809

So manual assignment is required. In it's most basic form those are:
Code: Text
which, visually, is as follows

With this the button pushes are acknowledged
Code: Text
the LED flashes when connecting to wifi but is off once connected and the channel assigned dInput_NoPullUp (channel 2) will change state depending on the proximity of the magnet to the sensor on the PCB
Magnet close (door closed)
Code: Text
Magnet removed (door open)
Code: Text
Unfortunately the battery driver does not seem to be present on OpenXR809 and I don't think any deep sleep functions are available so battery operation is not practical - it will need powering from external 3v. I may be corrected on this and XR809 support may get developed to enable these functions.
Flash backup will land at https://github.com/openshwprojects/FlashDumps/tree/main/IoT/XR809 as Tuya_LoraTap_MC100W_Contact_(schemaID-000001qrb9)_key8ky3d8eshuygm_XR3_1.0.6.bin in due course
OpenXR809 boot log
Code: Text