logo elektroda
logo elektroda
X
logo elektroda

Socket plug with energy measurement NAS-WR01W and NAS-WR07W [BK7231/BL0937/BL094

p.kaczmarek2  11 8625 Cool? (+8)
📢 Listen (AI):

TL;DR

  • Two Tuya NAS-WR07W/NAS-WR01W twin sockets with energy measurement were torn down, revealing Beken BK7231 hardware instead of the ESP8266 often mentioned online.
  • NAS-WR07W uses a directly mounted BK7231T with BL0937, while NAS-WR01W uses BK7231N with BL0942 and exposed UART programming pads.
  • BL0937 uses CF, CF1, and SEL frequency outputs for power and voltage/current sensing, while BL0942 sends measurements over UART.
  • The housings are glued and hard to open because the plug pins block PCB removal, so the author cut the plastic and suggests tuya-cloudcutter may work.
Generated by the language model.

Hello, I will present here two Tuya 'smart' twin sockets/plugs with energy measurement and WiFi control. These sockets are characterized by a glued casing, almost impossible to remove without damaging them. Here I will show you how to access the programming signals without damaging them too much. The sockets shown here will be based on the BK7231T and BL0937 (first) and the BK7231N and BL0942 (second).

NAS-WR01W/NAS-WR07W plugs
I got the products for free from their distributor in order to run OpenBeken , but you can normally buy them for around PLN 70 in many online stores.

On the internet you can read that these specific sockets are implemented on ESP8266.



Unfortunately, that has already changed. The manufacturer switched to BK7231. According to their distributor, you can no longer order fresh portions of these sockets for ESP.
This is what the set I got looks like (the third socket, Mycket PE-01E IP44, I will discuss another time):

First Packing:

Contents:

Instruction:

The instruction of the second one is identical, so I omit it, as well as the tests with the Tuya/SmartLife app that have already been performed many times.

The inside of the NAS-WR07W
As in the BW-SHP6, you need to unscrew one hidden screw:

Now it should be possible to remove the plate, but I had a serious problem with it. In this case, the pins of the plug blocked the possibility of removing the PCB. I decided to use the brute force method (later I will show a better way to physically connect the programmer, and there is also a tuya-cloudcutter to upload the batch via WiFi).
I also tried unscrewing the pins, in vain.
Finally, the mini-grinder went into action:

Ready:

You can see BK7231T and BL0937:

(Yes,I know, the PCB was slightly damaged when opening)
The BK7231T is directly on the PCB, not as a WB2S, WB3S or similar module.
BL0937 is an energy measurement system. It is identical to the already discussed BL0942, with the difference that BL0942 reports the results via UART, and BL0937 converts them to signals of a given frequency.



The SEL pin selects the mode (voltage or current). Pin Cf is the frequency which represents the power. Pin Cf1 is either voltage or current selectable. To convert the resulting signals into actual numerical values, count the number of signals on a given pin per unit of time (preferably by interrupting) and multiply them by the calibration constant.

Everything, including the relay, is cleverly packaged:

The FT8440A is a transformerless power supply system. There is no flyback converter here, it is a buck converter (so there is also no galvanic isolation from the mains):
Quote:

ft8440/8441 is a high performance, high precision, low cost non-isolated buck power converter. it contains a dedicated current-mode pwm controller and a high-voltage power mosfet. the built-in error amplifier is optimized to ensure superior dynamic response. the high-precision internal divider resistor and reference voltage, and stable closed-loop feedback enable the ft8440/8441 to obtain a stable and high-precision output voltage within the full voltage input range.

ft8440/8441 adopts ultra-high voltage technology with internally integrated high voltage start circuit, high voltage power mosfet switch, and current sampling resistor, which reduces external components and greatly simplifies system application. the built-in frequency jitter and soft drive design can effectively improve emi performance.

the internal integrated functions also include: vcc under-voltage protection (uvlo), vcc over-voltage protection (ovp), over-temperature protection (otp), cycle-by-cycle over-current protection (ocp), output short-circuit protection (scp). the perfect protection function ensures the reliability of the system.


The relay is HF7520.

In the photo below you can see the pads for programming:

You will need 3.3V, GND and TX and RX, and a UART converter with 3.3V levels. I reset/reboot by cutting off the power. Everything is similar to other topics about BK7231:
Light switch from USA - Gosund Smart Switch SW5-A-V2.1 - BK7231T
Garden double relay Tuya CCWFIO232PK - BK7231T - programming

NAS-WR07W pinology
Below I wrote down the necessary pins, especially those from BL0937:

P6 is LED, P26 is relay.
The button is on P9.
BL0937 CF is on P0, CF1 is on P8 and SEL is on P24.
In OpenBeken it is set here:



NAS-WR01W plugs and a smarter way to program
For the NAS-WR01W twin product, I tried a different approach and only cut the plastic at the programmer signals alone:

In this way, wires can be soldered there and programmed without removing the rest of the housing by force, but of course then you need to protect the damaged housing.

And now attention - this plug has BK7231N and BL0942 inside. It's better to use hid_download_py, but this time I managed to upload the batch with bkWriter:



The relay is as before on P26.
P6 is LED again.
BL0942 is on pins from UART, you don't need to set it.




Configuration and calibration of BL0937/BL0942
Please follow this topic:
Electrical socket with energy measurement LSPA9 - we program our own firmware
For BL0937, we just start the BL0937 driver instead of BL0942.


Summary
These were extremely budget sockets, which are extremely difficult to open, and due to the way the pins are attached, it is not possible to remove its housing without damaging it, at least I have not found such a way. Despite this, they can be easily accessed with a programmer if you cut the housing in the right place, and you can count on it to support them tuya-cloudcutter (or maybe it already does - you'd have to check).
In addition, these are another Tuya sockets that were previously described as being built on ESP and now use Beken.
One was on BK7321T and BL0937 (slightly older) and the other on BK7231N and BL0942.
LeadsI described in the content of the topic, so I think that now you have everything you need to configure these sockets.

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14403 posts with rating 12336 , helped 650 times. Been with us since 2014 year.

Comments

Kuźnia Elektronów 07 Sep 2022 23:29

I picked up a similar socket from the parcel locker today, model NAS-WR07W marked as IG007FR on the package (Type F socket, the whole cost of PLN 63.96 on a well-known auction site - smart sockets with... [Read more]

p.kaczmarek2 08 Sep 2022 07:44

Yes. Topic: https://www.elektroda.pl/rtvforum/topic3887748.html Paragraph "Uploading Your Own Load - OpenBK7231N - Part 2" initially I thought that the presence of BL0942 on the same UART as the bootloader... [Read more]

SławekSS 07 Dec 2022 11:53

great job :) And as for disassembly, there is no problem, maybe a little more difficult than the famous SP111, but it does the trick :) After unscrewing the screw under the sticker and removing the... [Read more]

p.kaczmarek2 07 Dec 2022 13:49

@slawekss can you tell me what layout you have inside (BK7231N or T and BL0937 or BL0942) and show the pin configuration? I would add this socket to the list of supported devices/templates. [Read more]

SławekSS 07 Dec 2022 14:31

BK7231N, BL0942. Board marked as NAS-WR01W6-T V7 Pins: P9-button P26-relay P6-WiFiLed I assigned the configuration the same as in the topic regarding NAS-WR01W and it worked. startDriver BL0942 took... [Read more]

p.kaczmarek2 07 Dec 2022 14:47

It looks like you want to combine WifiLED_n with regular LED. At the moment it could only be done with a script, but if you need such a function, I can just add such a pin role. Name it e.g. WiFiAndPowerLED... [Read more]

SławekSS 07 Dec 2022 15:38

that would be great if it's not a problem. That's one more question, how do I enter some startup commands? For example, start driver xxxx and this command to indicate energy measurement. I tried... [Read more]

p.kaczmarek2 07 Dec 2022 15:55

As in the tape: backlog a; b; c; Or in the Web Panel in autoexec.bat freely in LittleFS Edit: I added a hint on how to use the backlog to the page: https://obrazki.elektroda.pl/9174360100_167042... [Read more]

SławekSS 08 Dec 2022 12:18

Thanks, everything works. Now Domoticz. Is there a software-only topic to submit your comments to it? [Read more]

p.kaczmarek2 08 Dec 2022 13:08

Domoticz, what about that weird protocol with "in" and "out"? "domoticz/in"? I was just about to add this, so you could help with testing, but a bit of information on what exactly is needed with domoticz... [Read more]

SławekSS 08 Dec 2022 13:56

Yes, about this protocol. For example, Tasmota sends like this: 13:23:23.054 MQT: domoticz/in = {"idx":100,"nvalue":0,"svalue":"0.0;2062.5;0.0;0.0;0;0","Battery":100,"RSSI":4} 13:23:23.054... [Read more]

FAQ

TL;DR: Flashing NAS-WR01W/WR07W OpenBeken takes < 3 min and costs ~PLN 64 per socket; "These were extremely budget sockets" [Elektroda, p.kaczmarek2, post #20178943]

Why it matters: local firmware means private energy data, MQTT freedom and OTA updates without Tuya.

Quick Facts

• MCU: BK7231T (QN32) or BK7231N (T34) [Elektroda, p.kaczmarek2, #20178943; #20180173] • Energy chip: BL0937 (frequency) or BL0942 (UART) [Elektroda, p.kaczmarek2, post #20178943] • Programming pads: 3.3 V, GND, TX1, RX1 on PCB edge [Elektroda, p.kaczmarek2, post #20178943] • Retail price: PLN 64 – 70 (≈€13 – 15) [Elektroda, Kuźnia Elektronów, post #20180011] • Flash size: 2 MB—always back up full dump [Elektroda, p.kaczmarek2, post #20180173]

Which UART do NAS-WR07W sockets use for both BL0942 and bootloader?

UART1 handles BL0942 telemetry and the Beken bootloader, so the same TX1/RX1 pads program the MCU [Elektroda, p.kaczmarek2, post #20180173]

What firmware file and offset should I choose for each BK7231 variant?

  1. BK7231T: flash the UA file at default 0x11000 offset using bkWriter 1.60.
  2. BK7231N: flash the QIO file at offset 0x0 [Elektroda, p.kaczmarek2, post #20180173]

How can I reach the pads without destroying the glued case?

Cut a 1 × 8 mm window above the pad cluster, solder four thin wires, program, then seal with epoxy; no PCB removal needed [Elektroda, p.kaczmarek2, post #20178943]

Three-step flashing procedure (UART)

  1. Solder 3.3 V, GND, TX1, RX1 to pads.
  2. Hold BOOT pin low (or power-cycle) and run bkWriter with correct file/offset.
  3. Verify, then reboot and connect to OpenBeken AP [Elektroda, p.kaczmarek2, post #20180173]

Calibration: how do I get accurate watt-hour readings?

Start the BL0937 or BL0942 driver, feed a known 60 W load for 60 s, then adjust the Calibration Constant until reported energy equals 60 Wh / 3600 = 0.0167 kWh [Elektroda, p.kaczmarek2, post #20178943]

Flashing fails with "Unlock failed"—what causes this edge case?

A weak 3.3 V rail from USB-UART often browns out the BK7231; power MCU from a standalone LDO able to source ≥300 mA and retries usually succeed by the sixth attempt [Elektroda, SławekSS, post #20322891]

How do I recover a bricked socket after bootloader overwrite?

Enter SPI mode: pull CEN low, wire P20-P23 to RPi SPI, raise CEN, send 0xD2 × 250. Erase 0x1000-byte sectors, then write encrypted QIO firmware pages (256 bytes/page) [Elektroda, p.kaczmarek2, post #20180173]

Can one LED show both Wi-Fi status and relay state?

OpenBeken v1.12.48 adds the "WiFiAndPowerLED" role combining WifiLED_n with standard LED, blinking on disconnection and solid when relay is on [Elektroda, p.kaczmarek2, post #20323188]

How do I publish readings to Domoticz via MQTT?

Send JSON to topic domoticz/in, e.g., {"idx":100,"nvalue":0,"svalue":"0;2062.5;0;0;0;0"}. Domoticz commands arrive on domoticz/out and must be parsed to toggle POWER topic [Elektroda, SławekSS, post #20324894]

What statistic shows firmware size limits?

Each sector equals 0x1000 bytes; the full 2 MB flash contains 512 sectors, leaving ~1.8 MB usable after bootloader and OTA slots [Elektroda, p.kaczmarek2, post #20180173]
Generated by the language model.
%}