logo elektroda
logo elektroda
X
logo elektroda

[BK7231N] Corner-Lamp with OpenBK7231N: Enters Safe Mode After Power Cycle, boots normally later

0x420x58 639 7
ADVERTISEMENT
  • Safe mode triggered by repeated boot failures after cold start

    #1 21800865
    0x420x58
    Level 3  
    Posts: 5
    Hey Guys,

    I am struggling with a corner lamp for quite some while.
    The lamp is a no-name product from a hardware store.

    It has a BK7231N chipset und I managed to flash OpenBK7231N, configure the SM16703P driver for RGB and the PWM channel for White.
    Additionally the IR pin for the remote controller.

    BUT: When I turn off the light over night and turn it on again the next day, it always fails to boot for 5 times and goes straight into Safe Mode (AP).
    Then I wait for ~5-10 minutes, power cylce the lamp again and everything works as expected: The lamp is booting normally and I can controll the LEDs via MQTT.

    My flags: 8392713

    My pin config:
      "pins": {
        "6": "PWM;5",
        "20": "IRRecv;1"
      },
    


    My autoexec.bat:
    startDriver SM16703P
    
    // number of LEDs
    setChannel 6 60
    
    // init
    SM16703P_Init $CH6
    
    // done
    SM16703P_Start


    I already removed all flags and autoexec.bat. Same behaviour.
    Does anybody has an idea what the problem could be?

    AI: Can you share details about the power supply you're using for the lamp (voltage, type, and whether it's stable or has any delay/soft start features)?
    Default socket power supply (12V, 1A) part of the lamp.
    AI: Do you have access to any serial logs or error messages from the device during the failed boot attempts when it enters Safe Mode? If so, could you post them here?

    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 351 #######
    Info:MAIN:###### safe mode activated - boot failures 5
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 155 changes count.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:###### safe mode activated - boot failures 5
    Info:MAIN:Using SSID [*******]
    Info:MAIN:Using Pass [*******]
    Error:HTTP:Created HTTP SV thread with (stack=2048)
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:[SAFE] Time 1, idle 205451/s, free 82432, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:[SAFE] Time 2, idle 142318/s, free 82432, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:[SAFE] Time 3, idle 142530/s, free 82432, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:[SAFE] Time 4, idle 142552/s, free 82432, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (3 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:[SAFE] Time 5, idle 136645/s, free 82432, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:no flash configuration, use default
    Info:MAIN:set ip info: 192.168.4.1,255.255.255.0,192.168.4.1
    Info:MAIN:ssid:Corner-Lamp-1_OpenBK7231N  key: mode:0
    Info:MAIN:[SAFE] Time 6, idle 138783/s, free 74712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:[SAFE] Time 7, idle 280279/s, free 74712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:[SAFE] Time 8, idle 141228/s, free 74712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:[SAFE] Time 9, idle 139295/s, free 74712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:[SAFE] Time 10, idle 139992/s, free 74712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=00:00:00:00:00:00
    Info:GEN:sta: 0, softap: 1, b/g/n
    Info:GEN:softap:ssid=Corner-Lamp-1_OpenBK7231N,channel=1,dhcp=1,cipher_type:OPEN
    Info:GEN:ip=192.168.4.1,gate=192.168.4.1,mask=255.255.255.0,dns=192.168.4.1
    Info:MAIN:[SAFE] Time 11, idle 138008/s, free 74712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:[SAFE] Time 12, idle 139749/s, free 74712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:[SAFE] Time 13, idle 142458/s, free 74520, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
    Info:MAIN:[SAFE] Time 14, idle 136954/s, free 74520, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 5/38
  • ADVERTISEMENT
  • Clarifying power-cycle behavior and firmware history

    #2 21802355
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    Welcome to Elektroda, thank you for posting. We'll try to help you with your issue.
    0x420x58 wrote:

    I already removed all flags and autoexec.bat. Same behaviour.
    Does anybody has an idea what the problem could be?

    This seems like a crucial information, can you double check?
    Can you verify again whether:
    - this problem appears with no autoexec.bat and no flags
    - this problem appears with no autoexec.bat, no flags, and no pins set?
    We need to narrow down the issue.

    Currently, it sounds like a power supply problem.


    0x420x58 wrote:

    BUT: When I turn off the light over night and turn it on again the next day,

    What do you mean by "turn off"? Do you mean that you toggle it off in OBK panel, or disconnect from the mains power (disconnect 230V plug, let's say)?

    Did you have the same issue with Tuya firmware? Is it like this from the start, or started after some time?

    Can you show some photos of the lamp, just for generic information? Is it easy to access the PCB?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • Needs testing without pin configuration

    #3 21804663
    0x420x58
    Level 3  
    Posts: 5
    Hey p.kaczmarek2,

    p.kaczmarek2 wrote:
    This seems like a crucial information, can you double check?
    Can you verify again whether:
    - this problem appears with no autoexec.bat and no flags
    - this problem appears with no autoexec.bat, no flags, and no pins set?
    We need to narrow down the issue.


    The problem appears with no autoexec.bat and no flags, yes.
    I didn't try it without pin configuration, though. I'll try that next.

    p.kaczmarek2 wrote:
    What do you mean by "turn off"? Do you mean that you toggle it off in OBK panel, or disconnect from the mains power (disconnect 230V plug, let's say)?

    I meant that I powered it off completely by disconnecting it from the main power (there is a switch inside the cable).

    p.kaczmarek2 wrote:
    Did you have the same issue with Tuya firmware? Is it like this from the start, or started after some time?

    Honestly, I cannot tell. I just recently discovered that this lamp is a Tuya device. Before that I always used the remote control to turn the lamp on/off.

    p.kaczmarek2 wrote:
    Can you show some photos of the lamp, just for generic information? Is it easy to access the PCB?

    Here we go:

    Close-up of green PCB with USB-C port and electronic components AC adapter with European plug and CALEx label attached to the cable LED driver from Xing Yuan Electronics with technical specs and certification marks Modern vertical LED floor lamp on carpet next to wooden drawer unit
  • #4 21804691
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    Which OBK version? Maybe a quick connect bug? @insmod I mean this 250 ms delay at startup.

    Can you try OTA latest OBK?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • Testing whether longer power-off avoids safe mode

    #5 21804780
    0x420x58
    Level 3  
    Posts: 5
    p.kaczmarek2 wrote:
    Which OBK version?

    Currently I'm running 1.18.233. But I see there is now 245 available.

    p.kaczmarek2 wrote:
    Maybe a quick connect bug? @insmod I mean this 250 ms delay at startup.

    Is this information for me?

    p.kaczmarek2 wrote:
    Can you try OTA latest OBK?

    I'll try.

    I have removed the pin configuration and powered the lamp off. At least now (~3 h later) it connected normally to my Wi-Fi. I'll expand the off time and try it again later.
  • #6 21805674
    0x420x58
    Level 3  
    Posts: 5
    So, it seems to have something to do with the pin configuration. Today the lamp connected immediately to my Wi-Fi after powering it on.
    Then I configured pin 6 with PWM and channel 5, power-cycled, and the lamp went straight into Safe Mode.
  • #7 21805902
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    So pin 6 is guilty? What's connected to pin 6?

    What if you set it to Relay instead? Relay outputs 1 or 0, digital state.

    Added after 3 [minutes]:

    PS: What if you power WiFi module from external power supply, with stable 3.3V?

    Maybe this pin enables something that draws so much current that WiFi module has brownout and resets.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • Suggesting brownout on pin 6 and delayed startup control

    #8 21807221
    0x420x58
    Level 3  
    Posts: 5
    p.kaczmarek2 wrote:
    So pin 6 is guilty? What's connected to pin 6?

    What if you set it to Relay instead? Relay outputs 1 or 0, digital state.


    I did, and it's also working flawlessly. So the PWM driver is the problem?

    p.kaczmarek2 wrote:
    PS: What if you power WiFi module from external power supply, with stable 3.3V?

    Maybe this pin enables something that draws so much current that WiFi module has brownout and resets.


    I could try that. But would it be possible to control such things via autoexec.bat with wait times, etc.?

Topic summary

LABEL_AI_GENERATED
A BK7231N-based corner lamp flashed with OpenBK7231N boots normally after a short power cycle, but after being fully disconnected from mains overnight it repeatedly fails to boot and enters Safe Mode/AP after five attempts. The issue persists even with flags and autoexec.bat removed, but disappears when the pin configuration is cleared. The problematic setup uses pin 6 as PWM for the SM16703P RGB driver and pin 20 for IR reception. Testing suggests the PWM configuration on pin 6 may trigger a startup brownout or other boot-time instability; switching the pin to a relay-style digital output was reported to work, and a stable external 3.3 V supply was suggested as another diagnostic step. A newer OpenBK version and startup timing/quick-connect behavior were also discussed.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT