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

Ok, I have tried to load ESPHome onto the device but get this error:

E: ValueError: Failed to write to 0x800B000

I’m pretty sure I have the serial wired OK as I was able to read the original firmware from the flash, a look at the file shows this:

This flash type is not supported!
 CHIPID[%08x]

The flash chip is a H25S80BG which seems to be a 8Mbit.

Any ideas ??

Never got that error before.

Can you post that in the libretiny discord for discussion

I have created new uf2 files for the 3 possible options for that chip with Esphome 23.9.0b1a and get the same error with all of them. I’m pretty sure I have the serial stuff connected correctly and power is OK as I I can read from the device.

I can’t access my Discord account for some reason so I created an issue on the LibreTiny github and added the dump of the original firmware.

Hi!!
Nope, I mean this one.

I wrote in the forum of elektroda and got this:

We need to wait one week more :scream: This big release is now scheduled for the 27th of September :spiral_calendar:

Just to finalise this, after a lot of assistance from the LibreTiny folks on github I have successfully loaded ESPHome on this smart plug and it works fine.

The process was a bit more complicated and required the writing of the separate OTA1 &2 files with a different software package. It also needed the smallest generic board type as the flash is only 1Mb.

The internal connections to the RTL8710BX module in the Tenda Beli SP3 plug are:

Relay1&2	GP12	Pin2
LED D6		GP22	Pin11	Red
LED D7		GP19	Pin12	Blue
Button1		GP11	Pin4
INFO ESPHome 2023.9.0b1
INFO Reading configuration /config/esphome/tenda-test22468.yaml...
INFO Starting log output from tenda-test22468.local using esphome API
INFO Successfully connected to tenda-test22468.local
[21:10:00][I][app:102]: ESPHome version 2023.9.0b1 compiled on Sep 15 2023, 13:16:12
[21:10:00][C][wifi:546]: WiFi:
[21:10:00][C][wifi:382]:   Local MAC: 50:2B:73:F6:xx.xx
[21:10:00][C][wifi:383]:   SSID: [redacted]
[21:10:00][C][wifi:384]:   IP Address: 10.0.0.146
[21:10:00][C][wifi:385]:   BSSID: 80:2A:A8:D1:CF:D5[redacted]
[21:10:00][C][wifi:387]:   Hostname: 'tenda-test22468'
[21:10:00][C][wifi:389]:   Signal strength: -31 dB ▂▄▆█
[21:10:00][C][wifi:393]:   Channel: 1
[21:10:00][C][wifi:394]:   Subnet: 255.255.0.0
[21:10:00][C][wifi:395]:   Gateway: 10.0.0.1
[21:10:00][C][wifi:396]:   DNS1: 10.0.0.1
[21:10:00][C][wifi:397]:   DNS2: 10.0.0.1
[21:10:00][C][logger:357]: Logger:
[21:10:00][C][logger:358]:   Level: DEBUG
[21:10:00][C][logger:359]:   Log Baud Rate: 115200
[21:10:00][C][logger:361]:   Hardware UART: UART2
[21:10:00][C][mdns:115]: mDNS:
[21:10:00][C][mdns:116]:   Hostname: tenda-test22468
[21:10:00][C][ota:097]: Over-The-Air Updates:
[21:10:00][C][ota:098]:   Address: tenda-test22468.local:8892
[21:10:00][C][ota:101]:   Using Password.
[21:10:00][C][api:138]: API Server:
[21:10:00][C][api:139]:   Address: tenda-test22468.local:6053
[21:10:00][C][api:143]:   Using noise encryption: NO
[21:10:00][C][lt.component:013]: LibreTiny:
[21:10:00][C][lt.component:014]:   Version: v1.4.0 on generic-rtl8710bn-2mb-468k, compiled at Sep 15 2023 13:15:57, GCC 10.3.1 (-Os)
[21:10:00][C][lt.component:015]:   Loglevel: 3

