logo elektroda
logo elektroda
X
logo elektroda

PowerSave Command in autoexec.bat Increases CPU Temperature on CB2S Module

Markie_V 441 5
ADVERTISEMENT
  • #1 21395609
    Markie_V
    Level 2  
    Hello All

    This is my first post here so I hope everything will be OK.
    Since last weekend I'm experimenting with a smart WiFi socket based on a CB2S module with chip BK7231N
    And everything is working as expected.

    To have accurate time I wanted to use NTP and also to learn about the script autoexec.bat (nice name btw.) :-)
    I made this autoexec.bat

    PowerSave 1
    StartDriver ntp
    ntp_setServer 10.0.0.138 (I use my modem as NTP server)
    ntp_setLatlong xx.xxxxx2 xx.xxxxx1 (in reality my position)
    ntp_timeZoneOfs 1
    waitFor NTPState 1

    I rebooted the socket and everything seems to work fine until I saw that my CPU temperature was much! higher then
    normal. (almost twice as high)
    So I removed all the NTP settings from autoexec.bat and just left PowerSave 1 in it, and rebooted.
    Again still high CPU temperature...

    I cleared the whole autoexec.bat, rebooted and in the WEBgui in 'Execute Custom command' I gave the command PowerSave 1
    and left it overnight and to my surprise the temperature was back to normal...

    Control panel of a smart WiFi socket with BK7231N chipset, displaying status information and configuration options.

    To be sure I placed PowerSave 1 back in autoexec.bat and left it for a few hours, and guess what... again high CPU temperature.

    WiFi smart socket web interface displaying diagnostic data

    To be clear in all cases the WEBgui was closed and no other traffic to the socket, strange thing is that in both cases in the logfile it says
    it is in powersafe mode, but there is a clear difference when PowerSave 1 is in autoexec.bat or given manually.

    Screenshot of a log showing messages related to MQTT and POWER SAVE mode.

    For me it looks that PowerSafe 1 is not executed in autoexec.bat, or maybe I'm missing out on something, then my apology for the trouble.
    I did a search but could not find anything on this topic.

    All the tests where done without NTP, BTW. is it possible to give the NTP sync a time interval? now NTP does a sync every minute this also could
    give problems for PowerSafe.
    I think an interval from an hour is more then enough, maybe this is already possible but I could not find it, then again my apology for the trouble.

    Other small thing is that I do not use MQTT for control to the socket but via WEB requests and when I gave the status command for network
    settings this showed up;

    Screenshot of JSON data showing device network settings.

    The gateway and DNS do not have the right IPaddress, I think this is more a display thing, I can connect to devices outside my local network, so I guess
    gateway and DNS are OK, but they just display wrong in the status overview.

    Keep up the good work on this fantastic project, I ordered more smart WiFi devices to flash to OpenBeken :-D

    Greetings Mark
    AI: Could you please specify the operating system or firmware version running on your smart WiFi socket?
    Built on Jan 12 2025 20:06:02 version 1.18.20
    Online for 2 hours, 50 minutes and 9 seconds
    Device MAC: 10:5A:17:34:C8:92
    Short name: Slaapkamer, Chipset BK7231N
    AI: Are there any error messages or logs generated when the PowerSave command is executed in autoexec.bat? If so, could you share them?
    There are no error messages in the LOG file, it even says (from my mind) "PowerSafe set to 1"
  • ADVERTISEMENT
  • Helpful post
    #2 21395787
    max4elektroda
    Level 20  
    At least for the JSON numbers I can tell that this is not showing the actual values but they are "hard coded" at the moment.

    https://github.com/openshwprojects/OpenBK7231...46a45280/src/httpserver/json_interface.c#L572

    Added after 6 [minutes]:

    Adding a sync interval to NTP seems a good idea. Should be easily added, will give this a try later.

    Added after 2 [hours] 44 [minutes]:

    Maybe you can try this image?
    It will allow an additional parameter to the startDriver ntp:

    startDriver ntp [<sync interval in seconds>]


    (defaults to 60 so without a argument it's (almost) like the actual driver).
    This is how it looks with 10 seconds, I didn't want to wait an hour for testing. This is up to you ;-)

    Screenshot of system logs with NTP synchronization every 10 seconds.

    Also I allowed the JSON code to display gateway ... for Beken devices.

    Screenshot of JSON interface displaying network information of a device.

    Regarding the powersave I didn't find the time to look at it, but you might try to put the command to the end of the autoexec?
    Then NTP is synced, hence WiFi is up and running and maybe this does the trick?!?
  • ADVERTISEMENT
  • #3 21396412
    Markie_V
    Level 2  
    Thanks for the DEV firmware, It flashed (OTA) perfectly, I have two of these wall sockets, so I can compare.

    The LOG file looks very promising;
    Screenshot of system logs after firmware update.

    I will do some more tests, will do some feedback later.

    The JSON feedback on the WEB request http://10.0.0.61/cm?cmnd=Status%205
    Is still the same no change...

    But I think when you put a statement like <IF 0 > in the code it will always be true :-)
    To me it looks that the vars. HAL_GetMyGatewayString(), HAL_GetMyMaskString() and HAL_GetMyDNSString() do not have the right values,
    or default values declared earlier...

    If I can find time I will try to clone the Toolchain and see if I can make a build/compile.

    Thank you for the fast answer.

    Greetings Mark
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 21398382
    Markie_V
    Level 2  
    Hi

    Again thank you for the DEV firmware, will do some tests and tell later.

    Funny thing with the DEV firmware I suddenly have a clock driver (not in the normal firmware)
    and temperature (without NTP) is still good. :-)

    Screenshot of a device interface showing status and function information.

    Again I will do some tests and reply, but nobody else replied to this message, so maybe I'm chasing something that does not exist...

    Greetings Mark
  • #6 21398505
    max4elektroda
    Level 20  
    Markie_V wrote:
    Funny thing with the DEV firmware I suddenly have a clock driver (not in the normal firmware)

    That's easy to explain, I added the changes to my actual testing branch.
ADVERTISEMENT