logo elektroda
logo elektroda
X
logo elektroda

BK7231N Sber Smart Relay SBDV-00050 Pin Assignment and Teardown

tehb13 1818 29
ADVERTISEMENT
  • Helpful post
    #1 21278069
    tehb13
    Level 3  
    Posts: 5
    Help: 1
    Rate: 1

    Packaging of the SBER smart relay with text Salut! This is a smart relay and specification 1 channel, 3.68 kW.

    SBER smart relay device with technical specifications

    Close-up of a printed circuit board featuring an AFE BPD-S104SDM relay and other electronic components on a gray background.

    Circuit board with integrated circuits and electronic components.

    Close-up of an electronic module with pin markings and an antenna.

    Blue PCB with pin labels and a logo at the top.

    AFE BPD-SS-105DM relay module with coils and capacitors.

    Electronic module on a gray background with visible components and connectors.


    PINAssignment
    ADC3
    P8Switch
    P24
    P16Button
    P7
    TX1
    GNDGND


    PINAssignment
    EN
    P9RELAY
    P6
    P14
    P26LED
    RX1
    VD0 3.3v
  • ADVERTISEMENT
  • #2 21278275
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    Cool. What are your plans for this device regarding the firmware?
  • ADVERTISEMENT
  • Helpful post
    #3 21278408
    kuba2k2
    Level 13  
    Posts: 120
    Help: 1
    Rate: 13
    Encryption keys for ESPHome:
    Code: YAML
    Log in, to see the code
  • #4 21278547
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    interesting module. doesn't seem these are for sale outside of Russia/Kazakhstan though :(
  • #5 21279094
    tehb13
    Level 3  
    Posts: 5
    Help: 1
    Rate: 1
    >>21278408
    Error message regarding a failed erase operation with flash protection.
  • #7 21279490
    insmod
    Level 31  
    Posts: 1397
    Help: 164
    Rate: 436
    >>21279480 If erased without backup, then the original bootloader is lost - guaranteed brick. Or then separating the bootloader from backup image, and flashing just it. Alongside losing RF partition.
    >>21279094 Besides, there is no need to flash a full image, just flashing ota package is enough. Bootloader will then update the firmware. In my case on a different device - bkcrypt_coeff is probably wrong - flashing didn't work. But writing rbl at ota address, and subsequent updates from esphome works ok.
  • #8 21279522
    tehb13
    Level 3  
    Posts: 5
    Help: 1
    Rate: 1
    I flashed the backup. The device works.
    I got this error when flashing the sbdv-00050-ota.rbl
    When flashing sbdv-00050.uf2, no errors occur, but the device does not work, as well as without adding:
    Code: YAML
    Log in, to see the code
  • #9 21279537
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    insmod wrote:
    If erased without backup, then the original bootloader is lost - guaranteed brick. Or then separating the bootloader from backup image, and flashing just it. Alongside losing RF partition.

    yes, I should have been clearer. The user has posted a backup on Github. BKFIL can be used to erase/flash specific address areas in flash.
  • #10 21280204
    insmod
    Level 31  
    Posts: 1397
    Help: 164
    Rate: 436
    >>21279522 At what address did you flash sbdv-00050-ota.rbl?
    Try to get uart1 connected, if bootloader version is something like 1.0.13, then it will print what is wrong with OTA package (like wrong enc keys).
    You can also erase main firmware (for first attempt - 0x10000 to 0x12000) after flashing OTA. Maybe it will work then.
  • #11 21284726
    tehb13
    Level 3  
    Posts: 5
    Help: 1
    Rate: 1
    BK7231n_1.0.8
    CPSR:0x000000D3
    R0:0x00800000
    R1:0x00000000
    R2:0x005AA000
    R3:0x00000006
    R4:0x00400001
    R13:0x00401C1C
    R14(LR):0x000033AC
    ST:0x00000000
    [I/FAL] Fal(V0.4.0)success
    [I/OTA] RT-Thread OTA package(V0.2.4) initialize success.
    
    go os_addr(0x10000)..........


    the device can be pinged, but it doesn't have a web interface and doesn't connect to homeassistant.
    please write step-by-step instructions on which files to flash to which addresses

    Spoiler:

    Code: YAML
    Log in, to see the code

  • #12 21284776
    insmod
    Level 31  
    Posts: 1397
    Help: 164
    Rate: 436
    >>21284726 If you are using ltchiptool, then choose rbl and just flash it, it should be autodetected as beken ota image with 0x132000 address.
    Btw, you are missing a "+" sign in board_flash.download, it should be "0x132000+0xCC000"
    And please add log to esphome configuration, it will be easier to debug. And maybe enable api encryption?
    Also, what esphome version are you using? In the OTA config in the latest versions you need to select the platform (just esphome for now) like that
    
    ota:
      - platform: esphome
        password: !secret ota_password
    
  • ADVERTISEMENT
  • #13 21284811
    tehb13
    Level 3  
    Posts: 5
    Help: 1
    Rate: 1
    I have not lost the plus symbol in yaml. This probably happened when publishing the post
    Screenshot of a YAML file named sbdv-00050.yaml with a configuration for esphome.

    When I try to flash sbdv-00050-ota.rbl via ltchiptool, over the factory, I get an error
    Error displayed during an attempt to flash a file using ltchiptool

    BKFIL flashes it without an error.

    logs_sbdv-..050.txt (40.54 kB)You must be logged in to download this attachment.
  • #14 21284826
    insmod
    Level 31  
    Posts: 1397
    Help: 164
    Rate: 436
    >>21284811 Considering there is no log after go os_addr(0x10000), then it probably flashed successfully. Now try reflash backup, then flash new ota image with logging enabled.
    Your esphome version is rather old, 2024.4.1. But nothing much should have changed for beken, so updating is probably unnecessary.
  • #15 21912527
    lesder1986
    Level 4  
    Posts: 7
    Hello everyone. I also have a problem with this relay. I took a dump in the "M" mode. Then I flashed different firmware, but it didn't work out. I tried to return the dump, it doesn't work either. The LED does not light up when turned on. I've tried different programs. And I inserted the code above into yaml and compiled the firmware in esphome, but it still doesn't work. There were no firmware errors.

    
    Code: YAML
    Log in, to see the code

    
  • #16 21912674
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    open your backup in this tab in Easy Flasher and try to find keys. if the backup is mostly OK maybe it will come back with the same key as below?

    Screenshot of BK7231 Easy UART Flasher showing partitions table and found decryption keys

    if it's the same key then the bootloader attached (flashed to 0x0) should boot (no OBK AP will broadcast) and you'll see the bootloader log if you're watching TX debug with a terminal.
    Attachments:
    • bootloader_1.0.1_D34FBDD3_EFCBEADE_FD97BBFF_C7BFFF3B.bin (62.19 KB) You must be logged in to download this attachment.
  • #17 21914774
    lesder1986
    Level 4  
    Posts: 7
    divadiow wrote:
    open your backup in this tab in Easy Flasher and try to find keys. if the backup is mostly OK maybe it will come back with the same key as below?

    Screenshot of BK7231 Easy UART Flasher showing partitions table and found decryption keys

    if it's the same key then the bootloader attached (flashed to 0x0) should boot (no OBK AP will broadcast) and you'll see the bootloader log if you're watching TX debug with a terminal.


    The keys match, and I can decompile my backup the same way. Do I need to flash the attached bootloader via BKFIL at 0x0 to the native firmware? Then flash the Ota already compiled with my code through itchiptool? Thanks.
  • #18 21914777
    insmod
    Level 31  
    Posts: 1397
    Help: 164
    Rate: 436
    Flash it via any tool at 0x0, but OTA image must use default Tuya OTA key (simply remove all platformio_options). OpenBK7231N OTA image would work too.

    Added after 4 [minutes]:

    Oh, and OTA image must be flashed to 0x12A000
  • #19 21914882
    lesder1986
    Level 4  
    Posts: 7
    insmod wrote:
    Flash it via any tool at 0x0, but OTA image must use default Tuya OTA key (simply remove all platformio_options). OpenBK7231N OTA image would work too. Added after 4 [minutes]: Oh, and OTA image must be flashed to 0x12A000

    I flashed the bootloader, then OTA, the terminal constantly writes [20][ERR][DEVINFO] boot partition signature not found.
  • #20 21914884
    insmod
    Level 31  
    Posts: 1397
    Help: 164
    Rate: 436
    This is what original firmware prints.
    Try to fully erase chip, write bootloader and then write OTA.
  • #21 21914912
    lesder1986
    Level 4  
    Posts: 7
    insmod wrote:
    This is what original firmware prints.
    Try to fully erase chip, write bootloader and then write OTA.

    I deleted everything in BKFIL and saved the loader to 0x0 and the file image_bk7231n_app.ota.ug.bin compiled from my computer in ESPHome at 0x12A000. After flashing the bootloader, the ICE indicator flashed white three times. The terminal is silent, outputs nothing, and is empty.
  • #22 21914915
    insmod
    Level 31  
    Posts: 1397
    Help: 164
    Rate: 436
    >>21914912
    Not ug, you must use .rbl file
  • #23 21914920
    lesder1986
    Level 4  
    Posts: 7
    insmod wrote:
    Not ug, you must use .rbl file

    I flashed through bkfil, it does not allow me to flash the .rbl format. Therefore, I had to sew.bin.
    After the firmware, the terminal was empty, I decided to connect 220 V, from the first turn on, the indicator did not work, turned on the power, the LED lit up, the device connected to the network and web access appeared, the relay and the indication are triggered. Thanks!
  • #24 21914937
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    rename the .rbl to .bin
  • ADVERTISEMENT
  • #25 21915213
    lesder1986
    Level 4  
    Posts: 7
    divadiow wrote:
    rename the .rbl to .bin

    Thanks, I've updated the firmware, everything is working.
  • #26 21915242
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    good stuff. there's also the option to restore your original device's rf info, including mac, from the backup if you need to

    BK7231N Sber Smart Relay SBDV-00050 Pin Assignment and Teardown

    or the same with Easy Flasher if UART still wired

    Screenshot of BK7231N tool showing “FormCustom” window with offset/length fields and read/write buttons.
  • #27 21915270
    lesder1986
    Level 4  
    Posts: 7
    >>21915242
    Thank you, I restored it using a full backup via the firmware, I did not make a separate RF backup, but I understood that it would not be possible to restore the full bin file over the Internet.
  • #28 21915274
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    rf = wifi calibration etc :)

    and yes, I forgot the TLV section would need to be cut out of the backup for the web app flash to work. I do have a PR that includes full-flash scan for the TLV section and will lift that bit out for flashing, but the other changes in the PR might need reviewing first.
  • #29 21915283
    lesder1986
    Level 4  
    Posts: 7
    divadiow wrote:
    rf = wifi calibration etc

    Yes))) Thanks.
  • #30 21917050
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    wondering if a static set of SBER OBK binaries for initial flashing is an idea. One for each of the 5 unique keys we know of.

