logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

BK7231N SmartPlug (Aliexpress 1005007884300347) Flashing Pinout Identification

blacksun2 1185 12
ADVERTISEMENT
  • #1 21592558
    blacksun2
    Level 8  
    Hello,

    I bought a SmartPlug from Aliexpress with metering.
    At the moment, the device is a Tuya-Device and I want to flash openbeken.
    The Device has a BK7231N Chip. The board has 6 soldering points, but these points are not named.
    The Points do not fit the BK7231N-Layout at all.

    BK7231N SmartPlug (Aliexpress 1005007884300347) Flashing Pinout Identification

    BK7231N SmartPlug (Aliexpress 1005007884300347) Flashing Pinout Identification

    BK7231N SmartPlug (Aliexpress 1005007884300347) Flashing Pinout Identification

    BK7231N SmartPlug (Aliexpress 1005007884300347) Flashing Pinout Identification

    Where do I have to connect to for flashing?

    Big thanks

    AI: Can you provide the exact model number or a link to the Aliexpress listing for your SmartPlug?
    https://de.aliexpress.com/item/1005007884300347.html
  • ADVERTISEMENT
  • #2 21592984
    max4elektroda
    Level 24  
    If I interpret the pictures correctly, you need to use Pins 26 and 27 (26=P10=RX / 27=P11=TX).
    They seem connected to the two pads below the quartz.

    You need to connect RX of chip to TX of your serial and TX of chip to RX of your serial.

    Either have a powerful 3.3V power supply or you can try if the device works, if you connect a power supply of 12V or 15V directly to the mains contact (so instead of using high voltage like 230V try if it works with a much lower voltage).
    In almost all devices the 3.3V or GND of the board is connected to one of the mains contacts, so never connect serial if it's connected to live power!


    BK7231N SmartPlug (Aliexpress 1005007884300347) Flashing Pinout Identification

    Hope this one is readable:
    BK7231N SmartPlug (Aliexpress 1005007884300347) Flashing Pinout Identification
  • ADVERTISEMENT
  • #3 21593130
    blacksun2
    Level 8  
    >>21592984

    du meinst ich soll über die Stecker, die in die Steckdose kommen, 12V Gleichstrom anlegen? Das soll funktionieren?
    Ist es dann egal, ob welcher Stab + und - reingehen?

    Was mir dann aber immer noch fehlt, das ist der Reset-PIN
  • #4 21593188
    max4elektroda
    Level 24  
    Genau, irgendein Netzteil mit ungefährlicher Spannung, je höher desto besser. Da der Stecker für Wechselspannung ist, ist es bei einer Gleichspannug egal, wie die angeschlossen wird. Ist auch nicht gesagt, dass es funktioniert, aber bei einigen meiner Steckdosen funktioniert das problemlos.
    CEN ist der vierte von oben rechts, da ist auch ein Pad zu sehen, etwas links unterhalb des RX Pad, direkt neben den zwei SMD Bauteilen.


    BK7231N SmartPlug (Aliexpress 1005007884300347) Flashing Pinout Identification

    Da wir hier im Internationalen Bereich sind:
    Exactly, no guarantee it works, but I have several plugs that work that way, i usually use an old 19V Laptop power supply.
    Since the plug is working with AC, polarity doesn't matter.
    The CEN pin is the 4th pin from top on the right in your picture, near to the two smd parts.
  • #5 21594329
    blacksun2
    Level 8  
    >>21593188
    ich hab mal ein 600Watt-Netzteil rausgesucht mit dem ich eine 12V-Pumpe betrieben habe. Die blaue LED ist tatsächlich angegangen.
    sich per Netzwerk verbunden hat sich die Steckdose aber nicht. Vielleicht war es zu wenig Spannung.
    Auf RX und TX war nichts zu erreichen.
    Wie merke ich, ob es funktioniert?
  • #6 21594354
    max4elektroda
    Level 24  
    Vielleicht reichen die 12 V nicht. Das Gerät sollte damit normal arbeiten, wie in der Steckdose: entweder meldet es sich im WLAN an, oder arbeitet als Access-Point. Leuchtet die LED normal hell oder funzelt die nur leicht?
    Es gibt auch eine log Schnittstelle, das ist aber der Kontakt oben, der nicht verbunden scheint. Du brauchst dann einen Nadelkontakt, um das abzugreifen.
    Wenn es nicht funktioniert, könntes du eine höhere Spannung verwenden, falls du ein anderes Netzteil hast.
    Ansonsten musst du direkt die 3.3 V anschließen. Dafür benötigst du zum einen ein gutes Netzteil und solltes vielleicht noch ein paar mehr Detailfotos hochladen, damit man den Spannungswandler findet oder zumindest Punkte, wo man die Spannung gut einspeisen kann.

    Maybe 12V are simply not enough for your plug.
    It should work like usual, connect to your network or act as an access point. Is the led fully on or just glowing?
    You should also be able to see serial logs, but TX for the logs is the unconnected pin in the upper row, so you would need to connect it per needle to see output.
    If you don't see the plug in your network, you might try a higher voltage, maybe you have another power supply?
    If not, you will need to power the 3.3 rail, maybe some more detailed pictures can identify the power chip to find a good place to connect it.
  • ADVERTISEMENT
  • #7 21595264
    blacksun2
    Level 8  
    >>21594354
    Dein Tipp mit dem Laptop-Netzteil war gut. Ich hab ein altes FSC-Laptopnetzteil genommen, den Stecker abgeschnitten und Klemmen dran gemacht. Das Netzteil macht 19V.
    Damit fährt der Chip soweit hoch, dass er im Netzwerk per Ping erreichbar ist

    Am Laptop steckt am USB-Anschluss ein CP2102. Ich habe das doch richtig verstanden, dass ich damit nur RX und TX verbinde, oder (natürlich RX-TX und TX-RX)? Laptop ist Win10. Flashtool ist BK7231Flasher.exe
    Wenn ich den CEN-Pin mit Minus aus dem Netzteil verbinde, dann kommt kein Ping mehr zurück, zumindest solange die Verbindung CEN-Minus besteht.

    Das Flashtool versucht ja in 100 Anläufen eine Verbindung aufzubauen. Baud-Rate hab ich auf 115200 gesetzt. COM-Port passt auch. RX und TX sind beim Einstecken des Netzteils mit den RX und TX-Pins verbunden. Dennoch kommt keine Verbindung zustande.
    Testweise RX und TX tauschen hab ich auch versucht.

    Ich mach doch da bestimmt was falsch, oder?
  • #8 21595298
    max4elektroda
    Level 24  
    Du brauchst drei Verbindungen an der seriellen Schnittstelle: RX, TX und GND.
    Ich würde nicht das Netzteil Minus nehmen, je nach Situation könnten da Null oder 19V (oder welche Spannung das Netzteil hat) gegenüber dem Potenzial des Chips anliegen.
    Suche eine große Masse-Fläche auf der Platine in der Nähe des Chips, z.b. die größere Fläche unter den RX und TX Pins, wo die beiden SMD Teile angeschlossen sind. Messe die Spannung zwischen dem und CEN, die sollte bei etwa 3.3V sein (natürlich kannst du zur Not auch so sicherstellen, ob zwischen dem CEN und dem Netzteil Minus diese Spannung anliegt und deine Versuche legen das ja nahe, dass es passt, wenn der Ping bei Verbindung mit CEN weg ist und später wiederkommt).
    Mit den drei Verbindungen GND, RX und TX sollte es klappen.

    You will need GND, RX and TX, so find a GND pad on the board. Usually a bigger copper area, e.g. the one below RX TX where the two SMD parts are connected.
    Just check voltage between this pad and CEN, should be 3.3V approximately. You might also check against GND of the power supply, just make sure you don't have 19V or so, the chip would die from that voltage!
  • ADVERTISEMENT
  • #9 21595997
    blacksun2
    Level 8  
    max4elektroda wrote:
    z.b. die größere Fläche unter den RX und TX Pins, wo die beiden SMD Teile angeschlossen sind.


    welche Stelle meinst du genau? Die Kontakte von den SMD?
    mal blöd gefragt, brauche ich den CEN überhaupt zum Flashen? Tut es bei den Beken-Chips nicht auch ein Neustart, indem ich die Spannung wegnehme und dann wieder anlege?
  • #10 21596041
    max4elektroda
    Level 24  
    Ich hoffe, es wird klar:
    BK7231N SmartPlug (Aliexpress 1005007884300347) Flashing Pinout Identification
    weiß nicht, ob Spannung wegnehmen hier reicht, weil das ja nicht die Spannung am Chip ist, sondern noch Spannungswandler und Kondensatoren dahinter liegen, so dass die Spannung noch etwas länger anliegt, wenn du das Netzteil wegnimmtst
  • #11 21599325
    blacksun2
    Level 8  
    >>21596041

    nach vielen Versuchen hat es nun geklappt. Jetzt weiß ich, was du gemeint hast. Man muss zusätzlich noch GND vom USB-to-TTL anlegen, zusätzlich zu den Stiften, an denen das 19V-Netzteil hängt.
    Und mit einem weiteren GND vom USB-to-TTL muss man dann kurz den CEN antippen, damit ein Reboot ausgelöst wird.

    Ich habe von dem Chip mit dem Flashing-Tool ein Backup gezogen. Aus diesem Backup konnte das Tool aber keine PIN-Belegung extrahieren. Es hieß:
    "Sorry, no meaningful pins data found. This device may be TuyaMCU or a custom one with no Tuya config data.
    No module information found.
    And the Tuya section starts, as usual, at 2023424"

    Warum ist das so?
    Aus einer anderen smarten Steckdose mit einem BK7231N konnte das Flashtool die PIN-Belegung extrahieren. Da war, glaube ich, der BK7231N auf einer eigenen Platine, die dann senkrecht in die Hauptplatine eingelötet war.
    Wie komme ich nun an die Belegung?

    Hier das Backup-File:


    Vielen Dank.
    Attachments:
    • readResult_BK7231N_QIO_2025-06-7-16-08-10.bin (2 MB) You must be logged in to download this attachment.
  • #12 21599423
    divadiow
    Level 38  
    In the event EF cannot extract config it'll be a case of checking the boot log to see if it's helpfully printed at startup, GPIO doctor trial/error, multimeter tracing or following traces from BK7231N pins on a hi-res image, or trying templates from device list. Or a combination of these things. Here is boot log from your dump

    Code: Text
    Log in, to see the code


    Code: Text
    Log in, to see the code


    which means:

    Code: Text
    Log in, to see the code


    Added after 3 [minutes]:

    divadiow wrote:
    or trying templates from device list

    there are at least 2 other devices in device list with this template. eg https://www.elektroda.com/rtvforum/topic4058389.html
  • #13 21599640
    blacksun2
    Level 8  
    divadiow wrote:
    In the event EF cannot extract config it'll be a case of checking the boot log to see if it's helpfully printed at startup

    Code: Text
    Log in, to see the code


    Wow, I'm really amazed at how you did that.
    Thank you so much for your help.
    How do you record the Tuya boot? How did you get to the log with the Tuya firmware?

