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

Hi everyone,

I was walking past Aldi yesterday, noticed the Casalux Corner Floor Lamp and ended up buying one. I tried using tuya-Cloudcutter, and there’s a device listed as Casalux Corner Lamp under Aldi, but the exploit didn’t work for me. I’m not even sure if it went into slow blink mode, as that didn’t happen, and the tool indicated that the exploit failed.

I have a quick question: Am I right in assuming that tuya has patched their newer modules, making this exploit no longer effective?

I’ve included a few photos of the board. If I need to flash it using a serial adapter, can I use the test points on the PCB without having to desolder the chip?

By the way, the chip is a Lightning LN882HKI.



Any help would be appreciated. Thanks.

I am not sure this model of chip is coveted by libretiny platform. BK723x is covered by that that too specific version of firmwares and not all. Refer here.

Hi, that’s not beken
You can flash with openbeken with this instructions

Hi, please has anyone flashed this switch?
Wifi Switch Module DC7-32V RF Receiver

Here it says here that flash is possible, but it is no more possible to add RC transmitters.
Thank you.

Hey I’ve managed to flash the same “Deta SMART rewireable plug (6930HA Series2)” using tuya-cloudcutter. I used the same firmware: 1.1.8 - BK7231T / oem_bk7231s_rnd_switch

I’m curious how you got ESPHome onto the device or how you uploaded this config to it. I thought this wasn’t an ESP chip?

I’d ideally like to run something like esphomekitdevices (HAA) on it instead to save needing a Home Assistant middleman with the OpenBK7231T firmware.

Any pointers would be greatly appreciated.

I create a device in esphome Download file to pc and
then copy to tuya-convert binary install folder.
Update your device (I think its option 3).
Select device binary and install.

The later versions of esphome can compile these new chips

My config for that device:

# Basic Config
# https://www.bunnings.com.au/deta-smart-plug-base-with-grid-connect_p0098817
substitutions:
  device_name: "deta_smartplug_1"
  name: "Deta Smartplug 1"

esphome:
  name: ${device_name}
  comment: ${name}

bk72xx:
  board: wb2s
  framework:
    version: dev

wifi:
  networks:
    - ssid: !secret wifi_ssid
      password: !secret wifi_password
    - ssid: SSID Secondary
      password: Password
  ap:
    ssid: ${device_name}AP
    password: !secret ap_password 

captive_portal:

logger:
  #level: VERBOSE

api:
  encryption:
    key: "Key generated by esphome"
ota:
- platform: esphome
  password: !secret ota-password  

web_server:
  port: 80

time:
  - platform: homeassistant
    id: homeassistant_time

output:
  - platform: libretiny_pwm
    id: blue_led_output
    pin:
      number: P6
      inverted: True

light:
  - platform: monochromatic
    name: ${device_name} Blue LED
    output: blue_led_output
    id: blue_led
    internal: True

sensor:
  - platform: uptime
    name: ${device_name} Uptime

  - platform: wifi_signal
    name: ${device_name} Wifi Signal
    update_interval: 60s

text_sensor:
  - platform: version
    name: ${device_name} ESPhome Version
  - platform: wifi_info
    ip_address:
      name: ${device_name} IP

binary_sensor:
  - platform: gpio
    pin:
      number: P11
      inverted: True
    id: button
    name: ${device_name} Button
    on_press:
      - switch.toggle: relay_template
    internal: True

switch:
  - platform: gpio
    pin: P26
    id: relay

  # tie the led & relay operation together and report status based on relay state
  - platform: template
    name: ${device_name} Relay
    id: relay_template
    lambda: |-
      if (id(relay).state) {
        return true;
      } else {
        return false;
      }
    turn_on_action:
      - light.turn_on: blue_led
      - switch.turn_on: relay
    turn_off_action:
      - light.turn_off: blue_led
      - switch.turn_off: relay

Is your device creating its own Access Point? If so, just connect to that and upload the binary. As @pencilhead said, libretuya was merged with esphome so very easy to do. If it helps these are my notes from when they were separate projects. You should only have to do steps 2, 3, 4, & 8.

2\ Go +New Device, Continue, enter a name, select BKxx, and select board type.

3\ We now have a basic YAML file. It's highly recommended to always include the web_server
   and captive_portal components - even in your first "empty" upload. "use_address" will
   be used later. For initial config I enter the actual ssid & pword.

# Enable web server
web_server:
  port: 80

# Enable Home Assistant API
api:

ota:
  safe_mode: true

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  power_save_mode: none
  manual_ip:
    static_ip: !secret ip_antbms1
    gateway: !secret ip_gateway
    subnet: !secret ip_subnet
    dns1: !secret ip_dns1
  #use_address: 192.168.1.28

  # Enable fallback hotspot in case wifi connection fails
  ap: {} # This spawns an AP with the device name and mac address, no password.
    #ssid: "Power-Switch1 AP"
    #password: "password"

captive_portal:

4\ Save the yaml and close. Using the 3 dots, select Install, Manual download, and select Modern Format.
   This will save the binaries on the RPi.

5\ Connect to the RPi using WinSCP. Navigate to the root and then opt folder. Do a search for *ug.bin and
   then Focus on the result to enter the folder. Drag the required *ug.bin file to the local desktop and rename
   to something meaningful. Navigate back to "/home/janos-pi/tuya-cloudcutter/custom-firmware" and drag the
   bin file into this folder.

6\ SSH into the RPi and navigate to "/home/janos-pi/tuya-cloudcutter".

7\ We first need to cut the device from Tuya cloud using tuya-cloudcutter.
   -execute sudo ./tuya-cloudcutter.sh -s ssid pword -w wlan0
    follow the prompts until completion. Device will now be local.
   -execute sudo ./tuya-cloudcutter.sh -w wlan0 -f esphome.bin (or whatever the bin filename is)
    follow the prompts until completion. Device will now have custom firmware loaded.

8\ If it fails for whatever reason and doesn't connect to local network then it should create its own
   Access Point. Use the phone to connect to this AP and load http://192.168.4.1/. From here your
   can reenter WiFi credentials and/or load new firmware.

9\ If it works then the device will connect to local network and be discovered by ESPHome.