Moved defines for file extension to obk_config.h as #define OBK_OTA_EXTENSION "<file extension>" for all platfoms with OTA
Replaced "#if NO_PLATFORM_OTA" with "#ifndef OBK_OTA_EXTENSION"
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamp.kaczmarek2 wrote:Is it ready to merge?
TL;DR: In about 30 seconds, the new built-in OTA page lets OpenBeken users update firmware with a browser file upload and a simple POST request, no hosted Web App required. As one developer put it, "only" sending an HTTP POST request is enough. It solves offline flashing for single-device setups on LN882H, BK7231N/T, ESP32, W800, and more. [#21355226]
Why it matters: This gives OpenBK users a practical offline OTA path when they have only a direct device connection and no local HTTP hosting.
| Method | Needs hosted Web App | Offline-friendly | File checks | UX feedback |
|---|---|---|---|---|
| Web App OTA | Yes | Limited unless hosted locally | Better established | Better drag-and-drop |
| Built-in developer OTA page | No | Yes | Initially minimal, later improved | Initially weak, later modal-based |
Raw HTTP POST to /api/ota |
No | Yes | None by itself | None by itself |
Key insight: The breakthrough was not a new OTA protocol. It was realizing the device already accepts a standard browser upload to
/api/ota, so OpenBeken could add a lightweight built-in OTA page instead of depending on a separate web application. [#21355226]
Error:OTA:Image header check failed instead of flashing. [#21359775]fetch('/api/ota', { method: 'POST', body: file }). 1. Open the device page. 2. Select the OTA file. 3. Click the OTA button and let the device reboot. This was created for single-device, no-internet setups where hosting the Web App locally is inconvenient. [#21355226]/api/ota, with the firmware file as the request body. If the response is OK, the page can trigger /index?restart=1 to reboot. That makes the new page a thin client over the same device-side OTA mechanism already used by the Web App. [#21355226]app name, which made them harder to distinguish safely during OTA. The thread showed the RBL header layout and proposed using a real platform name in the name field so browser-side or tool-side checks can reject the wrong image earlier. [#21355867]app. [#21355803].rbl, .bin.xz, or .img, plus deeper firmware header inspection for Beken RBL files. After more discussion, the author proposed matching platform-specific names like /OpenLN882H_.*_OTA.bin/, showing a warning on mismatch, and blocking upload when the name does not fit. That gives broad coverage without heavy per-platform parsing logic. [#21359223]Already running message, 3. display OTA progress HTML on every page, not only the index page. This prevents multiple button presses while the upload is still active and reduces accidental concurrent POST requests. [#21356037]app part name and write the real platform into the RBL header name field. Test artifacts showed headers changed from app to OpenBK7231N or OpenBK7231T, making browser-side checks and tool-based checks much safer. The author confirmed this did not break the images in testing. That change turns header inspection into a useful platform discriminator instead of a weak generic marker. [#21356373].bin.xz.ota file for BL602 OTA. A tester answered this directly when asked which of several artifacts containing ota was correct. That clarification matters because BL602 builds may contain multiple output files, and selecting the wrong one defeats simple extension-based filtering. In this case, the OTA target format is the compressed .bin.xz.ota artifact, not a generic .img or plain .bin. [#21357691].rbl, LN882H uses .bin, BL602 uses .bin.xz.ota, and many other OTA-capable platforms use .img. Later, the implementation moved that mapping into per-platform configuration so the web UI could render the correct accept= value automatically. That keeps file dialogs aligned with the actual OTA artifact expected by each target. [#21360349]Error:OTA:Image header check failed. That means this platform pair has content-level verification beyond filename filtering. So even if a wrong file slips past the browser accept rule or a user forces the upload, the device-side image header check still blocks the cross-platform mistake. [#21359775]obk_config.h to centralize per-platform OTA file rules in one place. The author replaced NO_PLATFORM_OTA with #ifndef OBK_OTA_EXTENSION, then defined OBK_OTA_EXTENSION for each OTA-capable target. That lets http_fns.c use one generic line for the file input instead of a long block of platform-specific #if checks. The result is simpler maintenance and a cleaner path when adding support for a new chip. [#21360349]