logo elektroda
logo elektroda
X
logo elektroda

[BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info

yvesdm3000 4377 27
ADVERTISEMENT
  • #1 20383870
    yvesdm3000
    Level 3  
    I just flashed openbeken on this device:

    [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info led[BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info

    Beware this is a 5A device, not 16A ! The advantage of this device is that it uses L as an input for an external switch
    Assignment:
    Gpio6 is the led
    Gpio8 is the relay

    More gpios follow, I only traced it using power from my ttl level serial flasher.

    Bought here:

    https://a.aliexpress.com/_mNQp4Ee

    Added after 2 [minutes]:

    [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info

    Image got mangled.

    I have a backup flash image for cloudcutter. I will post that later
  • ADVERTISEMENT
  • #2 20383909
    p.kaczmarek2
    Moderator Smart Home
    Hello, that kind of devices usually have a low quality power supply, you should consider adding "PowerSave" to 'Short startup command' so the device tries to run in low power mode and limits the current usage.

    It is also worth to add screenshots from the offer in case that it expire:
    [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info
    [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info
    Model name (basing on photo from offer): Smart-TY-S02-1 (2 gang versions Smart-TY-S02-2)
    Helpful post? Buy me a coffee.
  • #3 20383994
    yvesdm3000
    Level 3  
    That seems to be the model name, but mine has a different print on the shell, without a model number... A bit weird. On mine there is also a Bluetooth logo. Does the BK7231N also support Bluetooth ?

    Yves
  • #4 20384244
    p.kaczmarek2
    Moderator Smart Home
    It supports Bluetooth, which is also used for quick pairing with Tuya App:
    [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info
    I've also looked more at the offer and the quality of their English does not inspire confidence:
    [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info
    Here's a (Polish) topic about fixing a faulty similar switch: https://www.elektroda.pl/rtvforum/topic3898805.html
    In general, in OBK it's recommended to enable powersave feature for that kind of devices.
    Helpful post? Buy me a coffee.
  • #5 20384354
    yvesdm3000
    Level 3  
    I bought this to see if I could put Tasmota on it, but it had the Beken chip... I have another device that I can't open yet, so I used this one first as a tool to explore what is possible with the Beken chip.

    I tried cloudcutter but you need an initial dump first, so that's what I did, in the meantime doing a teardown and have an initial look at what OpenBK can do.

    This post was supposed to be in the OpenBeken teardown forum, but was moved to the Temporary one?

    Yves
  • #6 20384413
    p.kaczmarek2
    Moderator Smart Home
    Don't worry, posts are put automatically in Temporary Section until we make sure they have enough information to describe the device.
    Please submit that second device as well.
    Any news on remaining pin roles?

    Btw it's also worth to note the string on the PCB: MINI_SW02_N 20211204-VER.A
    Helpful post? Buy me a coffee.
  • #7 20385212
    yvesdm3000
    Level 3  
    Remaining pin roles:

    Pin10: Backside push button
    Pin24: Live 240V external switch

    The other device is a Balco HE200022 multi-steckdose. It's a lot heavier than the Chinese ones that I use (I replaced with esp chip) and at least the tuya-cloudcutter script seems to indicate a BK7231 chip. I ordered a triangular screwdriver since I don't have one that is long enough to open the device.

    Yves

    Added after 2 [hours] 50 [minutes]:

    And here is the original firmware. It is from factory, so never added it to my network and hence never seen Tuya.

    Yves
  • #8 20385808
    p.kaczmarek2
    Moderator Smart Home
    How did you manage to load that dump? Suprisingly enough, it seems to be full of 0x00 bytes. I double-checked on my side but I am unable to reproduce the error and my BK7231 are read correctly.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 20385820
    yvesdm3000
    Level 3  
    I used the GUI tool. It clearly did a checksum so that made me confident that the dump was successful.

    I guess the dump is lost now. :-(

    Yves
  • #10 20385859
    p.kaczmarek2
    Moderator Smart Home
    Can you provide any more information how to reproduce the bug?
    Maybe you've used tool in a directory where you don't have a write access to?
    Is the dump on your drive also full of 0x00?
    Did you wait for the process to finish or interrupted the app quickly?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #11 20386249
    yvesdemuyter
    Level 3  
    Hi,

    It is hard to give more details. My original file is also like this. It is in the 'backups' directory of the bk7231flasher_1.0.4 tool. It is certainly writable, otherwise it would not have written the characters...
    I did the 'Do firmware backup' first and I clearly saw a succeeding checksum in the output window. How I ended up with all characters, I don't know...
    I now know I need to be extra careful when doing other devices, maybe I will use more than one tool to make multiple backups to be on the safe side since the file is now important for cloudcutter use. I never had a problem like this for the 20 ESP devices that run Tasmota over here, although I stopped doing backups for about half of them and I stuck to a version that works for me of Tasmotizer.

    Yves
  • #12 20386262
    p.kaczmarek2
    Moderator Smart Home
    I will add some extra failsafe mechanism to the tool to make sure this bug won't repeat, but you are the first one of the many and it happened only to you.

    The tool is still in alpha phase, it was released few days ago.

    If you have any other devices, please try again and report back here. Your teardowns are also very interesting, so you are welcome to submit another one as well.
    Helpful post? Buy me a coffee.
  • #13 20437853
    dufu
    Level 4  
    Hello,
    I have this device two channels version. Have some hardware problem with it. I believe those pin numbers are different.
    Do you have by chance the datasheet for the BK7231N MCU? I only could find BK7236/37/38 from their web site.
    Thanks in advance.
  • #14 20437876
    p.kaczmarek2
    Moderator Smart Home
    Hello, this is what we know so far:
    BK7231 datasheet, pinout, programming, specification, wiki (BK7231T, BK7231N)
    If you have any specific questions, just ask, we're here to help.
    Helpful post? Buy me a coffee.
  • #15 20438028
    dufu
    Level 4  
    Thank you for the quick reply.
    I've seen this, thank you.
    Any idea if this MCU has pull-up/down pin configuration? I have one channel with 2-way hardware switches. It doesn't work normally. I'm sure this is because of electromagnetic pickup, as those wires are quite long - around 10 meters.
  • #16 20438037
    p.kaczmarek2
    Moderator Smart Home
    As you can see in our SDK, there are programmable pull up resistors for IO ports:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/hal/bk7231/hal_pins_bk7231.c
    Code: C / C++
    Log in, to see the code

    In OpenBeken, all Btn (Button) and Btn_n (inversed button) roles are using input pullup configuration, so by default, you don't need to connect to pin anything else besides a button.

    What kind of switch do you have?
    Helpful post? Buy me a coffee.
  • #18 20438074
    p.kaczmarek2
    Moderator Smart Home
    I need more details in order to help. How is the switch connected inside and what kind of problem do you experience.

    As far as I know, for that kind of switch, you are supposed to use "TglChannelOnToggle" pin role.
    Helpful post? Buy me a coffee.
  • #19 20438105
    dufu
    Level 4  
    From the very beginning this switch doesn't work reliably with physical switches and often goes offline.
    If I toggle any of the two physical switches, it can:
    - not switch at all
    - switch after several seconds
    - toggle the light several times
    It also can toggle the light randomly itself.

    I checked with spectrum. This is what I had on S input:
    [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info
    It should be steady 3.3V
    I already managed to overcome this problem with soldering a 3.3k pullup resistor.
    But I wonder that this should be done via MCU pull-up configuration. Probably Chinese developers forgot to activate pull-up.

    This is the photo of the board with soldered pull-up resistor
    [BK7231N Aubess] Mini Light Switch Teardown, 5A Capability, OpenBeken Flash & GPIO Info

    I didn't try your firmware yet.
  • #20 20438354
    p.kaczmarek2
    Moderator Smart Home
    I had similiar switch and it worked well:
    ZN268131 WiFi Smart Switch that allows you to connect a bistable button
    but I also concluded that this kind of switch has a very weak power supply and might need a capacitor replacement (a low esr one):
    Switch capacitor replacement topic - not yet translated
    and that it is strongly recommended to enable low power mode (PowerSave command in short startup command in my firmware) to keep those switches running reliably
    Helpful post? Buy me a coffee.
  • #21 20443773
    ferbulous
    Level 18  
    @p.kaczmarek2 Any recommended ones for this mini wifi switch?
    I was about to buy the aubess mini wifi, until i saw this discussion.
    Should i just stick with sonoff mini instead?
  • #22 20444228
    p.kaczmarek2
    Moderator Smart Home
    As said in the other topic, all you need to do is use PowerSave in short startup command (or autoexec.bat).

    In general, we might consider adding PowerSave enabled by default in the future, but we would need more testing. Someone should try enabling it on all devices and observe in long term how well it works.
    Helpful post? Buy me a coffee.
  • #23 20551479
    chernyaevan
    Level 5  
    This is my config for Smart-TY-S02-2

    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Full Device Name Here",
    "model": "enter short model name here",
    "chip": "BK7231N",
    "board": "TODO",
    "flags": "1024",
    "keywords": [
    "TODO",
    "TODO",
    "TODO"
    ],
    "pins": {
    "6": "LED_n;1",
    "7": "Rel;2",
    "8": "Rel;1",
    "10": "Btn;1",
    "24": "TglChanOnTgl;1",
    "26": "TglChanOnTgl;2"
    },
    "command": "PowerSave",
    "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }

    I'm not sure that LED_n is correct. What will happen, if I change it to LED_WiFi?
  • #24 20551587
    p.kaczmarek2
    Moderator Smart Home
    LED_n follows the state of linked channel (with inversion) and LED_WiFi (or LED_Wifi_n) shows the state of the WiFi connection.
    Helpful post? Buy me a coffee.
  • #25 20551752
    chernyaevan
    Level 5  
    If I understand correctly I can change LED_n to LED_WiFi and I will see the status of the WiFi connection?
  • ADVERTISEMENT
  • #26 20551770
    p.kaczmarek2
    Moderator Smart Home
    Yes. Have you checked our docs?
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/ioRoles.md
    WiFiLED_n or WiFiLED, one is an inversion of another
    Helpful post? Buy me a coffee.
  • #27 20551792
    chernyaevan
    Level 5  
    I have done it, thank you. I will create the separate topic about Smart-TY-S02-2 to share my configuration because there is no description for this device in this topic.
  • #28 20551809
    p.kaczmarek2
    Moderator Smart Home
    Feel free to do that, just try to include some more photos, packaging photos, etc if possible.
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around the BK7231N-based Aubess Mini Light Switch, focusing on its teardown, GPIO assignments, and flashing with OpenBeken firmware. Users highlight the device's 5A capability, cautioning against assuming it can handle 16A. Key GPIO assignments include GPIO6 for the LED and GPIO8 for the relay, with additional GPIOs identified. Users discuss issues related to power supply quality, the need for enabling PowerSave mode for reliability, and the potential for Bluetooth support. There are inquiries about the pin configuration and the effectiveness of pull-up resistors in mitigating electromagnetic interference. The conversation also touches on firmware backup challenges and the importance of sharing configurations for similar devices.
Summary generated by the language model.
ADVERTISEMENT