Detailed guide on how to flash the new Tuya Beken Chips with OpenBK7231T

Hello, can someone tell me if this works with a wall thermostat? I have the Moes BHT-002 with a wb3s and want to go away from Tuya.

Im trying to flash an CB2S( BK7231N) using a Arduino Uno with the chip removed. Acts like a UART then. But BKwriter and the python tool wont flash.

In BK i get 2 blue bars, so its a sign its going, but then a red cross at the end of the bar.

Flash ID:0x00000000
Time:1.735s
Speed of Programm:115200bps
erasing flash:0x00011000ā€¦FAILED.

The python way says: Unprotect Failed.

Will try the Raspberry pi4 route to see if thats any better

EDIT: Pi4 works. With the python uartprogram.

I desolderd the chip because i thought that was the reason it didnt work with the Arduino, but that wasnt the case. I think i could have flashed it on the board.

So, I have successfully flashed the board inside the new FEIT Wall dimmer from Costco. Now, I am not sure of the steps to figure out what the configuration should be. It looks like I need to trace what pins go where or such.
Anyone have any insight on next steps? I have it connected to my wifi, can connect to it via the IP and web app and have it successfully connecting to my HA MQTT.

I think itā€™s better if you ask the developer on elektroda
Normally I would just do trial and error by setting up all pin as relays, and see whats lights up/relay clicks
However Iā€™m not familiar if itā€™s using tuya mcu based on tasmota emplate page for feit dimmer

Hi, as a newbe i flashing my 3 gang switch with the latest bin file for BK7231N. The flashing doing well but mij question now is how i have to programming the GPIOā€™s. What i find from a other brand is like this.
Relay 1 : Gpio 8
Relay 2 : Gpio 26
Relay 3: Gpio 24
Button 1 : Gpio 14
Button 2 : Gpio 9
Button 3 : Gpio 10
Wifi led (wifiled_n) : Gpio 1
Is this for every 3 gang switch the same if you flashing with OpenBeken?

Might differ slightly depending on the manufacturer

Flashing the BK7132N is no problem. The BK7132T canā€™t Read or Flashing. So its not the programmer or the cable because then read or flashing the bk7132N canā€™t doing the same.

Hi, thanks for no help at all. :-1:

I am assuming you mean BK7231T not BK7132T!

Did you try the Python script? Also check that your soldering is not messing up your connections. I had a guy messaging me with the same problem. They then realised that two pins where shorted by his solder. He cleaned it and it worked.

Good day. Has anyone taking a stab at flashing OpenBK7231T on this presence sensor ?

I have a similar one, but havenā€™t flash it yet since iā€™m not sure about the configuration. Any guides?
Donā€™t see any radar device in blakadders template page

Thank you.
Blackadder has done a transplant on this device and produced the template.

See below

I have the same 3 gang switch, spent so long trying to flash it and finally succeeded using the LibreTuya python with esphome wizard.

Now I canā€™t seem to figure out the esphome config for these.
I see thereā€™s the standard one on the esphome website, but donā€™t know how to change this config based on the LibreTuya pinouts etc. My board it s the WB3S

Would highly appreciate if someone can edit the following accordingly please


status_led:
  pin:
    number: GPIO0
    inverted: True

output:
  # 1st button
  - platform: gpio
    pin: GPIO5
    id: relay1

  # 2nd button
  - platform: gpio
    pin: GPIO14
    id: relay2

  # 3rd button
  - platform: gpio
    pin: GPIO12
    id: relay3

light:
  # 1st button
  - platform: binary
    name: "${friendly_name} 1st"
    output: relay1
    id: light1

  # 2nd button
  - platform: binary
    name: "${friendly_name} 2nd"
    output: relay2
    id: light2

  # 3rd button
  - platform: binary
    name: "${friendly_name} 3rd"
    output: relay3
    id: light3

# Buttons
binary_sensor:
  # 1st button
  - platform: gpio
    pin:
      number: GPIO16
      mode: INPUT
      inverted: True
    name: "${friendly_name} 1st Button"
    #toggle relay on push
    on_press:
      - light.toggle: light1

  # 2nd button
  - platform: gpio
    pin:
      number: GPIO4
      mode: INPUT_PULLUP
      inverted: True
    name: "${friendly_name} 2nd Button"
    #toggle relay on push
    on_press:
      - light.toggle: light2

  # 3rd button
  - platform: gpio
    pin:
      number: GPIO3
      mode: INPUT_PULLUP
      inverted: True
    name: "${friendly_name} 3rd Button"
    #toggle relay on push
    on_press:
      - light.toggle: light3

switch:
  - platform: restart
    name: "${friendly_name} REBOOT"

Do you know if doing it this way will allow it to be picked up by Aeotec Hub? I am about to receive the USB-to-Serial converter and will get started on my manu E27 RGB bulbs.

By the way, if anyone has experience disassembling bubls like my LSC bulb and knows how to pull the controller without having to break the connection with the power source, I would love to hear. Everything seems to be ā€œkind of boltedā€ in place in the bulb (except of course, the cover)

Change the following GPIO references in your code above :

GPIO0 to D7
GPIO16 to D1
GPIO4 to D8
GPIO3 to D10
GPIO5 to D9
GPIO14 to D2
GPIO12 to D3

I tested on a 3Gang Deta and all appears ok

2 Likes

Hi everybody, since this discussion helped me along the way, I will just share a few lessons Iā€™ve learned with an Arlec CCW bulb and an IR universal remote during the last few days. Both are using BK7231T chips (the bulb not anymore!):

  • Since a number of people had issues with flashing, here is something that might help: Flashing in both cases for me required an additional power source; the USB serial dongle does not provide enough power!! With that it worked, without it, it worked randomly with the bulb and not at all with the IR remote. Remember to connect ground from the power supply to the chip and the dongle. Note also that reading works without an issue also without the additional power supply. Connecting the USB power cable to the IR remote and then trying to flash, did not solve the issue.
  • I always had to ground CEN to bring the chip into flashing mode.
  • the HA auto discovery in OpenBK did not work for me, but I managed to construct a MQTT message manually and got that registered with HA. In the end I decided to leave the IR remote completely off HA and communicate with it only through the MQTT broker. Works very well!
  • Playing around with multiple images I managed to brick the bulb!! :sob: Actually I locked myself out of the chip without a way to re-flash it and the USB dongle just would not work at all, neither reading nor writing. Well, since I kind of dislike these Beken chips anyway, I ā€˜justā€™ replaced it with an ESP12s and flashed it with ESPhome. That was a very fiddly exercise, since the pins are not really compatible. I soldered short cables and glued the ESP12s to the power supply board. Not totally elegant, but works and the chip fits quite nicely in the space of the BK7321T carrier board (WB2L)!
  • BTW: The serial test connector pads on the original bulb WB2L board are not accessible, since that board is soldered onto the power supply board and the pads are on the back side! There is also no CEN pad.
  • Also tried using LibreTuya, but that does not support the IR functionality, yet and has a few other limitations as well.
  • Also tried to dump the original firmware using bk7231tools. That generated the expected 2MB file, but when trying to use that to construct a config profile, it always complained about a missing data partition. Tried to find out how to get that, but was not able to find a description. I would have thought that bk7231tools should be self-consistent, in the sense that when reading a dump it should be complete and can then be used to generate the profile, but that does not seem to be the case. Any help would be appreciated.
  • AFAIK: OpenBK does not (login) protect the config page at all, but maybe I missed something there?? Donā€™t like that at all.
  • The universal IR remote is pretty good. It is a NEO Coolcam Tuya Smart WiFi IR Universal Smart Remote Controller from Aliexpress. Sold under a number of different names as well. Opening it, requires quite a bit of well controlled force, if you want to use the case afterwards again. However, in principle it should be possible to avoid opening it all together, since tuya-cloudcutter did work on it!
2 Likes

Depends on the board i guess? This one doesnā€™t need even 3.3v pin connected

You need to manually start mqtt discovery after configuring mqtt login.
It should show up in mqtt integration

I mostly just had to power cycle it to start flashing (not uart, just the 3.3v pin)

You can request for an authentication login, the developer welcomes any suggestion to improve it

If it gets bricked, you could still restore it back using SPI tool.
WB2L is quite common with bulbs, you could order some esp-02s thatā€™s pin compatible

It really depends on the pcb design i guess, some had the wb2l with tx/rx pins partially exposed so you donā€™t need to desolder it.

Iā€™m using batch script from here to generate the profile

2 Likes

are you talking about this brilliant pir sensor?
Brilliant Smart Intelliscanner Outdoor PIR Sensor - Bunnings Australia

i have the same one did you manage to flash it with tasmota?

Hi there. No, I never ended up doing it. Went with a traditional PIR sensor instead.

I do eventually want to put a smart sensor in place, as the way the switch and sensor are currently wired together isnā€™t conducive to installing a smart switch.

Love what youā€™ve done here. Does the template for the DETA double powerpoint expose the energy monitoring sensors?