logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 2094 44
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • ADVERTISEMENT
  • #32 21851787
    max4elektroda
    Level 24  
    DeDaMrAz wrote:
    bump - for house cleaning, PR status and issues....

    Closed some more old PRs. Still open:
    Open PR #SummaryStatus
    1998Extend SHT3x driver to work SHT4x (and GXHTV4) and allow multiple sensorsStill WiP. I'm currently working on a new (smaller) version
    1927Allow WPA AP with "#define ENABLE_WPA_AP 1"WiP. Allow to work not only as open AP but as WPA2 protected AP. Don't know if there's someone needing it ...
    1926Add a command to set a timeout for connecting to WiFiWas initially a request in issue 1923. But no more feedback...
    1911Driver for DCF77 radio controlled clockWill need update to current version. It was suggested to remove own "IORole" since driver will probably not be widely used...
    1889Max72xx clock driver wipWork‑in‑progress - playground, not updated recently
    1841Add all defines "ENABLE_XY" to "about" pageI thought it usefull, but will increase image size because of the strings
    1826Rolerework with python scriptThird try as Python script. Will need generat agreement, if a single file for all definitions is wanted.
    1773Rework of pin config pageCentralize IOroles and channles (like PR #1378) with an awk script
    1696Multi aht2xWould need some update to current version. Didn't work on it recently
    1688Try finding best BSSID for a SSIDAbandoned try to fix LN882H sometimes using a "weak" SSID instead of a stronger one. It didn't work out (yet) to use a found stronger BSSID
    1485Switch DST offset to minutes to allow regions with 30 minutes offsetProbably not needed.
    1448SSID retain with GUIAlmost forgott about it. Maybe it's of use for someone? But how often is "second SSID" used??
    1378Rework pins and rolesTry for rework / centralize IOroles and channles with C macros
    1358Ring buffer for graphI played with an own simple graph for temperatures using a ringbuffer. If merged, it would be good to share the ring buffer code. Probably outdated...
    1346Simple temperature graph on main pageAdds a simple temperature graph to the main UI page.
    1336Allow to publish channel labels instead of channel idsDon't recall if that was of use...
    1240Implement reset of configuration if http auth fails ("forgotten password")No clue if thats of some use, we have safe mode ...
    1216Add some information to status page – Works on LN882HDidn't convice this is usefull (yet?) Discussion is here
  • #33 21851984
    divadiow
    Level 38  
    I think https://github.com/openshwprojects/OpenBK7231T_App/pull/1999 is ready to go. Not sure about the os_ renames though that insmod suggested.

    Summary of changes made

    TuyaMCU driver
    - Added bounds checks in the incoming TuyaMCU parse paths so a DP sector cannot claim more bytes than actually remain in the packet.
    - This was added to:
    - TuyaMCU_ParseStateMessage() for normal STATE / 0x07 parsing
    - TuyaMCU_V0_ParseRealTimeWithRecordStorage() for the V0 realtime paths (including 0x05 and 0x08-style packets)
    - The new check compares sectorLen against the remaining bytes after the DP header and, if truncated:
    - logs an error with dpId/type/length details
    - stops parsing that malformed packet instead of reading/copying past the end
    - This prevents:
    - out-of-bounds reads
    - out-of-bounds memcpy/copies
    - bad downstream parsing from malformed/truncated TuyaMCU payloads
    - Added realloc hardening for raw DP storage in the STATE parser:
    - use a temporary pointer for realloc instead of assigning straight back to mapping->rawData
    - only replace mapping->rawData if realloc succeeds
    - avoids a NULL-pointer memcpy / crash if allocation fails while storing raw DP data

    Effect of the driver changes
    - No intended behaviour change for valid TuyaMCU packets
    - Malformed/truncated packets now fail safely instead of potentially corrupting memory or crashing
    - Under low-memory conditions, raw DP storage is handled more safely

    Self-test changes
    - Expanded the TuyaMCU self-test with a new robustness test covering the parser hardening
    - The new test exercises all 3 relevant parse cases:
    1. normal STATE / 0x07 parsing
    2. V0 realtime / 0x05 parsing
    3. V0 realtime with datetime prefix / 0x08 parsing
    - For each path, the test now:
    - sets up a mapping and a known starting channel value
    - injects a deliberately truncated packet where sectorLen says 4 bytes, but only 3 bytes remain for the parser
    - checks that the channel value does NOT change after the malformed packet
    - then injects a valid follow-up packet
    - checks that the valid packet is still parsed correctly and updates the channel
    - The self-test was tightened/fixed during iteration:
    - fixed an earlier dpId/mapping mismatch
    - corrected malformed packet construction so the parser really sees remaining=3
    - corrected packet checksums so packets pass framing/checksum validation and actually reach the truncation guards
    - added the missing valid follow-up for the V0/0x08 path
    - Final result:
    - malformed packets hit the new truncation guard
    - valid packets still work immediately afterwards
    - simulator / ASan / UBSan runs now show the expected truncation log messages and no self-test failures
  • ADVERTISEMENT
  • #34 21863496
    p.kaczmarek2
    Moderator Smart Home
    @max4elektroda
    Open PR #SummaryStatusExtra comment
    1998Extend SHT3x driver to work SHT4x (and GXHTV4) and allow multiple sensorsStill WiP. I'm currently working on a new (smaller) versionPlease finish and let's merge
    1927Allow WPA AP with "#define ENABLE_WPA_AP 1"WiP. Allow to work not only as open AP but as WPA2 protected AP. Don't know if there's someone needing it ...Please finish and let's merge with #define off
    1926Add a command to set a timeout for connecting to WiFiWas initially a request in issue 1923. But no more feedback...up to discussion
    1911Driver for DCF77 radio controlled clockWill need update to current version. It was suggested to remove own "IORole" since driver will probably not be widely used...top priority, I want this merged but disabled by default
    1889Max72xx clock driver wipWork-in-progress - playground, not updated recentlyplease finish and merge
    1841Add all defines "ENABLE_XY" to "about" pageI thought it usefull, but will increase image size because of the strings
    1826Rolerework with python scriptThird try as Python script. Will need generat agreement, if a single file for all definitions is wanted.
    1773Rework of pin config pageCentralize IOroles and channles (like PR #1378) with an awk script
    1696Multi aht2xWould need some update to current version. Didn't work on it recentlyif memory footprint is small, we can have it
    1688Try finding best BSSID for a SSIDAbandoned try to fix LN882H sometimes using a "weak" SSID instead of a stronger one. It didn't work out (yet) to use a found stronger BSSID
    1485Switch DST offset to minutes to allow regions with 30 minutes offsetProbably not needed.we can merge it if we prove it works and not breaks
    1448SSID retain with GUIAlmost forgott about it. Maybe it's of use for someone? But how often is "second SSID" used??
    1378Rework pins and rolesTry for rework / centralize IOroles and channles with C macros
    1358Ring buffer for graphI played with an own simple graph for temperatures using a ringbuffer. If merged, it would be good to share the ring buffer code. Probably outdated...
    1346Simple temperature graph on main pageAdds a simple temperature graph to the main UI page.
    1336Allow to publish channel labels instead of channel idsDon't recall if that was of use...
    1240Implement reset of configuration if http auth fails ("forgotten password")No clue if thats of some use, we have safe mode ...
    1216Add some information to status page – Works on LN882HDidn't convice this is usefull (yet?) Discussion is herehigh priority, we can have it on main page, but we need to protect it against strange bugs, maybe if failed reboots > 1 then do not show it?



    @divadiow while it seems good at first glance, I had one concern. I was wondering whether those checks are really needed, because initial ring buffer already checks for truncated packets and does not allow broken data to pass... but still, you are checking sectorLen, not the whole packet len... I think I'll accept it now but I don't think it will really occur. Those error messages could be shorter.


    What do we do about this? Does it help?
    Configure Git settings for network stability #2032
    https://github.com/openshwprojects/OpenBK7231T_App/pull/2032/changes
    GitHub diff of workflow.yaml showing added steps and cache-apt-pkgs-action version change

    Also, do we have a PWM issue on some Beken platforms?
    https://github.com/openshwprojects/OpenBK7231T_App/pull/2030/changes
    Code diff view: changes in hal_pins_bk7231.c adjusting #if conditions for BK7231N and BK7238 platforms

    @DeDaMrAz what is going on with RTL OTA code here?
    mDNS support for other platforms #2018
    https://github.com/openshwprojects/OpenBK7231T_App/pull/2018



    Fast connect LN882H - ready to merge? @insmod
    https://github.com/openshwprojects/OpenBK7231T_App/pull/2016

    Helpful post? Buy me a coffee.
  • #35 21863502
    divadiow
    Level 38  
    p.kaczmarek2 wrote:
    @divadiow while it seems good at first glance, I had one concern. I was wondering whether those checks are really needed, because initial ring buffer already checks for truncated packets and does not allow broken data to pass... but still, you are checking sectorLen, not the whole packet len... I think I'll accept it now but I don't think it will really occur. Those error messages could be shorter.


    appreciate you taking the time to look at it. I will review more.
  • #36 21863503
    p.kaczmarek2
    Moderator Smart Home
    It's merged for now, however error messages could be shorter.
    Helpful post? Buy me a coffee.
  • #37 21863536
    insmod
    Level 31  
    >>21863496
    LN is ready
    PWM is fine on 7238, and that pull request does nothing at all, since BK7238 has PLATFORM_BEKEN_NEW
  • ADVERTISEMENT
  • #38 21863546
    p.kaczmarek2
    Moderator Smart Home
    Helpful post? Buy me a coffee.
  • #39 21863552
    insmod
    Level 31  
    >>21863546
    Far from being properly done.
    But can be used already and is more or less stable.
  • #40 21863656
    p.kaczmarek2
    Moderator Smart Home
    Thanks, I merged, however, I have little nitpick. Is ENABLE_BT_PROXY a correct define name? My assumption is that ENABLE_DRV_ prefix is for drivers (called from drv_main), and ENABLE_XYZ is for mechanism that resides outside drivers... I can see that indeed your define related to HAL, so maybe it's correct, but still, it's worth to consider it.
    Helpful post? Buy me a coffee.
  • #41 21863921
    DeDaMrAz
    Level 22  
    p.kaczmarek2 wrote:
    what is going on with RTL OTA code here?


    You can disregard that anything RTL related as I was not been able to finish that up - RTL is excluded from mDNS for now.
  • ADVERTISEMENT
  • #42 21865583
    divadiow
    Level 38  
    p.kaczmarek2 wrote:
    What do we do about this? Does it help?
    Configure Git settings for network stability #2032
    https://github.com/openshwprojects/OpenBK7231T_App/pull/2032/changes


    i put a question comment on the issue. no idea, but fixing awalsh128/cache-apt-pkgs-action to v1.4.3 kinda sounds a bit limiting. you'd miss out on all fixes/changes since that version without manual change to newer version
  • #43 21866070
    max4elektroda
    Level 24  
    First feedback:

    p.kaczmarek2 wrote:
    @max4elektroda

    1696 Multi aht2x if memory footprint is small, we can have it


    Updated. Additional Memory mainly ~+400-600bytes, ESP platforms ~ +730bytes. (minimum 0, once 1104 (RTL8710B)) :

    Spoiler:
    We have AHT2X enabled (if not OBK_VARIANT_TUYAMCU / OBK_VARIANT_POWERMETERING / OBK_VARIANT_IRREMOTEESP / OBK_VARIANT_HLW8112) with
    XR806, W800, BK7231N, BEKEN_NEW, ESPIDF, TR6260, REALTEK, ECR6600, RDA5981

    Size +/-    Filename                                                       1.18.276   1696_merge_ed9bff6683a1
    0           OpenXR806_XX.img                                                 876384                     876384
    0           OpenRTL8720D_XX.bin                                             1138688                    1138688
    64          OpenRTL87X0C_XX_btproxy.bin                                      958084                     958148
    128         OpenRTL87X0C_XX.bin                                              868484                     868612
    336         OpenECR6600_XX.bin                                               988081                     988417
    412         OpenRDA5981_XX.bin                                               511500                     511912
    496         OpenTR6260_XX.bin                                                663284                     663780
    512         OpenRTL8710A_XX.bin                                              690376                     690888
    520         OpenBK7238_XX_berry.bin                                          866297                     866817
    536         OpenBK7238_XX_btproxy.bin                                        968513                     969049
    544         OpenBK7238_XX.bin                                                765669                     766213
    544         OpenRTL8720E_XX.bin                                             1303904                    1304448
    552         OpenBK7231N_XX_berry.bin                                         928945                     929497
    552         OpenBK7231N_XX.bin                                               826585                     827137
    552         OpenRTL8710B_XX.bin                                              680244                     680796
    648         OpenW800_XX.fls                                                  707692                     708340
    704         OpenRTL8721DA_XX.bin                                            1400960                    1401664
    720         OpenESP32C2_XX_2M.factory.bin                                    934368                     935088
    720         OpenESP32C2_XX_2M.img                                            868832                     869552
    736         OpenESP32C2_XX_4M.factory.bin                                   1071376                    1072112
    736         OpenESP32C2_XX_4M.img                                           1005840                    1006576
    736         OpenESP32C61_XX_4M.factory.bin                                  1239440                    1240176
    736         OpenESP32C61_XX_4M.img                                          1173904                    1174640
    736         OpenESP32C6_XX_4M.factory.bin                                   1272704                    1273440
    736         OpenESP32C6_XX_4M.img                                           1207168                    1207904
    752         OpenESP32C3_XX_2M.factory.bin                                   1038976                    1039728
    752         OpenESP32C3_XX_2M.img                                            973440                     974192
    752         OpenESP32C3_XX_4M.factory.bin                                   1175936                    1176688
    752         OpenESP32C3_XX_4M.img                                           1110400                    1111152
    752         OpenESP32C5_XX_4M.factory.bin                                   1273472                    1274224
    752         OpenESP32C5_XX_4M.img                                           1207936                    1208688
    1104        OpenRTL8710B_UG_XX.img                                          1270432                    1271536
    


    p.kaczmarek2 wrote:

    1911 Driver for DCF77 radio controlled clock top priority, I want this merged but disabled by default

    Updated, disabled by default, ready to merge
  • #44 21867083
    p.kaczmarek2
    Moderator Smart Home
    DCF seems acceptable, merged.

    What's the next step?
    Helpful post? Buy me a coffee.
  • #45 21867120
    max4elektroda
    Level 24  
    @p.kaczmarek2
    Still not totally giving up the idea of an alternate way to give arguments to drivers I made a minimum version to extend tokenizer: search a string in tokens ad return it's index. All others are simply done by makro.
    While at it I found (I guess) a bug in tokenizer. I added safeguards to the index's argument not only to "reject" the index if it's >= arguments counter, but also if it's negative (we can discuss this but i think it's a necessary measure of safety).

    But: GetArgInteger had no safeguard at all!
    And after fixing this, one of the selftests failed. I added some debug output and it clearly states that one selftest is relaying on the wrong behavior:

    The actual (wrong?) implementation will simply answer with some previous values, even if tokenizer was called in between.

    So can you please take a look at
    https://github.com/MaxineMuster/OpenBK7231T_App/tree/_tokenizer_mini

    And the failing selftesst (I changed on in the way I think it should work and adde one logging to show there's a tokenizer call with no argument but later the test will rely on the argument from the previous call)

    https://github.com/MaxineMuster/OpenBK7231T_A...runs/23358853840/job/67956684162#step:5:58740

    
    Debug:CMD: temperature (CT) received with args 153
    Info:MQTT:Publishing val 153 to rgbcwBulb/led_temperature/get retain=0
    Debug:CMD: temperature (CT) received with args 
    Error:CMD:Tokenizer_GetArgInteger(0) called - g_numArgs=0 -- arg[0]=153
    Info:MQTT:Publishing val 0 to rgbcwBulb/led_temperature/get retain=0
    Info:MQTT:Publishing val {"CT":0} to stat/rgbcwBulb/RESULT retain=0
    Received JSON: {"CT":0}
    Test_GetJSONValue_Integer will return 0 for CT
    ERROR: SelfTest assertion failed for (Test_GetJSONValue_Integer("CT", 0) == 153)
    Check src/selftest/selftest_tasmota.c - Test_Tasmota_MQTT_RGBCW - line 493
    Total SelfTest errors so far: 1
    Debug:CMD:cmd [CT 444]
    Debug:CMD: temperature (CT) received with args 444
    Info:MQTT:Publishing val 444 to rgbcwBulb/led_temperature/get retain=0
    Debug:CMD: temperature (CT) received with args 
    Error:CMD:Tokenizer_GetArgInteger(0) called - g_numArgs=0 -- arg[0]=444
    Info:MQTT:Publishing val 0 to rgbcwBulb/led_temperature/get retain=0
    Info:MQTT:Publishing val {"CT":0} to stat/rgbcwBulb/RESULT retain=0
    Received JSON: {"CT":0}
    Test_GetJSONValue_Integer will return 0 for CT
    ERROR: SelfTest assertion failed for (Test_GetJSONValue_Integer("CT", 0) == 444)
    Check src/selftest/selftest_tasmota.c - Test_Tasmota_MQTT_RGBCW - line 499
    Total SelfTest errors so far: 2
    

    You see there's a second call to CT or dimmer commands without an argument, but later argument[0] is requested and obviously expected to contain the value of the previous call...

    I didn't figure out which command exactly called the integer argument, but I would think the changed code is correct now)

    Could you please check if this really is a bug?
📢 Listen (AI):
ADVERTISEMENT