Topic summary

✨ The discussion revolves around the BK7231N Sber Smart Relay SBDV-00050, focusing on pin assignments and firmware flashing issues. Users share insights on encryption keys for ESPHome, methods for flashing firmware, and troubleshooting steps for successful device operation. Key points include the importance of using the correct OTA package and flashing specific address areas, as well as the potential risks of losing the bootloader. Participants also discuss the availability of the device and share links to images and resources for further assistance.
Generated by the language model.

FAQ

TL;DR: OTA lives at 0x132000, and you should "choose rbl and just flash it"; this FAQ maps pins and fixes OTA/web‑UI issues for BK7231N SBDV‑00050 with ESPHome. For DIY tinkerers needing reliable flashing and recovery. [Elektroda, insmod, post #21284776]

Why it matters: It reduces brick risk and speeds up first‑boot success.

Quick Facts

What are the pin assignments for the SBDV-00050 (BK7231N)?

Fourteen pads are documented on the board. Relay: P9. LED: P26. Button: P16. Switch: P8. UART1 is available via TX1 and RX1. Power rails: VD0 3.3 V and GND. Other exposed pads include ADC3, EN, P6, P7, P14, and P24. These mappings come from a teardown with photos. [Elektroda, tehb13, post #21278069]

Which pins drive the relay and the status LED?

The relay coil is controlled by GPIO P9. The status LED is on GPIO P26. These roles are silkscreen-mapped in the teardown photos and tables. [Elektroda, tehb13, post #21278069]

How do I flash the ESPHome OTA RBL with ltchiptool?

Use ltchiptool with the OTA package. 1) Choose the .rbl and the tool should auto-detect the Beken OTA image at 0x132000. 2) Flash the RBL. 3) Enable ESPHome logging to aid any troubleshooting after first boot. “Choose rbl and just flash it.” [Elektroda, insmod, post #21284776]

ltchiptool errors when flashing the RBL—can I use BKFIL instead?

Yes. One user reported ltchiptool errors when flashing sbdv-00050-ota.rbl over factory firmware, while BKFIL flashed it without errors. Use BKFIL as a fallback to write the OTA image when the GUI tool fails. [Elektroda, tehb13, post #21284811]

Do I need to flash a full image, or just the OTA package?

Flash only the OTA package. “There is no need to flash a full image, just flashing ota package is enough.” The bootloader will then update the firmware. Writing the RBL at the OTA address enabled subsequent ESPHome updates. [Elektroda, insmod, post #21279490]

What happens if I erase the flash without a backup?

You lose the original bootloader, which guarantees a brick. The RF partition is also lost. Recovery then requires restoring the bootloader from a proper backup or extracting it from a known image before proceeding. [Elektroda, insmod, post #21279490]

Where do the encryption keys go in ESPHome for this device?

Set platformio_options with bkcrypt_coeffs, bkota.key, and bkota.iv. Also define board_flash.download as 0x132000+0xCC000. These parameters are required for building and delivering encrypted OTA for this model. [Elektroda, kuba2k2, post #21278408]

Device pings but no web UI after OTA—how do I fix it?

Connect UART1 and read the bootloader log. A bootloader like 1.0.13 prints reasons for OTA rejection, such as wrong encryption keys. After flashing the OTA image, erase 0x10000–0x12000 to clear the main firmware region and force a fresh start. [Elektroda, insmod, post #21280204]

What’s the correct board_flash.download format in ESPHome?

Use 0x132000+0xCC000 with a plus sign. Omitting the “+” prevents correct OTA placement. Add logging to your ESPHome configuration to make troubleshooting easier during first boot. [Elektroda, insmod, post #21284776]

Which ESPHome OTA schema should I use right now?

Recent ESPHome uses the multi-platform OTA format. Define ota with platform: esphome and your password. Also enable logs, and consider API encryption for debugging and security. This matches current recommendations in the thread. [Elektroda, insmod, post #21284776]

My .uf2 flashed fine but the device stayed dead—why?

A report shows .uf2 flashed without errors, yet the device didn’t run. The build lacked platformio_options for bkcrypt_coeffs, bkota.key, bkota.iv, and the download range. Add those options before generating and flashing your images. [Elektroda, tehb13, post #21279522]

How can I view boot logs to verify the bootloader is running?

Open a UART session and reboot the device. You should see lines like “BK7231n_1.0.8,” FAL init success, OTA init success, and “go os_addr(0x10000).” These confirm the bootloader hands off to the main firmware. [Elektroda, tehb13, post #21284726]

Is the SBDV-00050 sold outside Russia/Kazakhstan?

A user noted these modules do not appear to be for sale outside Russia and Kazakhstan. Availability is limited, so sourcing may require regional sellers. [Elektroda, divadiow, post #21278547]

Which ESPHome board target should I select for BK7231N here?

Use the BK72xx platform with the generic BK7231N QFN32 Tuya target. Example: bk72xx: board: generic-bk7231n-qfn32-tuya in your ESPHome config. [Elektroda, tehb13, post #21284726]

OTA flashed but no logs—what recovery sequence should I try?

Restore your known-good backup image first. Then flash the new OTA RBL again with logging enabled in ESPHome. This approach confirms baseline function and gives visibility into what happens during the bootloader handoff. [Elektroda, insmod, post #21284826]
Generated by the language model.
ADVERTISEMENT