logo elektroda
logo elektroda
X
logo elektroda

Web App Flash Tab: Inconsistent Status Messages for Tuya GPIO and Custom Dump Buttons

divadiow 1134 34
Best answers

How can the web app flash tab be fixed so the Download Tuya GPIO Config and Download Custom buttons show the correct status messages and completion logs?

Make the flash tab use one shared dump-start function instead of duplicated button-specific code, so all dump buttons use consistent status handling and you can rename it to `startDumpJob` for clarity [#21800819] For the full dump path, call the shared helper with explicit parameters such as `startDumpJob("full 2MB dump", "FullDump", 0, 2097152, "QIO")` instead of repeating setup in multiple places [#21801475] The Tuya GPIO config button should also route through that shared helper with arguments like `"Tuya GPIO config"` and `"TuyaConfig"`, which fixes the inconsistent text and makes the UI easier to maintain [#21800819] The revised version was reported as “way better” and approved for merge [#21801475]
Generated by the language model.
ADVERTISEMENT
  • Helpful post
    #1 21800096
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    Couldn't find an appropriate thread to hijack.

    flash tab in the web app currently says

    Code: Text
    Log in, to see the code

    when choosing Download Tuya GPIO Config. Which is not correct.

    and Download Custom doesn't give a "..ready!" log like full and tuya buttons do when complete

    Screenshot of a flash memory dump interface with progress output

    Full dump button is correct and says full is complete at the end

    Screenshot of flash memory reading interface with Full dump ready! message

    I've played with flash.vue and I hope this is a small worthy improvement. It seems OK in testing

    Screenshot of interface with message indicating Tuya GPIO config read complete
    Custom data download status showing offset 0 and length 200
    Screenshot of a tool interface for reading and downloading 2MB flash memory

    https://github.com/OpenBekenIOT/webapp/pull/249

    Added after 8 [minutes]:

    tweaked again so download buttons give "downloading..." message instead of "reading.."


    Screenshot of a tool interface downloading data from Tuya and Beken chips.

    Added after 1 [minutes]:

    read buttons continue to say "reading.."


    Interface with options to read and download device configuration
  • ADVERTISEMENT
  • #2 21800819
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12370
    good for a start, but for perfection, I'd suggest getting this code (which appears twice in two versions)

    
    
                this.fullDumpFlashStart = 0;
                this.fullDumpFlashSize = 2097152;
                this.fullDumpStyle = "xyz";
                this.doFlashDumpInternal();
    

    and putting it inside the shared function (use function arguments), currently called:
    
                this.setDumpJob("Tuya GPIO config", "TuyaConfig");
    

    I would rename setDumpJob to startDumpJob and it would be perfect.

    To be clear - it's not your fault, as the duplication was already in code (probably I was lazy), but if you are improving with LLM, then it could be done very easily as well.
    Helpful post? Buy me a coffee.
  • #3 21800824
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    thank you. I will adjust asap!
  • ADVERTISEMENT
  • #5 21801475
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12370
    Way better, I will merge it now, in future we may think about removing one string name, unless all 3 are used?
    
                this.startDumpJob("full 2MB dump", "FullDump", 0, 2097152, "QIO");
    

    Also... This is still more or less Beken only, or can it download flash for other platforms? I don't remember if and how flash read is implemented
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #8 21802316
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12370
    Nice little tool, however, I think you might have a slight issue there.

    You are basically reading memory in 0x1000 bytes blocks, right? So you read 4096 bytes, check them, next 4096 bytes, check them , etc.

    And you look in each 4096 chunk for 4 bytes - TLV header.

    But now look....

    What if TLV header is on the boundary of chunks? Let's say there are two 4096 byte chunks but "TL" is the last two bytes of first chunk, and "V" is the first byte of second chunk?

    You won't find it that way.
    Helpful post? Buy me a coffee.
  • #9 21802340
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    I was just wondering how likely that is BUT there's a bigger issue, which makes addition pointless now.

    The main reason for this venture was that OBKs RF offset does not match Tuya's for BK7238 so this was to be a way to see what the untouched Tuya RF start address was, but actually, OBK seems to overwrite TLV anyway, making a scan of the factory dump while converting device the only option to restore original RF to OBK position.

    I attach an OBK-converted BK7238 image where TLV is clearly gone. And of course the scan for TLV fails

    Screenshot of device flash management tool interface, Flash tab active
    Attachments:
    • AFTER_withOBK.bin (2 MB) You must be logged in to download this attachment.
    • BEFORE_factory.bin (2 MB) You must be logged in to download this attachment.
  • #10 21802348
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    I just think there'll be a lot of people wanting to convert BK7238 only to find they wanted their RF data but it's too late because they've put their device back together. Easy Flasher doesn't mandate a whole-flash backup and RF transplant.
  • #11 21802365
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12370
    What ovewrites it? OBK config? OBK flashvars? LittleFS?
    Also may be worth to ask @insmod
    Helpful post? Buy me a coffee.
  • #12 21802415
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    >>21802365
    Flash vars
  • #13 21802420
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12370
    flash vars are not critical, we can moev them globally elsewhere and even if we break some things for people updating, those things are not critical, i think

    Added after 11 [hours] 17 [minutes]:

    Btw is it ready to merge?
    https://github.com/OpenBekenIOT/webapp/pull/248
    Helpful post? Buy me a coffee.
  • #15 21804459
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    bum.

    ota.vue is treating _gz. and _ota. as variants

    eg
    OTA interface screenshot with warning about incompatible update file variant

    I'm away for the weekend so don't have everything with me, but here's what I think will sort the issue. This is real test on W800

    OTA update interface with selected file OpenW800 1.18.245 and chipset W800

    thoughts?
    https://github.com/OpenBekenIOT/webapp/commit/19d776eed832ca2c7f4d7208c05bfc458a7a0be9

    I can test all scenarios in a day or two if it can wait. Users can still ignore the warning and flash for now...
  • Helpful post
    #16 21804569
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12370
    I think you can do it more efficiently. I think you can ask LLM to fetch whole list of files, put it to JSON or anything, and then use "test driven development" to figure out correct regular expression.

    It's all within current LLM abilities, so it should be a fun thing to try.

    Futhermore, you can test it all without vue, just fully in html/js page on disk or in the editor/playground.
    Helpful post? Buy me a coffee.
  • #17 21804843
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    p.kaczmarek2 wrote:
    Futhermore, you can test it all without vue, just fully in html/js page on disk or in the editor/playground.


    yes. good point. I was already using node.js to override and use local ota.vue but it still relied on real device

    but could go further to simulate /api so I can choose platform before ota.vue. like this:

    ota.vue interface simulating API with selected chipset and firmware version
    OTA update interface for BK7231N chipset with firmware file loaded

    im not finding any incorrect warnings with code change in PR, but sounds like you think it can be better still (which I don't doubt)

    OTA interface with selected file OpenRDA5981_1.18.245_ota.img

    OTA interface for BK7231T chipset with powerMetering firmware file loaded.
    Screenshot of OTA interface for BK7231T showing firmware variant mismatch error.
    Screenshot of OTA interface for BK7231T chipset with 'berry' file variant mismatch error

    etc
    would be nicer if the variant case in warnings matched the file though

    Added after 7 [minutes]:

    code if curious

    Code: Python
    Log in, to see the code


    http://localhost:8000/
    Attachments:
    • ota_harness_live_github.zip (8.89 KB) You must be logged in to download this attachment.
  • #18 21804889
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    more options

    ota.vue UI for simulating OTA firmware with BK7231T and irRemoteESP config
    Attachments:
    • ota_harness_live_github_debug_variants.zip (487.74 KB) You must be logged in to download this attachment.
  • #20 21806025
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12370
    So, it's ready to merge? Let me know so I can be certain. Thanks for the PRs so far!
    Helpful post? Buy me a coffee.
  • #21 21806037
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    p.kaczmarek2 wrote:
    So, it's ready to merge?

    I reckon yes. I've tested loads with fake api thing that lets me choose platform and variant before using testing ota file behaviour with real ota.vue.

    Added after 35 [minutes]:

    on a refactor and just looking into supportsLittleFS in ota.vue

    OTA update interface for LN882H chipset with file options and action buttons.

    this is always disabled so can be cut completely?

    https://github.com/OpenBekenIOT/webapp/blob/0...32c03c696a004c563713/vue/ota.vue#L76C9-L76C25
  • #22 21809942
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    reviewed info.vue

    -changed uptime in seconds to approximate years/months/days count (better than only seconds?)
    -standardised capitalisation, revised wording, grammar - more formal, neutral tone
    -added missing chipsets to template drop-down filter
    -made update check variant-aware so update available line now only shows if there really is an update (variants would always show latest before)
    -encourage template detail completion more obviously before Elektroda posting

    -placeholder text in export template box instead of 'qqq'
    Template export form with empty text box and link to Elektroda

    -update CHT8305 to CHT83XX in templates and pin list
    -add missing pinrolenames

    https://github.com/OpenBekenIOT/webapp/pull/257

    Device configuration panel with network details and pin settings
  • #23 21813933
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    I've extended the review to the rest of the web app. This is a WIP. It's mostly consistency, grammar, spelling, switching to a more formal tone.

    current state
    https://github.com/OpenBekenIOT/webapp/compar....divadiow:OpenBekenIOT-webapp:vueoverhaul_all

    questions:
    -US-English or British-English preferred, if at all (US-English seemed to be the preference)?
    -Title Casing for button text or sentence? (accepted PR for info.vue was sentence)
    eg
    Code diff showing HTML buttons for downloading and copying a template

    -Single 'quotes' or double "quotes", where used?
    -GPIO Doctor or GPIO Finder or both? GPIO Finder is more accurate I think, the 'Dr' doesn't actually diagnose or fix(?), but it's become known as the GPIO Dr.
  • #24 21819813
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    OK.

    Logs
    Before
    OpenBK system log interface showing MAIN and MQTT entries
    After
    Screenshot of a web interface log panel with system status messages
    bit of text tweaking.

    Status
    Before
    Device status interface with “Off” button for channel 0:0 role relay
    After
    Channel debug interface in OpenBeken software showing relay role and toggle switch

    text tweaking

    OTA
    Before
    OTA interface with file selection, buttons, and firmware download link
    After
    OTA interface for BK7231N with file upload option and reboot button
    text tweaking, spacing, soften blue border

    Flash
    Before
    Screenshot of device flash management interface with config read/write options
    After
    Screenshot of the Flash tab in the OpenBeken interface
    text tweaking, remove duplicate "no file selected" type status, disable flashvars for non-BK7231T/N (maybe it should be removed or extended to support more platforms?
    Table with read and download options for flash configuration on BK7231N/BK7231T

    Tools
    Before
    Tool panel UI with options for LED controls, power metering, and device group settings.
    After
    Screenshot of Tasmota's configuration tools tab with various test and utility sections.

    text tweaking

    Import
    Before
    OpenBeken import interface for templates or Tuya firmware
    After
    Configuration import screen in OpenBeken interface with four sections

    Filesystem
    Before
    LittleFS filesystem interface with listed files and file operation options
    After
    Editing platformio.ini file in LittleFS filesystem web interface
    text tweaking, spacing, label and explain target folder, use real IP in LittleFS files line

    GPIO Doctor/Finder
    Before
    Screenshot of GPIO Doctor tool showing GPIO pin settings and functions
    After
    GPIO Doctor interface showing pin list with controls for input/output settings

    Text tweaking, remove ) from "Clear" buttons (would full "pull-up" and "no pull-up" be better?)
    “Clear)” button next to red text “ow”, part of a user interface

    About
    Before
    OpenBeken web interface with About tab and app description in view
    After
    About tab in OpenBekenIOT web interface with app description

    text tweaking

    https://github.com/OpenBekenIOT/webapp/pull/261

    Added after 9 [hours] 32 [minutes]:

    redid spacing and order of filesystem buttons. added "Format LittleFS" - there doesn't seem to be a way to delete folders, only files.

    LittleFS file manager interface with format, upload, and editing options.

    https://github.com/OpenBekenIOT/webapp/pull/2...nges/90d6a1a0c61b5ca0d37a9637ee3a650c6d0dc663
  • #25 21821723
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    soliciting for feedback. love/hate/disagree etc
  • Helpful post
    #26 21822449
    insmod
    Level 31  
    Posts: 1353
    Help: 160
    Rate: 425
    Looks fine overall, but please rewrite filesystem header to be more compact.

    General suggestions:
    Littlefs resize function in ui
    Align gpio doctor pins like in native ui
    Align import textareas (height)
    Align channel types (config page)
    Mention BK7238 in restore rf config
  • Helpful post
    #27 21822457
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12370
    New "Drop file(s)" font color has worse contrast than the old one, please revert that black one.
    Helpful post? Buy me a coffee.
  • #28 21822479
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    Thanks for feedback! All good. Will make changes

    Added after 2 [hours] 54 [minutes]:

    OpenBeken filesystem interface with autoexec.bat script being edited

    LittleFS file management interface in browser with open test folder and .bat files

    View of autoexec.bat file editor in OpenBeken interface via web browser

    no resize yet

    Added after 1 [hours] 21 [minutes]:

    fewer borders. add Resize LittleFS

    OpenBK interface on Filesystem tab with file drop area and action buttons visible Screenshot of LittleFS file management interface in web browser

    Browser dialog box with input for LittleFS filesystem size in bytes Confirmation popup for resizing LittleFS in web browser interface
  • #29 21822802
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12370
    Is this responsive? For various screen sizes.
    Helpful post? Buy me a coffee.
  • #30 21823751
    divadiow
    Level 38  
    Posts: 4859
    Help: 424
    Rate: 860
    yes. it should be more flexible. I'll capture a demonstration.

    lol, just trying things out:

    GPIO Doctor interface with pin list and configuration buttons

Topic summary

✨ The discussion addresses inconsistencies in the status messages displayed on the Flash tab of a web application related to firmware dumping functions. Specifically, when selecting "Download Tuya GPIO Config," the app incorrectly shows "reading full dump...." followed by "Full dump ready!" which is misleading. Additionally, the "Download Custom" button lacks a completion message similar to the other buttons. Modifications to the flash.vue component were proposed and tested to improve user feedback by adjusting the status messages: changing "reading..." to "downloading..." for download buttons and ensuring all buttons provide a clear completion log. A related pull request (PR #249) on the OpenBekenIOT/webapp GitHub repository implements these improvements, enhancing clarity and consistency in the UI during firmware dump operations.
Generated by the language model.

FAQ

TL;DR: The Web App’s Flash tab now distinguishes “downloading…” vs “reading…”, and the full dump is 2 MB. “Way better, I will merge it now.” [Elektroda, p.kaczmarek2, post #21801475] Why it matters: It prevents misflashes and helps users back up RF data correctly on BK7-series chips.

Quick Facts

What exactly changed in the Flash tab status messages?

Download actions now log “downloading…” instead of “reading…”, while read actions continue to log “reading…”. This fixes the earlier mismatch where the Tuya GPIO and Custom downloads could show read-style messages and Custom lacked a final ready log. The Full Dump already confirmed completion correctly. [Elektroda, divadiow, post #21800096]

How do I trigger a proper full dump from the Web App?

Use the Full 2MB dump action. Internally it calls startDumpJob with parameters like name, job type “FullDump”, start=0, size=2097152, mode="QIO". Expect a completion message when the dump finishes. This maps to a 2,097,152‑byte image suitable for full backup. [Elektroda, p.kaczmarek2, post #21801475]

What is startDumpJob and why was it introduced?

startDumpJob centralizes dump setup to remove duplicated logic. It takes arguments for label, job type, start offset, size, and flash mode, then starts the dump. This refactor improves maintainability and ensures consistent status messaging across Full, Tuya GPIO, and Custom operations. [Elektroda, divadiow, post #21801456]

Is flash reading limited to Beken (BK7) devices?

The workflow is currently BK7‑centric. The UI now greys out certain RF/TLV tools when the detected chipset does not start with “bk7”, signaling features are scoped to BK7. Broader platform read support remains an open consideration. [Elektroda, divadiow, post #21802297]

Why might BK7238 TLV scanning fail after converting to OBK?

After conversion, the TLV block can be gone, so a scan returns nothing. Screenshots in the thread show a converted BK7238 image with TLV missing, implying the original factory TLV was overwritten during the process. [Elektroda, divadiow, post #21802340]

What overwrites the TLV/RF area on BK7238 during conversion?

Flash vars overwrite it. An expert confirmed, “Flash vars” are the component responsible for overwriting, which explains missing TLV post‑conversion and failed TLV detection. [Elektroda, insmod, post #21802415]

How can I avoid losing RF data when converting BK7238 devices?

Back up the entire flash before conversion. Users often reassemble devices only to realize they need RF, and Easy Flasher does not require a full backup by default. Do a full 2 MB dump first to preserve RF data. [Elektroda, divadiow, post #21802348]

Is the fix for inconsistent messages merged?

Yes. The maintainer reviewed the improvements and stated, “Way better, I will merge it now,” referring to the startDumpJob refactor and parameterization shown with a Full 2MB example. [Elektroda, p.kaczmarek2, post #21801475]

What is Tuya in this context?

Here, “Tuya” refers to the Tuya GPIO configuration dump/download option in the Flash tab. The change ensures its button shows “downloading…” while read actions retain “reading…”, aligning logs with the operation. [Elektroda, divadiow, post #21800096]

What is OpenBeken (OBK) in this thread?

OpenBeken is the project whose Web App received PRs that fixed messaging and added BK7‑specific tooling. The maintainer discussed merge and future string cleanup around startDumpJob, indicating active development. [Elektroda, p.kaczmarek2, post #21801475]

Why is chunk size important when scanning for TLV headers?

The scan reads 0x1000‑byte (4096‑byte) chunks. A TLV header crossing chunk boundaries can be missed if you only check within each chunk. Use overlapping or carry‑over buffers to avoid boundary misses. “You won’t find it that way.” [Elektroda, p.kaczmarek2, post #21802316]

Can we move flash vars to protect RF/TLV regions?

Yes. The maintainer noted flash vars are not critical and can be moved globally elsewhere. Even if some updates break minor things, the trade‑off favors preserving RF data integrity across updates. [Elektroda, p.kaczmarek2, post #21802420]

How do I perform a clean Full 2MB dump (three steps)?

  1. Open Flash tab and select the Full 2MB dump action.
  2. Confirm it runs startDumpJob with start=0, size=2097152, mode="QIO".
  3. Wait for the completion message, then save the file. [Elektroda, p.kaczmarek2, post #21801475]

Does the Custom download now show a completion message?

Custom previously lacked a final “ready!” log. With the update, downloads show “downloading…”, bringing parity with other buttons. The Full Dump already indicated completion correctly, so user feedback is now consistent. [Elektroda, divadiow, post #21800096]

Will string names for dump modes be simplified later?

Yes, the maintainer suggested possibly removing one string name in the future, since all three may not be required. That would further streamline startDumpJob usage and UI text. [Elektroda, p.kaczmarek2, post #21801475]

What’s a safe default if I’m unsure about my platform support?

If the UI greys out BK7‑specific tools, avoid those steps and do a standard full dump first. That preserves data while you verify hardware support and tool compatibility. Then proceed with targeted operations. [Elektroda, divadiow, post #21802297]
Generated by the language model.
ADVERTISEMENT