[Tutorial] Flashing OpenBK via OTA using tuya-cloudcutter
Download the tool here
https://github.com/tuya-cloudcutter/tuya-cloudcutter
Before using the script, verify your device tuya-firmware version using the tuya/smartlife app
and download the correct firmware for your device chip (T or N). The chip would not boot if wrong firmware version is flashed on it and it would require using serial method to re-flash it again with the correct firmware.
Steps:
1. Start the script (run_flash.sh)
2. Select the firmware that you have downloaded earlier to the custom-firmware directory.
3. Select your profile that matches with the tuya-firmware version.
4. Reset your device to AP mode (if profile matches, A-xx prefix would show up after it gets reset the 2nd time)
5. Reset your device again for the OTA flashing,
For no (3), if your device is not supported, then you would need to make dump of your device firmware using bk7231tools and submit a github request for profile creation.
There's also Lightleak app that can obtain firmware dump wirelessly. I've had some success with T device but not N yet
Alternatively you could still generate your own profile using hexomatic with this batch script
https://github.com/tuya-cloudcutter/tuya-cloudcutter
Before using the script, verify your device tuya-firmware version using the tuya/smartlife app
and download the correct firmware for your device chip (T or N). The chip would not boot if wrong firmware version is flashed on it and it would require using serial method to re-flash it again with the correct firmware.
Steps:
1. Start the script (run_flash.sh)
2. Select the firmware that you have downloaded earlier to the custom-firmware directory.
3. Select your profile that matches with the tuya-firmware version.
4. Reset your device to AP mode (if profile matches, A-xx prefix would show up after it gets reset the 2nd time)
5. Reset your device again for the OTA flashing,
For no (3), if your device is not supported, then you would need to make dump of your device firmware using bk7231tools and submit a github request for profile creation.
There's also Lightleak app that can obtain firmware dump wirelessly. I've had some success with T device but not N yet

Alternatively you could still generate your own profile using hexomatic with this batch script
Spoiler:
save as do_magic.bat
On windows rename full dump .bin to device-manufacturer_device-name.bin and run it like this
It should generate these files
Copy the last two JSON files to a subdirectory in device-profiles.
Rename each to device.json and profile.json, respectively
And execute run_flash.sh <wifi adapter name> <your subdirectory name>
bk7231tools dissect_dump -e -O %1 %1.bin
pushd %1
..\haxomatic.py %1_app_1.00_decrypted.bin
..\parse_storage.py %1_storage.json
..\parse_app.py %1_app_1.00_decrypted.bin
mkdir extracted
move *.txt extracted\
popd
assemble_universal.py %1
save as do_magic.bat
On windows rename full dump .bin to device-manufacturer_device-name.bin and run it like this
do_magic.bat device-manufacturer_device-name
It should generate these files

Copy the last two JSON files to a subdirectory in device-profiles.
Rename each to device.json and profile.json, respectively
And execute run_flash.sh <wifi adapter name> <your subdirectory name>
Comments
Excellent tutorial. I want to share that it is essential to double-check the real chip on the PCB. Tuya has been shipping out CB2S labelled PCB's with BK7231Ts. https://obrazki.elektroda.pl/5024679100_1671301299_thumb.jpg... [Read more]
Thanks for highlighting that, probably won't notice if I never open the metal case which I rarely do I think I'll edit my post to recommend running 'run_detach' script first just to verify which chip... [Read more]
Thanks for the great tutorial. The wireless method is very easy and beginner friendly (like myself). It will help a lot of us disconnect from the Tuya cloud. I tried it in a couple of devices and it... [Read more]
We found that tuya is sending out pcbs with wrong labeling. So the only way to know 100% sure is by finding the chip and reading it. Other method is just try on error. The good thing is that it is almost... [Read more]
Thanks for the reply. The problem is that I have caused a device not to boot by flashing the wrong firmware. I had a 16a mini switch that I flashed with the N firmware and it didn't boot after the flash... [Read more]
Okay, That is kinda new for me. I never was able flashing an T to N or vice versa. Am I correct in assuming you used tuya cloud cutter for initial flash and then a flash with OTa resulting in a bricked... [Read more]
I meant that I flashed it the initial time with the wrong firmware using cloudcutter. Hmm. the device stopped working right after flashing with cloudcutter. I assumed that it was because of the wrong... [Read more]
Hmm. That is new for me. I initially had a problem with a wrongly labelled N version that was actually a T. It was never possible for me to flash it with the N version until I tried the T version that... [Read more]
A few months ago I had AVATTO Bulb that came with WB2L module . Under the metal shield I found C-chip CC8000 instead of BK7231T I don’t know if it's the same chip under a different name or... [Read more]
@mcheibani To avoid this, i would recommend initially using the detach script (just cloudcut from tuya). If N profile works, then it has to be N device Same goes with T device Added after 4 [minutes]:... [Read more]
Thank you! This helped solve the issue for my old switch that I thought will need to be reflashed using the serial/soldering method. I tried again to put it in recovery mode and was able to flash it with... [Read more]
WB2L with CC8000? Can you try doing a flash read of that? Or at least try to get UART log? @zain00 [Read more]
This picture was taken 5 months ago. Sadly, I can't find the module [Read more]
Yea, same here... I once ordered BK7231U dev board from aliexpress and also got CC8000. I am not sure if I tested it more... I must find my module and test. https://www.elektroda.pl/rtvforum/find.p... [Read more]
Hello, I ran into a modul with CC8000, it is in a modul made by Leedarson based on the MAC address. On their website I was only able to find the ESP8266 version which has the same form factor and pinout... [Read more]
Very interesting. I wonder what the UART boot output is and if you can dump firmware [Read more]
I will add the UART output of the modul when I have some time to wire it up. How should I try to dump the firmware? Are there any special suggestions, instructions? thanks [Read more]
assuming it's a BK7231T clone you could use the Easy UART Flasher https://github.com/openshwprojects/BK7231GUIFlashTool [Read more]
It is Beken but it most likely has different encryption keys. I've been researching it some time ago. Maybe bootloader is different. Make sure to get full flash backup first. [Read more]