Topic summary

✨ The discussion focuses on identifying the flashing pinout for a BK7231N-based SmartPlug purchased from Aliexpress (listing 1005007884300347) originally running Tuya firmware, with the goal to flash OpenBeken. The device's PCB has six unlabeled solder points that do not match the standard BK7231N layout. Analysis of provided images suggests that pins 26 (P10/RX) and 27 (P11/TX) correspond to the two pads below the quartz crystal and should be used for serial communication, connecting chip RX to serial TX and chip TX to serial RX. Powering the device safely for flashing is critical; it is recommended to use a low DC voltage supply (e.g., 12V or 15V) applied to the mains input pins instead of the standard 230V AC to avoid hazards. Polarity is not critical due to the AC design. The CEN (reset) pin is identified as the fourth pin from the top on the right side near two SMD components, which may be used for resetting during flashing. Users report that 12V DC may be insufficient to fully power the device for network operation or serial output, suggesting a higher voltage or direct 3.3V supply might be necessary. Serial log output may be accessible via an unconnected top contact requiring a needle probe. Additional detailed photos of the voltage regulator and power input area are recommended to locate suitable 3.3V and GND points for stable flashing power.

FAQ

TL;DR: To flash this BK7231N SmartPlug, use 3 wires (GND, RX, TX) and briefly short CEN to GND; “You will need GND, RX and TX.” Verify ~3.3 V between CEN and board GND. [Elektroda, max4elektroda, post #21595298]

Why it matters: This FAQ helps DIY tinkerers safely find UART/Reset, power the board for flashing, and recover GPIO roles for OpenBeken.

Quick Facts

What’s the UART pinout on this BK7231N SmartPlug?

Use P10 as RX (chip receives) and P11 as TX (chip transmits). They map to pins 26 and 27. On this board, they route to two pads just below the crystal. Cross-connect: chip RX to adapter TX, chip TX to adapter RX. [Elektroda, max4elektroda, post #21592984]

Do I really need to connect GND with RX/TX?

Yes. You need three connections: GND, RX, and TX. Use a board GND pad, not the PSU minus. Verify about 3.3 V between CEN and that GND to confirm the reference. “You will need GND, RX and TX.” [Elektroda, max4elektroda, post #21595298]

Where is CEN (reset) and how do I use it for flashing?

CEN is the fourth pad from the top on the right side near two small SMD parts. Briefly short CEN to board GND to force a reboot when your flasher is waiting. This avoids relying on slow power rail discharge. [Elektroda, max4elektroda, post #21593188]

Can I power the board with DC through the mains blades for flashing?

Yes. Injecting about 19 V DC across the plug blades can power the low-voltage supply. Polarity does not matter when feeding DC through the AC plug. It is not guaranteed on every unit, but it often works. [Elektroda, max4elektroda, post #21593188]

12 V DC didn’t boot my plug—what should I check?

12 V may be insufficient for your plug’s PSU. Symptom: the LED glows, but Wi‑Fi does not start. Try a higher DC voltage, like a 19 V laptop supply. You can also read serial logs via the unconnected TX pad using a needle. [Elektroda, max4elektroda, post #21594354]

BK7231Flasher keeps retrying 100 times—what fixes it?

Tie your USB‑UART GND to the board GND, not to the external PSU minus. Then momentarily short CEN to that UART GND to trigger a boot while the flasher waits. This resolved connection failures. [Elektroda, blacksun2, post #21599325]

Why didn’t the flasher extract a GPIO template from the backup?

Some Tuya firmwares store config differently or behind TuyaMCU. When extraction fails, use boot logs, the GPIO doctor, board tracing, or known templates as fallbacks. “Check the boot log.” [Elektroda, divadiow, post #21599423]

What GPIO template should I use in OpenBeken for this AliExpress plug?

From the Tuya boot log: 6=BL0937CF;0, 7=BL0937CF1;0, 8=Rel;1, 23=WifiLED_n;0, 24=Btn;1, 26=BL0937SEL;0. These map energy IC pins, relay, LED, and button. [Elektroda, divadiow, post #21599423]

How do I capture the Tuya boot log on this board?

  • How-To (3 steps):
    1. Locate the unconnected TX pad in the upper row.
    2. Touch it with a needle probe wired to your adapter RX, and tie adapter GND to board GND.
    3. Power the plug and reset; read the stream in a serial terminal. [Elektroda, max4elektroda, post #21594354]

Is power-cycling enough to enter flash mode?

Not always. The regulator and capacitors can hold the rail, so the chip does not reset quickly. Use CEN to force a clean reboot when starting the flash procedure. [Elektroda, max4elektroda, post #21596041]

Is it safe to connect serial when the device is on mains AC?

No. The 3.3 V or GND often ties to a mains conductor in these non‑isolated supplies. Never connect UART when the plug is powered from live AC. Disconnect AC or use safe DC injection first. [Elektroda, max4elektroda, post #21592984]

What module and firmware does this plug report in logs?

Boot log shows module CB2S with BK7231N, firmware compiled Jun 13, 2023. It also prints a heap size of 126000 bytes at init, indicating memory headroom during boot. [Elektroda, divadiow, post #21599423]

Which tools and adapters were used successfully here?

A CP2102 USB‑to‑UART on Windows 10 with BK7231Flasher.exe was used. Pair this with proper GND tying and a CEN pulse. The user initially set 115200 baud in the tool. [Elektroda, blacksun2, post #21595264]

Where exactly is the TX log pad if it isn’t wired to a header?

It is an unconnected pad in the upper row on this board revision. Use a spring needle or fine probe to contact it while powering and resetting to capture logs. [Elektroda, max4elektroda, post #21594354]
ADVERTISEMENT