logo elektroda
logo elektroda
X
logo elektroda

Having problems flashing OpenBK7231T OTA on a device that's already been flashed with EspHome (tuya)

nealjka 6993 9
Best answers LABEL_AI_GENERATED

How can I reflash a BK7231T device from EspHome OTA to OpenBK7231T without soldering, and what firmware format/tool should I use?

Yes, you can reflash it OTA, but you need to convert the OpenBK `.rbl` firmware to `.uf2` with `ltchiptool`/LibreTiny and then upload that file, rather than using a raw `.bin` or a simple bin2uf2 converter [#20446269][#20490588] For BK7231T, one working command was `ltchiptool uf2 write -f bk7231u -b generic-bk7231t-qfn32-tuya -o openbkt.uf2 ';;;download;OpenBK7231T_1.15.440.rbl'` [#20490588] Another user reported success using the Python module form, e.g. `python -m ltchiptool uf2 write -b cb2s -o openbkt.uf2 OpenBK7231N_1.17.135.rbl=device:download`, with the `.rbl` file placed in the launch folder [#20595855][#20616185] One reply also noted that `ltchiptool uf2 info` on a raw `.rbl` gives an “Invalid Magic” error, which confirms the `.rbl` itself is not already UF2 and must be converted first [#20448951]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • OpenBK7231T OTA via ESPHome web service may be impossible

    #1 20445408
    nealjka
    Level 2  
    Posts: 3
    Hi, I have successfully flashed OpenBK7231T using tuya-cloudcutter and all is working well. Teardown submitted.

    However, with some earlier attempts with the same bulb, I flashed esphome using tuya-cloudcutter. I could not get the right config working with esphome and so would now like to re-flash it with OpenBK7231T. Unfortunately, I don't have any soldering skills so I need to do this OTA.

    I can access the device using the "Fallback wifi hotspot" (192.168.4.1) and the via esphome server page. However when I try to use any of the firmware from the OpenBK7231T releases the flashing fails with:

    "Update Failed: ard=8,uf2=2"

    I'm presumed this means that the esphome requires the firmware to be in the uf2 format. So I tried running the running the OpenBK7231T_UG_1.15.454.bin file through a bin2uf2 converter without success, this time the esphome ota fails with:

    "Update Failed: ard=11,uf2=3"

    Should it in theory be possible to flash OpenBK7231T using the esphome OTA web service or is flashing to esphome a one-way street?

    Does anyone have any suggestions on how I can convert/flash any of the OpenBK7231T releases using the esphome web service.

    Thanks
  • ADVERTISEMENT
  • #2 20446269
    ferbulous
    Level 18  
    Posts: 419
    Help: 8
    Rate: 56
    On libretuya, convert the openbk.rbl firmware to .uf2 using lchiptool, then upload to your web server.

    #convert rbl to uf2
    ltchiptool uf2 write -f bk7231n -b generic-bk7231n-qfn32-tuya -o openbkt.uf2 download;OpenBK7231N_1.12.50.rbl
  • BK7231N family mismatch and RBL file error

    #3 20448951
    nealjka
    Level 2  
    Posts: 3
    Thanks, unfortunately, I couldn't get that command to work.

    I tried using "download;OpenBK.....rbl" and also "download;./OpenBK.....rbl" as per screenshot below.
    I tried using sudo, but got the same Permission Denied.

    Also does it matter that it's using bk7231n and not bk7231t?
    I tried changing it to use bk7231t and it errors with "Family not found"

    Having problems flashing OpenBK7231T OTA on a device that's already been flashed with EspHome (tuya)

    Added after 25 [minutes]:

    I also tried

    ltchiptool uf2 info OpenBK7231T_UG_1.15.472.rbl

    which returned
    E: ValueError: Invalid Magic 1 (b'RBLx00')
    E: |-- File "/home/username/.local/lib/python3.8/site-packages/uf2tool/models/block.py", line 76, in decode
  • ADVERTISEMENT
  • #4 20449981
    ferbulous
    Level 18  
    Posts: 419
    Help: 8
    Rate: 56
    nealjka wrote:
    Also does matter that it's using bk7231n and not bk7231t?


    I'm not quite sure, but it's better to stick with the device type scheme (T or N)
    Mostly just following the instruction posted by the dev, works well for me on windows
  • Use bk7231u family flag for bk7231t OTA

    #5 20490588
    skrc1
    Level 6  
    Posts: 8
    Rate: 15
    for bk7231t -> -f bk7231u

    ltchiptool uf2 write -f bk7231u -b generic-bk7231t-qfn32-tuya -o openbkt.uf2 ';;download;OpenBK7231T_1.15.440.rbl'

    ltchiptool uf2 info openbkt.uf2
    I: Family: BK7231U / Beken 7231U/7231T
    I: Tags:
    I: - BOARD: generic-bk7231t-qfn32-tuya
    I: - DEVICE_ID: 7b4bd984
    I: - BUILD_DATE: 12ac1264
    I: - OTA_VERSION: 01
    I: - DEVICE: LibreTuya
    I: - LT_HAS_OTA1: 00
    I: - LT_HAS_OTA2: 01
    I: - LT_PART_1:
    I: - LT_PART_2: download
    I: Data chunks: 1868
    I: Total binary size: 478016
  • #6 20595855
    dlarytm
    Level 1  
    Posts: 1
    >>20448951
    it's a bit late but it worked for me when I used ltchiptool from python. The syntax was python -m ltchiptool uf2 write -b cb2s -o openbkt.uf2 openBK7231N_1.12.50.rbl. The rbl file I had downloaded into the folder where I launched ltchiptool from.
  • ADVERTISEMENT
  • #7 20616185
    AgranBox
    Level 4  
    Posts: 5
    Rate: 2

    I needed to flash a device with kickstart-bk7231n firmware with OpenBK7231N firmware. The command helped me:
    python -m ltchiptool uf2 write -b cb2s -o openbkt.uf2 OpenBK7231N_1.17.135.rbl=device:download
  • Need uf2 firmware downloads for LibreTiny migration

    #8 20676670
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    I am trying to get one of my devices to OpenBK using the ltchiptool tool and I am not having any luck.
    I always get this error:

    Error: Invalid value for '-b' / '--board'

    Not sure how to get past that error. Anyone have any idea?

    Is there a T and N version of uf2 files around that one can download?

    @p.kaczmarek2 - maybe it will be good to have some uf2 firmware on the GitHub as well? Not the latest version but some versions that users can download and upload so migration from LibreTiny is easier.
  • ADVERTISEMENT
  • #10 20839345
    brianroy86
    Level 6  
    Posts: 31

    Thank you so much for doing that, I couldn't get it to convert but your firmware saved the day!

Topic summary

LABEL_AI_GENERATED
The discussion revolves around difficulties in flashing OpenBK7231T firmware OTA on a device previously flashed with ESPHome using tuya-cloudcutter. The user successfully accessed the device via a fallback Wi-Fi hotspot but encountered errors during the firmware update process, specifically "Update Failed: ard=8,uf2=2" and "Update Failed: ard=11,uf2=3." Various responses suggest using the ltchiptool to convert the OpenBK firmware from RBL to UF2 format, with specific commands provided. Users also discuss the importance of using the correct device type (BK7231T vs. BK7231N) and share links to repositories containing pre-converted UF2 firmware files. Some users report success with specific command syntax and configurations, while others seek additional resources for easier migration from LibreTiny to OpenBK.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT