logo elektroda
logo elektroda
X
logo elektroda

Multi-platform IoT firmware supporting up to 32 platforms - OBK 2025 summary

p.kaczmarek2 3444 80

TL;DR

  • OpenBeken/OBK is an open-source Wi‑Fi firmware for building-automation devices like relays, LED controllers, thermostats, energy meters, and sensors.
  • It flashes over UART, then uses auto-detected GPIO templates, Berry scripting, Home Assistant integration, REST hosting, and a simulator to speed setup and testing.
  • The project now supports 32 platforms and lists 817 devices, with separate binaries for families such as BK7231, ESP32 variants, Realtek, Winner Micro, and more.
  • Online builds, automatic OTA downloads from GitHub, and GitHub-run tests let developers compile, deploy, and flag bad commits without local toolchains.
  • Some platform features still vary: certain OTA paths are broken, WPA3 must be manually enabled on some ESP8266 builds, and several PWM or sleep features are partial.
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • #61 21877416
    insmod
    Level 31  
    Posts: 1367
    Help: 163
    Rate: 429
    >>21877411
    I originally meant about if ret == 0, but i've double-checked and saw that it's freed in client thread.
  • ADVERTISEMENT
  • #62 21877422
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14505
    Help: 651
    Rate: 12506
    Are os_malloc and malloc different on any platform, and if so, what's the difference?
    Helpful post? Buy me a coffee.
  • #63 21877426
    insmod
    Level 31  
    Posts: 1367
    Help: 163
    Rate: 429
    >>21877422
    In some it may be separate, malloc is default newlib allocator, os_malloc - freertos one.
  • ADVERTISEMENT
  • #64 21878054
    max4elektroda
    Level 24  
    Posts: 746
    Help: 48
    Rate: 184
    I finally managed to implement some feature to allow logging to LFS: PR #2076.

    Wasn't a easy as I thought on the first look, because writing to lfs is slooow and would crash with an IRQ watchdog if writing more than a few lines.

    So now it will use an own thread for flushing the message buffer to lfs.

    It allows for "startup logging" with command

    logStartup2lfs [seconds- default 10]  

    Will logg all further starts for the givven number of seconds to lfs (as long as there's free space in lfs).
    So if done, disable with
    logStartup2lfs 0 


    During operation you can use
    log2lfs [seconds - default 10]

    to write messages to LFS for this number of seconds.
    Might be stopped earlier by calling
    log2lfs 0



    Screenshot of a web “Filesystem” page editing /messageLog_2.txt, with file list and log text on the right.
    Screenshot of LittleFS Filesystem page listing files and editing /startupLog_1.txt log

    Feel free to test or propose changes - I only checked with W800 and Linux simulator for now.
  • #65 21878107
    DeDaMrAz
    Level 22  
    Posts: 600
    Help: 34
    Rate: 127
    @max4elektroda

    I remember there was a concern about flash wear so I would suggest you try this on modules with external flash chips just in case.
  • #66 21878160
    max4elektroda
    Level 24  
    Posts: 746
    Help: 48
    Rate: 184
    I would see this as a debugging feature only, not as a regular one.
    Idea came back after issue 2064 where the user couldn't see the logs easily and he assumed a startup error when in WiFi client mode. With this feature he could have setup logging to lfs, insert his WiFi credentials and after a start in regular mode switching to safe mode again see the logs.
    For all other cases we have TCP logging which can be easily saved, so we could agree it only makes sense for startup, not during operation.
  • ADVERTISEMENT
  • #67 21882081
    divadiow
    Level 38  
    Posts: 4936
    Help: 431
    Rate: 876
    p.kaczmarek2 wrote:
    @insmod can you review?
    https://github.com/openshwprojects/OpenBK7231T_App/pull/2051/changes
    This seems a bit bloated for me, but maybe I'm wrong. It's a #define, after all. So transparent to compiler after initial pass.


    I think the actual runtime changes are pretty narrow. Maybe what makes the PR look larger is the supporting test scaffolding in the simulator, which I added first so the allocation-failure paths could be reproduced and validated deterministically. Or do you mean a different kind of bloat?

    I've resolved merge conflicts. No worries if you don't think these are good changes and PR should be closed :)
  • #68 21882143
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14505
    Help: 651
    Rate: 12506
    @max4elektroda make log2lfs byte and disable it by default and I think it's ready to be merged

    Added after 10 [hours] 26 [minutes]:

    @divadiow are you using windows?
    Helpful post? Buy me a coffee.
  • #69 21882339
    divadiow
    Level 38  
    Posts: 4936
    Help: 431
    Rate: 876
    p.kaczmarek2 wrote:
    @divadiow are you using windows?


    Yes.

    Have Ubuntu on a laptop or two
  • #70 21882353
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14505
    Help: 651
    Rate: 12506
    I am experimenting with some simplest windows wrapper for build scripts:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/2086
    So basically single .bat can build binary. Currently for ESP32 and BK7231, not tested.
    Helpful post? Buy me a coffee.
  • #71 21882497
    divadiow
    Level 38  
    Posts: 4936
    Help: 431
    Rate: 876
    I see. OK. but wasn't @DeDaMrAz's Docker creation for the same? maybe this is even easier though?
  • #72 21882543
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14505
    Help: 651
    Rate: 12506
    Well.... I haven't managed to run this Docker thing on my Windows 10 yet. It seems to be making lots of issues for me, both older and newer versions, due to the different reasons.
    Helpful post? Buy me a coffee.
  • #73 21882627
    divadiow
    Level 38  
    Posts: 4936
    Help: 431
    Rate: 876
    OK.

    Cloned main app and OpenBK7231T submodule only.

    Code: Text
    Log in, to see the code


    Code: Text
    Log in, to see the code


    didn't troubleshoot further
  • #74 21882640
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14505
    Help: 651
    Rate: 12506
    Looks like Berry prebuild is missing. You have a good point. I didn't realize that.
    Helpful post? Buy me a coffee.
  • #75 21883263
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14505
    Help: 651
    Rate: 12506
    How is it now, @divadiow ? I also added ESP8266.
    Helpful post? Buy me a coffee.
  • #76 21883294
    divadiow
    Level 38  
    Posts: 4936
    Help: 431
    Rate: 876
    started again. same clone and submodule as before.

    Code: Text
    Log in, to see the code


    BK7231N
    Code: Text
    Log in, to see the code


    git submodule update --init sdk/OpenESP8266


    Code: Text
    Log in, to see the code


    :(

    am I missing a step?
    Attachments:
    • CMakeOutput.log.txt (29.65 KB) You must be logged in to download this attachment.
  • #77 21891908
    max4elektroda
    Level 24  
    Posts: 746
    Help: 48
    Rate: 184
    p.kaczmarek2 wrote:
    @max4elektroda make log2lfs byte and disable it by default and I think it's ready to be merged

    Actual try at
    https://github.com/MaxineMuster/OpenBK7231T_App/actions/runs/24894132784

    Maybe @divadiow could give these artifacts a try on RTL platforms?
    I added some comments to mainConfig_t adresses.
    For both ESPIDF and RTL there was one "implicit" padding for alignment to 4 byte types - I added a short for both.
    So just to make sure, a configured device won't lose it's config I'd like some tests.
    I already tried on ESP32 and C3, so ESPIDF should be save, but only have one RTL device...

    You can use WIFI password2 (for SSID2) which is "beyond" this place for both platforms.
    Hint: don't use SSID2 itself since you can't delete it w/o resetting to OpenAP and then device will be in "second SSID-mode" until that - another thing to fix in the future.... ;-)

    Testing logging to lfs (if you want to give it a try) with this command:

    logStartup2LFS <seconds up to 30 - default 10s> <optional repeats - default only once>


    so log next startup to LFS for the default 10 seconds:

    logStartup2LFS


    or log next 3 startups for 15 seconds :

    logStartup2LFS 15 3


    Thanks!
  • #78 21893642
    divadiow
    Level 38  
    Posts: 4936
    Help: 431
    Rate: 876
    max4elektroda wrote:
    Maybe @divadiow could give these artifacts a try on RTL platforms?


    I hope to try this out tomorrow
  • #79 21894241
    divadiow
    Level 38  
    Posts: 4936
    Help: 431
    Rate: 876
    cool. so I did
    logStartup2LFS 15 3
    and this was the content of the file saved (had to create autoexec.bat first for LFS to be ready)

    logStart2LFS_f9d408fb2054 - RTL87X0C
    Code: Text
    Log in, to see the code


    vs uart log out
    Code: Text
    Log in, to see the code


    all 3 wrote a log. it did stop after 3.

    the single was fine too. stopwatch shows time logging is accurate within ~1s (human inaccuracy stopping/starting)
  • #80 21894356
    max4elektroda
    Level 24  
    Posts: 746
    Help: 48
    Rate: 184
    Thanks @divadiow!
    Good catch. I would expect, if called on a device without lfs ready, it will init lfs on the first call. So we should point out that lfs should be initialized before use.
    Did you find any problems with keeping the existing configuration from e.g. release or any other version to this one?
  • ADVERTISEMENT
  • #81 21894710
    divadiow
    Level 38  
    Posts: 4936
    Help: 431
    Rate: 876
    I just configured a load of things with general release- some flags, 6s boot OK, startup command, pins, mqtt and all still OK after OTA to PR
📢 Listen (AI):

FAQ

TL;DR: OBK supports 32 platforms and lists 817 devices; “firmware is fully open source.” Flash via UART, test in a PC simulator, and integrate with Home Assistant. [Elektroda, p.kaczmarek2, post #21794531]

Quick Facts

What is OpenBeken (OBK) and who should use it?

OBK is an open‑source firmware for Wi‑Fi IoT devices like relays, LEDs, thermostats, and meters. It targets users who want local control, added sensors, scripting, HA integration, and freedom from vendor clouds. The author states it is “fully open source, free.” [Elektroda, p.kaczmarek2, post #21794531]

Which chips and platforms are supported right now?

As of December 31, 2025, OBK ships binaries for about 32 platforms, including Beken BK7231/T/N/38/52, Espressif ESP8266/ESP32 families, Realtek Ameba series, Bouffalo BL602, Winner Micro W600/W800, XRadio XR806/XR809, Lightning Semi LN882H, ESWIN ECR6600, and others. Check the platforms matrix and linked docs. [Elektroda, p.kaczmarek2, post #21794531]

How do I flash OBK via UART?

You upload the firmware over UART using a USB‑to‑UART adapter and the BK7231 GUI Flash Tool. After flashing, join Wi‑Fi and configure GPIOs. The flasher can auto‑detect GPIO on many devices, reducing guesswork versus Tasmota. 1. Connect UART pins and power. 2. Use the GUI tool to write the binary. 3. Join Wi‑Fi and set roles. [Elektroda, p.kaczmarek2, post #21794531]

Can I run devices 100% locally without any cloud?

Yes. A core goal is freedom from vendor clouds and surveillance. After flashing, devices work fully offline, with local control, REST, MQTT, and HA connectivity. This avoids outages, surprise subscriptions, and vendor lock‑in. The author lists cloud independence as a key motivation. [Elektroda, p.kaczmarek2, post #21794531]

Does OBK integrate with Home Assistant and MQTT?

Yes. OBK connects to Home Assistant without limits and supports MQTT. The simulator even pairs with Home Assistant, letting you validate virtual devices before flashing hardware. This streamlines testing scenes, sensors, and lighting. [Elektroda, p.kaczmarek2, post #21794531]

How do online builds and automatic OTA updates work?

You can compile firmware entirely online via GitHub CI, so no local toolchain is needed. An OBK OTA tool can fetch artifacts on each build and update target devices automatically, including from pull requests and commits. “Build online, deploy OTA” describes the workflow. [Elektroda, p.kaczmarek2, post #21794531]

Is there a PC simulator for designing and testing devices?

Yes. The OBK Simulator for Windows/Linux implements a HAL with a visual schematic editor. You can test advanced circuits, Berry scripts, and HA pairing on your computer. Automatic tests also run on GitHub; failing commits get flagged. [Elektroda, p.kaczmarek2, post #21794531]

How many ready device templates or articles exist?

The community device list shows 817 entries dated 2025‑12‑31. You can filter by platform and by template versus full article. This accelerates onboarding and reduces wiring mistakes. [Elektroda, p.kaczmarek2, post #21794531]

What scripting language and automations does OBK support?

OBK supports Berry scripts across target hardware and in the Simulator. You can add logic, timers, and behaviors without recompiling. The driver list includes complex automations like PixelAnim, DMX, shutters, IR, and data logging helpers. [Elektroda, p.kaczmarek2, post #21794531]

Can OBK host custom web pages and a REST API on the device?

Yes. OBK integrates LFS file storage and a REST interface. You can build HTML/JS control panels, with optional GZIP compression to fit more content. This enables fast local dashboards without external servers. [Elektroda, p.kaczmarek2, post #21794531]

Any known OTA or platform edge cases I should watch out for?

Yes. Examples: XR809 OTA attempts crash the device; ESP8266 uses software PWM and may flicker; some bootloaders block OTA on certain Tuya BK7252 units; web‑based OTA can be corrupted on some chips, so use HTTP OTA instead. Review notes before updating. [Elektroda, p.kaczmarek2, post #21794531]

Does OBK support WPA3 and low‑power modes?

WPA3 support exists on many platforms, sometimes requiring specific ALT builds or sdkconfig flags. Deep sleep varies by MCU; some support only timed sleep and lack GPIO wake. Always check the platform table footnotes when planning battery builds. [Elektroda, p.kaczmarek2, post #21794531]

What drivers and sensors are already supported?

The list includes TuyaMCU (regular and battery), DMX, WS2812 animations, IR/RF, energy chips (RN8209, BL0942, HLW8112), environmental sensors (SHT3X, BMP280, DS18B20), LED drivers (SM2135, BP5758D), displays (MAX72XX, TM1637), shutters, and many more. “Drivers keep expanding.” [Elektroda, p.kaczmarek2, post #21794531]

What do terms like TuyaMCU, OTA, and Berry mean in OBK context?

In OBK, TuyaMCU denotes the driver family for Tuya‑based devices, including battery variants. OTA refers to updating firmware from built artifacts without disassembly. Berry is the embedded scripting language used by OBK and its Simulator. [Elektroda, p.kaczmarek2, post #21794531]

How do I contribute, request drivers, or support OBK?

Share device findings, propose drivers, or test platforms using the GitHub and forum links. You can also support development via the provided PayPal link. The author invites sensor and platform suggestions and thanks major contributors. [Elektroda, p.kaczmarek2, post #21794531]
Generated by the language model.
ADVERTISEMENT