logo elektroda
logo elektroda
X
logo elektroda

[YT] Dynamic sleep (PowerSave 1) for BK7231T/BK7231N/W600/W800 - reducing power usage of WiFi module

p.kaczmarek2 3516 11
ADVERTISEMENT
  • Mobile phone showing PowerSave feature enabled in the OpenBeken app, next to an energy meter.
    Dynamic power saving can be used to reduce energy consumption of the WiFi module. It can also reduce the heating of board and increase stability of the device. Sometimes power saving may be required for some cheapest Tuya devices, because their power supplies are not able to provide larger currents for longer times and will degrade their capacitors quickly when under higher load. Dynamic power saving is not a deep sleep, the WiFi module is still online when powersave is enabled. It can still respond quickly to MQTT and HTTP packets.

    Here's a quick powersave demonstration in OpenBeken:



    Keep in mind that power save may be reduced if you, for example, keep your constantly-refreshing Web App log open.

    See our other videos at:
    https://www.youtube.com/@elektrodacom
    See our devices list:
    https://openbekeniot.github.io/webapp/devicesList.html

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 12352 posts with rating 10227, helped 584 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 20842708
    cyrax4
    Level 3  
    kaczmarek,

    I would like to ask if it is possible in your firmware to programatically (or anyhow) completely turn off wifi? My goal is to disable wifi after boot+300seconds to prevent overheating and also reduce energy consumption. The intended use case is that the device turns on by pushbutton, turns off by timer, so wifi not needed to operate - but nice to have in the first 5 minutes to tune the script. Unfortunately I was unable to find such command on github.

    Thanks in advance
  • #3 20842740
    p.kaczmarek2
    Moderator Smart Home
    There is no such command because no one has requested anything like that before. I can add such command easily if W600 SDK supports such a feature. Have you tried looking at our W600 SDK?
    Or, BK7231 SDK, if you are referring to BK platform.

    Alternatively, maybe you want to use a deep sleep with GPIO wakeup?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 20842810
    cyrax4
    Level 3  
    Hm, thanks, I try to check. By SDK are you referring to "Tuya IoTOS" SDK at github or is there any other SDK that I haven't found? It is the BK7231N.

    I checked now deepsleep/pindeepsleep which could be an alternative for energy saving, thank you for pointing out.

    But I suspect unfortunately it wouldn't solve my main concern (overheating issue) while operating. That one is not horrible at first sight (normally around 37C when relay off, but I need to put it in a small box so there won't be natural air convection). Also the peak power consumption will occur when the relay is on - when deepsleep would be off.

    Edit:
    I found SDK on your github and tried to find some wifi-related stuff. Two files ("netcfg_module.h" and "wf_basic_intf.h") were looking interesting. There one can read about some hopefully related functions. But unfortunately I am not a programmer, so cannot decide what "Function: wf_ap_stop" or "typedef int (* FN_NETCFG_STOP)(int type);" would do :(
  • ADVERTISEMENT
  • #5 21089414
    io2345
    Level 8  
    As to tell from the title, this command can not be used for LN882H Chipset, right? Or is it meanwhile implemented there?
  • ADVERTISEMENT
  • #6 21089423
    p.kaczmarek2
    Moderator Smart Home
    I think it was implemented on LN882H in some form, but we had some WiFi issues with that and the PowerSave startup was delayed programmatically after the WiFi connect event. @max4elektroda may also know something about it.
    Helpful post? Buy me a coffee.
  • #7 21089455
    io2345
    Level 8  
    Thank you for your fast response.
    I tried it on the command line, and temperature dropped from 54°C to 44°C. But first I couldn't get it permanent via Config -> Change Startup command text. After a reboot, the device forgot the command again. Finally got it sticky via the WebApplication-Page. I did put it under Config -> Pin-Settings, where it says "Command".
    Later I thought it might be a good idea to OTA the latest firmware 1.17.589. After the OTA update and reboot the device couldn't be accessed via it's IP, but worked physically using the hardware button - might be the Wifi-Issue you were talking of. After diconnecting from mains and re-plugging it was accessible again. Temperature is now even lower (40°C).
  • #9 21218938
    divadiow
    Level 35  
    @DeDaMrAz re PowerSave on W800, I notice OBK uses W800 SDK v0.00.04 | 2020/06/04. The latest appears to be W800 SDK v1.00.10 | 2023/08/25

    the full translated changelog:

    Code: Text
    Log in, to see the code


    and a summary of all changes relating to power consumption since v0.00.04

    Code: Text
    Log in, to see the code
  • #10 21218940
    p.kaczmarek2
    Moderator Smart Home
    That's good find, we've spoke about it with @DeDaMrAz yesterday. What a coincidence. Can you link to that new SDK so I can give it a go?

    Or at least to try.... because at the moment even I don't know how to handle it. That could kinda mean that I need to create a branch in OpenW800 repo and change linked W800 submodule in main OBK repo PR to test that? I'm not sure yet.
    Helpful post? Buy me a coffee.
  • #12 21325101
    io2345
    Level 8  
    Maybe this is the right place to ask the question from here: Link
    In my opinion the powersave is not working on that chip-type (BK7231N). Regardless if I put any value or leave the field blank, temperature results at the same level.

Topic summary

Dynamic power saving (PowerSave 1) for WiFi modules on BK7231T, BK7231N, W600, and W800 chipsets aims to reduce energy consumption, lower device temperature, and improve stability without fully disconnecting WiFi, allowing continued responsiveness to MQTT and HTTP packets. Users discussed the possibility of programmatically disabling WiFi after a set time to prevent overheating and reduce power usage, with suggestions to explore deep sleep modes or SDK functions such as "wf_ap_stop." Implementation challenges were noted, especially on BK7231N and LN882H platforms, where power saving effects may be limited or cause connectivity issues. Firmware updates and SDK improvements, including recent W800 SDK v1.00.10 and LN882H SDK v2.1_rc2, were referenced as potential enablers for better power management. Practical experience showed temperature reductions from 54°C to around 40°C using power save commands, though persistence of settings and WiFi stability after OTA updates remain concerns. The discussion highlights ongoing development and testing needs for effective dynamic power saving on these low-power WiFi modules, particularly for cost-sensitive Tuya devices with limited power supply capabilities.
Summary generated by the language model.
ADVERTISEMENT