logo elektroda
logo elektroda
X
logo elektroda

Identifying SM-039 (BL602) Module in Woolley (Sonoff/Ewelink) SA-032 Smart Plug with BL0937

divadiow 1683 20
Best answers

Do OpenBK7231T pin numbers on a BL602 module map directly to the BL602 GPIO numbers, for example is OBK P0 the same as GPIO0 and package pin 1?

Yes: on BL602, OBK pin numbers are the internal BL602 pin numbers, with no aliases, so OBK P0 maps directly to GPIO0, P1 to GPIO1, and so on [#21127184] The pins are manipulated using those internal numbers in the BL602 HAL code, so your tracing should follow the chip’s native GPIO numbering [#21127184] This direct 1:1 mapping is specific to BL602; other platforms may use a lookup table and artificial OBK pin numbers instead [#21127184]
Generated by the language model.
ADVERTISEMENT
  • Helpful post
    #1 21126246
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    Sometimes I look for user-posted pictures of IoT devices on Ali Express in the off-chance they've included an internal shot that reveals a module I do not have or one I've never seen before. This was the case for a South American smart plug - Woolley SA-032 - Ewelink/Sonoff/ITEAD origin device.

    https://vi.aliexpress.com/item/1005005782675033.html

    Advertisement for the Woolley SA-032 smart plug on AliExpress.

    I've scoured the internet for mention of the SM-039 inside, but there is nothing so far. It looks like it could be a Trolink SM-xx device, but they say their only BL602 modules are SDV-002 and SM-028. I've not heard back from Ewelink/Sonoff yet.

    This is the SM-039 and I attach a dump taken from BLDevCube 1.8.9
    SM-039 WiFi module with PCB markings. IoT module with visible electronic components and a BL602 chip on a blue background.

    uart boot:

    Code: Text
    Log in, to see the code


    The module in-situ and the device/packaging:

    White smart plug lying on a blue surface. Photo of the underside of a smart plug model SA-032 with visible technical specifications. Smart plug packaging with QR code to download eWeLink app. Photo of Woolley SA-032 smart plug packaging with manufacturer information. White packaging of the SA-032 smart plug with specifications. Box with the label SA-032 Type N. Box of a Wi-Fi smart plug supporting Google and Alexa on a blue background. Close-up of a relay on the circuit board of an IoT device. Close-up of the interior of an IoT module with visible components and connectors. Close-up of the BL602 module inside an IoT device. SM-039 WiFi module with markings on a green circuit board. Close-up of an electronic circuit board with components labeled as BR205_BL_BK_V1.2.

    The power monitoring chip is a standard BL0937. There are two LEDs but with OBK finder I can only light one, a blue one. The second LED does light when probed with a multimeter. I've done a lot of tracing but some of the module pads remain a mystery, not helped by resistors being in the way of paths, my lack of a decent magnifying glass and the width of the end of my multimeter probes.

    definitely a work in progress. Text is mostly scribbles about possibilities/unsureness.

    BL602 module on PCB with pins and schematic
    SM-039 WiFi module with labeled connectors.

    The only 100% knowns are VCC and GND.

    The silk-screen number prints of 1, 11, 0 (or 9) and 12 (or 2) don't seem to correlate to where I am tracing them to on the BL602 chip.

    I have flashed with OBK and these are known:

    "0": "Btn",
    "1": "WifiLED", - Blue LED "LED1"
    "12": "Rel"

    I guess my question is, for the BL602 please confirm P# in OBK map to GPIO# on BL602

    eg OBK P0 = GPIO0 = Pin 1 of IC ?

    I ask because I'm just not seeing this map through when tracing with multimeter, though that could be because of the reasons given above.

    On a different note, here are some semi-interesting bits in the binary seen in HxD, though I'm unsure if they're general SDK mentions or actual config for this device

    cse7759 chip exist...cse7759b_uart_timer.cse7759bProcess.[%10u][%s: %s:%4d] cse7759b init OK (there's no mention of BL0937)

    A bunch of AT commands

    Code: Text
    Log in, to see the code


    mentions of the module, GPIOs, blinky LEDs and button presses

    Code: Text
    Log in, to see the code


    but maybe that's just from the SDK/dts https://github.com/bouffalolab/BLOpenFlasher/...device_tree/bl_factory_params_IoTKitA_40M.dts
    Attachments:
    • flash.bin (2 MB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • Helpful post
    #2 21127184
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    I dont' see that shape of socket very often. It reminds me mostly of the old sockets, it's suprising to see it used now.

    The BL602 pin naming is very simple, you can see here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/hal/bl602/hal_pins_bl602.c
    There are no aliases, so internal pin numbers are used:
    Code: C / C++
    Log in, to see the code

    So that's how are pins manipulated:
    Code: C / C++
    Log in, to see the code

    It's simple as that on BL602. Still, keep in mind that it may be different for different platforms. On W800, for example, we have a lookup table to map artificial OBK pin numbers to W800/W600 ports and bits:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/hal/w800/hal_pins_w800.c
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21128204
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    Sonoff support have replied to say the datasheet contains proprietary information so they will not supply. At least that confirms it's theirs.

    I've asked them to supply what they can.
  • #4 21131462
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    on a slightly different note, it is curious how the factory firmware was fine booting on my external PSU (up to 5A available to connected devices) but with OBK it will boot loop unless it's plugged into the mains. Could there be something specific to OBK/old SDK that causes BL602 to be weird with power when running OBK?
  • #5 21131465
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    Measure current usage. They may have enabled powersave 1 by default. I could do it too, but I am not sure - I still remember those few strange reports about PowerSave breaking stuff. I know for certain that it breaks BL0937 and IR, but maybe there is more.
    Helpful post? Buy me a coffee.
  • #6 21131724
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    hmm. I don't really have a sensitive enough way to measure the module only. The XL4015 I'm using doesn't even register any current, which is unusual because it *does* register current for devices that draw less and do work fine.

    Anyway, this BL602 just reboots continuously at this point at uart output "Start Wi-Fi fw @99ms"

    I guess this is before powersave 1 can kick in, which is now set in startup command before I desoldered it again.

    Console display showing GPIO configuration errors and a romfs issue for BL602.

    Added after 55 [seconds]:

    I must have a load of AMS1117-3.3 I can make another ext PSU from to try.

    Added after 4 [minutes]:

    still doesn't make sense because the BL602 should be free to draw up to 1.5A (the cut-off I have set right now) from the XL4015

    Added after 34 [minutes]:

    forgot I had the lolin in my bits box. easy.

    Lolin module and green PCB board connected with wires on a blue mat.

    well it boots now. but has rebooted because of Reboot reason: BL_RST_POWER_OFF

    fine. now I get on with attaching LEDs to work out the GPIOs properly.
  • Helpful post
    #7 21131810
    miegapele
    Level 16  
    Posts: 173
    Help: 15
    Rate: 29
    Flimsy wires is most likely the issue. I noticed the same while dealing with bl602. It looks sensible to voltage drops. And that's why it works fine powered from original source.
    You can make your wires better, or increase voltage to 3.6v and it should be fine
  • ADVERTISEMENT
  • #9 21131835
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    maybe connecting 100nF capacitor between GND and VDD on the BL602 module itself can help it working while keeping wires long?
    Helpful post? Buy me a coffee.
  • #10 21132126
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    interesting. no wonder I was getting confused/frustrated. there appears to be two P1s. yes, test LEDs on both light when toggling P1 high

    Screenshot of GPIO Doctor Pins interface with settings for P0 and P1.

    Close-up of an electronic module with visible components on a green circuit board. SM-039 WiFi module board with visible connector labels.





    The unknowns do not light an LED or even blip the multimeter toggling any of the 3 IO doctor buttons
  • #11 21132174
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    Are unknown connected anywhere?
    Helpful post? Buy me a coffee.
  • #12 21132459
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    well, they do. I had traced the BL0937 CF, EL, CF1 and had made notes in pics above. There also appears to be two P12s. There's continuity between the yellow P12 label and the red dots right to the BL602 GPIO12 pin.

    Weird. Or is there a plausible explanation?

    Electronic board with an integrated circuit and pin labels P1 and P12.
  • #13 21132878
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    This is very strange. Maybe you could peel of some of the soldermask to investigate the tracks futher. I'd rather expect to find a short somewhere, but you've posted full photos of board and I see nothing like that...
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #14 21132884
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    indeed. Im hoping two more devices with same module will arrive soon. If they do, I wouldn't mind destroying this one just to find out. It's entirely possible I've damaged it, though it does still work.

    I could do with an acid bath or something remove top layer of protection.

    Added after 1 [hours] 53 [minutes]:

    >>21132459

    they looked connected to me
    Close-up of a printed circuit board with an integrated circuit and other electronic components.
  • #15 21133100
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    By the way, what is that 09 part doing? Is this a transistor? How is it connected?
    Helpful post? Buy me a coffee.
  • #17 21133132
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    UM809RS ?
    Page of a Union Semiconductor document describing the UM809/810 microprocessor reset circuits.
    Top view of UM809/810 IC with pin configurations.
    Block diagram and typical connection circuit of the UM809/810 reset circuit
    Does the connection match?
    Helpful post? Buy me a coffee.
  • #18 21133148
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    yes, continuity between 09R GND and module GND, same for VCC to module VCC. reset leg goes to CEN

    Circuit board with an integrated circuit and electronic components along with a connection diagram.
  • Helpful post
    #19 21133154
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    This is both very interesting and very strange. Why would they randomly start using UM809RS (power supervisor) in this particular WiFi module?

    By the way, having this UM809RS chip on the board of Beken battery-powered sensors, may be a good way to prevent them breaking themselves while battery discharges.
    Helpful post? Buy me a coffee.
  • #20 21133163
    divadiow
    Level 38  
    Posts: 4839
    Help: 420
    Rate: 852
    that I do not know. I'm trying every angle to get a datasheet but it seems something is a secret about this module.
  • #21 21133171
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    It reminds me of old industrial circuits that I sometimes check out in my teardowns. They often have voltage supervisor circuits next to their 8051 MCUs.
    Here's a sample one: https://www.elektroda.pl/rtvforum/topic3917123.html
    Helpful post? Buy me a coffee.

Topic summary

✨ The discussion revolves around identifying the SM-039 module within the Woolley SA-032 smart plug, which is associated with Ewelink/Sonoff/ITEAD. The user is seeking information about the module, suspecting it may be a Trolink device, but has found no documentation confirming this. Responses include insights on the BL602 module's pin configuration, issues with power supply when using different firmware, and suggestions for troubleshooting, such as measuring current usage and improving wire connections to reduce voltage drops. The conversation also touches on the presence of an UM809RS power supervisor chip on the board, raising questions about its purpose in the design. The user expresses frustration over the lack of available datasheets and proprietary information from Sonoff.
Generated by the language model.

FAQ

TL;DR: BL602-based SM‑039 modules can reboot on bench power; raising supply to 3.6 V helps, and “Flimsy wires is most likely the issue.” This FAQ compiles fixes, pin mapping, and identification for the Woolley SA‑032 smart plug. [Elektroda, miegapele, post #21131810]

Why it matters: It helps makers flash OBK, map GPIOs, and stabilize SA‑032 hardware without vendor docs.

Quick Facts

What exactly is the SM‑039 module in the SA‑032 plug?

SA‑032 contains an SM‑039 Wi‑Fi module branded by Sonoff/Ewelink and built around a Bouffalo BL602. The board also integrates a BL0937 power-monitor IC and two LEDs. The OP confirmed blue LED control after flashing OpenBK (OBK). Photos and a firmware dump support the identification. [Elektroda, divadiow, post #21126246]

Does OBK P# equal BL602 GPIO# on this module?

Yes. On BL602, OBK uses the raw GPIO index with no aliasing. So P0 maps to BL602 GPIO0, P1 to GPIO1, and so on. The HAL functions call blgpio* with the same index you set in OBK. This simplifies tracing because OBK numbers match BL602 GPIO numbers directly. [Elektroda, p.kaczmarek2, post #21127184]

How do I discover LED and relay GPIOs on SM‑039 using OBK?

Use OBK’s I/O tools to toggle pins and watch LEDs/relay. On the examined unit, P0 acted as Button, P1 drove the blue Wi‑Fi LED, and P12 controlled the relay. Unknown pads that do not toggle may be tied to metering lines or unconnected. Document findings as you go. [Elektroda, divadiow, post #21126246]

Why do two pads labeled P1 or P12 both respond when I toggle one pin?

They are likely the same net exposed at multiple pads or test points. The OP measured continuity between two P12-labeled spots and BL602 GPIO12, explaining mirrored behavior. Duplicate labels can reflect layout convenience rather than distinct signals. Confirm with continuity testing before assuming separate functions. [Elektroda, divadiow, post #21132459]

How can I verify unexpected shorts or net ties on this board?

Inspect and, if needed, carefully expose tracks by removing a bit of soldermask to follow traces. A short or net tie can make two pads act as one. High-resolution photos and continuity checks help, but lifting soldermask clarifies ambiguous routes. Proceed slowly to avoid damage. [Elektroda, p.kaczmarek2, post #21132878]

How do I stop BL602 reboot loops on a bench supply?

Voltage drop on thin or long leads is the common cause. Try this:
  1. Use short, thick power wires and solid ground.
  2. Raise module supply to 3.6 V while monitoring stability.
  3. Re-test boot and Wi‑Fi initialization. “Flimsy wires is most likely the issue.” [Elektroda, miegapele, post #21131810]

Should I add a decoupling capacitor at the module when using long wires?

Yes. Solder a 100 nF capacitor directly across the module’s VDD and GND. This local bypass helps the BL602 ride out fast transients from lead inductance and reduces brownout resets. Place it as close as possible to the module pins for best effect. [Elektroda, p.kaczmarek2, post #21131835]

Why does factory firmware boot from bench PSU while OBK reboots?

Power mode and timing differ. Measure current and verify supply stability under Wi‑Fi startup. “They may have enabled powersave 1 by default.” Some power-saving interactions have been reported to disrupt peripherals like the BL0937 and IR. Stabilize power first, then adjust firmware settings. [Elektroda, p.kaczmarek2, post #21131465]

Should I enable PowerSave when using BL0937 on BL602?

No. Keep PowerSave off with BL0937 metering attached. As the maintainer noted, “I know for certain that it breaks BL0937 and IR.” Disable it in OBK until you confirm stable operation, then test cautiously if needed. [Elektroda, p.kaczmarek2, post #21131465]

What is the “09R” chip near the module?

It appears to be a UM809RS voltage supervisor. This device monitors VCC and asserts reset if the supply sags, improving brownout behavior. The identification was proposed during analysis and matches typical usage near MCU reset lines. [Elektroda, p.kaczmarek2, post #21133132]

How is that supervisor wired on this board?

Continuity checks showed the supervisor’s GND to module GND, VCC to module VCC, and the reset leg routed to the module’s CEN (chip enable/reset) pin. That wiring aligns with expected brownout reset implementation. [Elektroda, divadiow, post #21133148]

What did the UART logs show during boot?

Logs displayed “Start Wi‑Fi fw @99ms.” Later bench-power tests showed reboots with “Reboot reason: BL_RST_POWER_OFF.” The OP’s bench supply had a 1.5 A cutoff, yet instability persisted until power integrity was improved. Use these markers to time investigations and confirm fixes. [Elektroda, divadiow, post #21131724]

Are there AT commands in the stock firmware? Which ones?

Yes. The binary contained strings for AT diagnostics and control, including AT+FACTORY_VER?, AT+FW_VER?, AT+SDK_VER?, AT+BUILDTIME?, AT+GPIO*, AT+WIFI_RSSI?, AT+PIN_CONFIG=, and licensing commands. The dump also showed GPIO and button handling strings. Use them only if you keep stock firmware. [Elektroda, divadiow, post #21126246]

Is a datasheet available for the SM‑039 module?

Sonoff support stated the datasheet contains proprietary information and declined to share it. That confirms vendor ownership but limits official documentation availability. Request partial information if you need specific electrical details for integration. [Elektroda, divadiow, post #21128204]

How do OBK pin mappings differ on W800 vs BL602?

BL602 uses direct GPIO indexing in OBK with no aliases. W800/W600 platforms use a lookup table to translate OBK pin numbers to ports/bits. Expect 1:1 mapping on BL602, but a mapping layer on W800. Adjust configs accordingly when porting. [Elektroda, p.kaczmarek2, post #21127184]

Why would a Wi‑Fi module include a voltage supervisor?

Reliability under marginal power or battery discharge. A supervisor enforces clean resets instead of lockups during sags. As noted, using such a chip “may be a good way to prevent them breaking themselves while battery discharges.” It’s unusual on modules but beneficial. [Elektroda, p.kaczmarek2, post #21133154]
Generated by the language model.
ADVERTISEMENT