logo elektroda
logo elektroda
X
logo elektroda

[BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

p.kaczmarek2 197826 1308
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • #1291 21787297
    divadiow
    Level 37  
    Negative. My tests were not with Easy Flasher because I know the T protection gets in the way.

    Besides, this wouldn't have made sense if I was:

    divadiow wrote:
    I am seeing switches between BK7231S_1.0.5 and BK7231S_1.0.6 BL
  • ADVERTISEMENT
  • #1292 21787326
    p.kaczmarek2
    Moderator Smart Home
    Interesting, so you probably flashed the new bootloader correctly and the issue arise only if overwrite it with non functional data.
    Helpful post? Buy me a coffee.
  • #1293 21787335
    divadiow
    Level 37  
    Well indeed! I've flashed loads from 0x0 now. Very interesting.
  • ADVERTISEMENT
  • #1294 21796922
    divadiow
    Level 37  
    divadiow wrote:
    and I guess all the new variants need catering for too or users will OTA to default release?


    just playing with this https://github.com/OpenBekenIOT/webapp/compare/main...divadiow:OpenBekenIOT-webapp:hlwota

    the intention being that OTA now prefers Open<chip>_<ver>_<variant>.rbl (chip + variant) based on the device’s build suffix, and falls back to Open<chip>_<ver>.rbl (generic) if no variant asset exists.

    seems OK so far, but needs more testing.

    Dropdown list showing OTA files for OpenBK7231N, versions from 1.18.230 to 1.18.233_sensors
    OTA interface showing BK7231N chipset and file OpenBK7231N_1.18.233_irRemoteESP.rblOTA interface with selected file OpenBK7231N_1.18.233.rbl for upgrade

    OTA interface for BL602 chip with selected update file and its sizeOTA interface with selected OpenBL602_1.18.209_OTA.bin.xz.ota file


    OTA interface with BK7238 chipset and OpenBK7238_1.18.223.rbl file selected
    let's you go from generic to variant at the moment
    OTA interface with selected file BK7238_1.18.233_irRemoteESP.rbl
    OTA interface for BK7238 with buttons, file selector, and download link

    currently with hard-block if choosing different variant

    OTA error: selected file powermetering doesn't match device variant sensors

    doesn't cater for the _ALT variants though as they're not as <buildver>_ALT in /api/info

    Added after 51 [minutes]:

    ESP+BL602 ota extension for variants https://github.com/divadiow/OpenBekenIOT-webapp/commits/hlwota/

    OTA interface with OpenESP32S2_1.18.233_4M.img file selected for download
    OTA interface with file selection and ESP32 version information

    OTA interface with file upload field and chipset version details displayed
    OTA interface with chipset info and option to upload .ota file

    should I pursue this or is the code rubbish?

    Added after 1 [hours] 1 [minutes]:

    latest commit doesn't allow any variant cross-flashing. legacy wrong chipset "invalid ota file was selected" warning remains intact

    Selected OTA file is a generic build for BK7231N; device needs irRemoteESP variant
    OTA interface showing error after selecting mismatched OpenBK7238 file for BK7231N
    OTA error: file variant powermetering does not match device irRemoteESP

    OTA interface with selected file OpenBL602_1.18.209_OTA.bin.xz.ota
    OTA error: variant berry does not match this device (generic build)
    OTA screen with OpenBL602_1.18.209_OTA.bin.xz.ota file and device variant berry
  • #1295 21797174
    max4elektroda
    Level 22  
    divadiow wrote:
    latest commit doesn't allow any variant cross-flashing

    Personally I think this is too much. I think a warning would be fine, or a switch "allow change in variants".
    Just imagine I realize I used the wrong variant or added a new sensor and can't change to the needed file.

    Just as a possible extension, no idea if/how to realize (but my PR to include the defines in a build might be a start): The top version would be to extract the drivers per variant so the user can see/decide if the variant fits the requirements.
  • ADVERTISEMENT
  • #1296 21797177
    divadiow
    Level 37  
    max4elektroda wrote:
    Personally I think this is too much. I think a warning would be fine, or a switch "allow change in variants".
    Just imagine I realize I used the wrong variant or added a new sensor and can't change to the needed file.


    I agree. I had imagined directing people to the other OTA option in main gui, but why make it unnecessarily hard. A warning note would be enough

    Added after 1 [hours] 2 [minutes]:

    Relaxed.

    Warning generic->variant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Warning variant->generic
    Selected OTA file is a generic build; device requires irRemoteESP variant.
    warning variant->variant
    OTA file with variant berry selected but does not match device variant irRemoteESP.
    block still for wrong platform
    Error: invalid OTA file selected during firmware update attempt
  • #1297 21797229
    max4elektroda
    Level 22  
    Thanks, this change really improves the usage in a very helpful way!
  • #1298 21797300
    divadiow
    Level 37  
    cool. the variant OTA thing has been on my mind for a while + ESPs were not listed at all. I just hope the code is OK. I'll review code comments and do more testing/checking.

    Added after 1 [hours] 4 [minutes]:

    it seems LN882H only matches on file extension so will look to add filename pattern check too

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    Added after 2 [hours] 1 [minutes]:




    LN882H
    wrong chipset
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    LN non-OTA
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    correct LN OTA
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    BL602
    variant listing + accept variant OTA
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    warn on variant to generic
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    generic listing + warn on generic to variant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    warn on variant to variant (future-proofing)
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    no warning on same to same generic
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    BK7238
    variant listing + accept variant OTA
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    warn on variant to generic
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    generic listing + warn on generic to variant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    no warning on same to same generic
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    wrong chipset
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    BK7231N
    variant listing + accept variant OTA
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    warn on variant to variant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    warn on variant to generic
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    generic listing + warn on generic to variant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    no warning on same to same generic
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    wrong chipset
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    PR if this looks OK: https://github.com/OpenBekenIOT/webapp/pull/248
  • #1299 21802662
    p.kaczmarek2
    Moderator Smart Home
    The NOTE (warning) should be orange, not red, red is same as error. OBK is very user friendly and we should try our best to maintain it, so all error messages are clean and readable.
    Helpful post? Buy me a coffee.
  • #1301 21802788
    p.kaczmarek2
    Moderator Smart Home
    Even better than before, merged. Any other easy improvements at hand?
    Helpful post? Buy me a coffee.
  • #1302 21802803
    divadiow
    Level 37  
    yay cool, thanks! Hope I didn't miss anything major.

    "invalid" class style wasn't committed ;)

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

    note showing on live device now
    OTA interface screenshot with selected OpenBK7231T file and compatibility warning

    Added after 33 [seconds]:

    p.kaczmarek2 wrote:
    Any other easy improvements at hand?

    not thought of any yet, but probably

    Added after 12 [minutes]:

    now showing ESP32 OTA variants available

    OTA interface with file dropdown menu and drop area for uploading a file

    OTA update screen with ESP32C2 chipset info and selected firmware image file
  • #1303 21802821
    p.kaczmarek2
    Moderator Smart Home
    Can you help me test and review this by @max4elektroda https://github.com/OpenBekenIOT/webapp/pull/225?
    Helpful post? Buy me a coffee.
  • #1305 21802869
    insmod
    Level 30  
    In ALT builds, _ALT is appended to version since 1.18.235
    OpenBK7231N_ALT_1.18.244.rbl file loaded into OTA system
  • #1306 21802968
    divadiow
    Level 37  
    ah OK.

    It was only matching on <version>_<variant>.rbl but the _ALT rbls are eg OpenBK7231T_ALT_1.18.244.rbl whereas actual variants are eg OpenBK7231N_1.18.244_hlw8112.rbl

    with https://github.com/OpenBekenIOT/webapp/commit/9c923cc14550d472a5c21b70acb7043dbd671ff9

    _ALT to ...
    Selected OTA file OpenBK7231N_ALT_1.18.244.rbl with size 505568 bytesError message after attempting to upload OTA file OpenBK7238 to BK7231N device Screenshot with error message when selecting OTA file of mismatched variant. Selected OTA file OpenBK7231N_1.18.233.rbl mismatches current device ALT variant

    non _ALT to ...
    OTA file OpenBK7238_1.18.233.rbl selected but error message is shown. Uploaded OTA file is OpenBK7231N_ALT_1.18.244.rbl; a mismatch warning appears regarding the variant. Error message during OTA upload attempt for BK7231N chipsetOTA update interface for BK7231N chipset with selected .rbl file version

    Added after 1 [minutes]:

    this does treat _ALT as a variant though rather than a generic/base release in its own right

    Added after 11 [minutes]:

    is const preferred over let to keep same as others?

    https://github.com/OpenBekenIOT/webapp/commit/08f8a52f2d3618b2a27c973b242b984d9d6dc8ad
  • #1307 21803000
    p.kaczmarek2
    Moderator Smart Home
    "const" means that you won't change variable later, so it's usually preferred, unless you are reassigning value to that variable, then you use "let". Still, I don't really follow this myself, it is just improving readability of the code. Also, if you declare as const, but later try to reassign the value, it will show error in console.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #1308 21803307
    divadiow
    Level 37  
    p.kaczmarek2 wrote:
    Can you help me test and review this by @max4elektroda https://github.com/OpenBekenIOT/webapp/pull/225?


    cool. it found some stuff in the range I gave it

    Tasmota configuration interface with network scan results and diagnostic tools

    the gateway addresses returned aren't right though, which stopped further testing

    Code: Text
    Log in, to see the code


    even when using Windows hot-spot the device states gateway and dns is 192.168.0.1

    http://192.168.137.65/cm?cmnd=STATUS%205

    Code: Text
    Log in, to see the code


    powershell check a few and

    Code: Text
    Log in, to see the code


    this doesn't appear to change with a static

    Network interface settings with IP address, subnet mask, DNS, and gateway values.

    Added after 34 [minutes]:

    my 1 Tasmota device by comparison

    Code: Text
    Log in, to see the code
📢 Listen (AI):

Topic summary

The discussion centers on the development and testing of an open-source firmware project for the BK7231T microcontroller, focusing on creating a cross-platform mini HTTP server, web-based pin configuration, MQTT integration, and Home Assistant compatibility. The project includes a Visual Studio project for Windows and firmware flashing tools like Beken Writer and a Python-based uartprogram. Users report challenges with flashing devices, including issues with firmware size limits (956KB), UART converter compatibility, and power supply stability during flashing. Solutions include using specific UART adapters (e.g., FT232R, CP2102), resetting devices via the CEN pin instead of power cycling, and trimming firmware binaries. The firmware supports devices with BK7231T and BK7231N chips, with ongoing work to add PWM dimmer support, BLE, TuyaMCU protocol integration, and OTA updates. Various smart devices such as WB2S/WB3S modules, smart plugs, LED bulbs, and switches from brands like MOES, Nedis, Hama, and Calex are tested. Users share detailed hardware teardowns, pinouts, and flashing procedures. MQTT topic naming issues related to MAC address usage were identified and fixed. The project emphasizes community collaboration, with suggestions for a Discord server to enhance real-time communication. Additional tools and SDK improvements, including CMake support and BLE integration, are under development to facilitate firmware building and device support expansion.
Summary generated by the language model.
ADVERTISEMENT