There are some great tutorials on the internet
I used the above one and the updated video

I already flashed 3 lights.
Now I’m wondering if I should give it a try flashing the vacuum cleaner.
Or wil it destroy my device if ltchiptool doesn’t recognize it.

I also have the same labeled chip and flash the 2mb 468k board size.
Didn’t have to use separate software just the ltchiptool.
How stable is the wifi connection on the plug so far?

Assuming it’s using tuya mcu like this one, you should be good

I had to use the python2 version of the rtltool.py and I used a linux VM in Proxmox when I couldn’t get python to work in Windows.

The relevant info for my device is in this issue on github.

Everything is working fine, I am still trying to sort out the 2 leds but the relay and button are done.

Another question about LibreTiny ESPHlome.

Has anyone tried to rename a device from the 3 dot menu the ESPHome addon ?? I just tried on my new RTL8710 based smart plug and it went through the hoops and uploaded something but the name stayed the same.

Also tested it on a random ESP based device and that worked as I expected.

INFO ESPHome 2023.9.0b1
INFO Reading configuration /config/esphome/tenda-test22468.yaml...
Updating /config/esphome/tenda-test22468.yaml to /config/esphome/tenda-plug-1.yaml

Edit: OK the renamed device did show up in HA with the new name but the stuff in the ESPHome addon did not get updated to the new name. I had to create a new device with the new name and paste the old yaml into and manually rename it.

yes,
But flashing a device with esphome and having a working device are 2 different things,
After I have esphome running I would like to have the vacuum working.

It might be easier then I thought before, Earlier I thought Turning left/right and stopping based on sensors should be developed.
but checking out this branche

I think I only need to send the correct datapoints and just use tx/rx/

I’m not interested in keeping the tuya app working, I don’t use it now. So I should be good overwriting, still I think there is a lot which can go wrong and brick my vacuum cleaner.

Hello! I have a 1 gang wall switch with wbr3 chip, I want to flash it with openbk, but it has rf switch functionality, is there any way this can work with openbk?

Wbr3 is rtl8720c, not supported in openbk and libretiny is in the works.
You could do an esp swap. rf is usually not tied to the chip and would still work as normal.

By the way, you didn’t flash with the uf2 file with ltchiptool but using rtltool.py to flash these binaries?

python2 ./rtltool2.py -p /dev/ttyUSB0 wf 0xb000 image_0x00B000.ota1.bin
python2 ./rtltool2.py -p /dev/ttyUSB0 wf 0x80000 image_0x080000.ota2.bin

This was how you avoided this error?

E: ValueError: Failed to write to 0x800B000

OK, I have just upgraded to ESPHome 23.9.1 and copied the yaml files for my Casa downlights to the ESPHome addon from the old Libretiny one.

The code is mostly the same as this post with the only change being to replace ledc with libretiny_pwm as is required with the merged version. The firmware compiled and uploaded without an error but it is now offline.

The light is sort of working as on power on it starts up at the brightness and colour temperature I have in the on_boot section of the code but it is offline and but I have no wifi so no logs.

Edit:

Had another look at this tonight and found that there was a fallback hotspot I could use to re-enter the wifi password and it came back to life. Maybe it is a libretiny thing but there is no AP stuff in the code.

Same thing had to be done with the second light I updated.

Could really use some help here everyone.

Followed the instruction to the flashing part but cannot get it to flash. Really not sure whats going on. Any ideas? Have tried lowering bitrate but nothing. Just says Init…failed

Are you successful with other devices?
Sometime you need to keep grounding the cen pin as until flashing starts
or it could be that tx/rx is connected to mcu on the pcb that prevents flashing

I haven’t tried other devices yet. Ive tried grounding the cen pin a few times during the initial 15 seconds but the tx light on my serial adaptor turns off. Not sure if thats a good thing.
How can i tell if rx/tx is connected to mcu?

Can you post your device here? any pcb pics