WLED Installed on LOHAS analog LED Light bulb crashes intermittently

I have WLED successfully working on several DigUno and several other ESP8266 chips. I was so happy with how it works in my setup I decided to try and see if I could get it working on a LOHAS RGBCW light bulb. LOHAS, like most other LED bulbs as I’ve learned, is based on Tuya. I was able to flash custom firmware using tuya-convert and have 10 bulbs all running WLED and all experiencing the same issues. First, here is the procedure I used to flash the firmware:

  1. Use tuya-convert to flash tasmota.bin
  2. Use Tasmota firmware to flash tasmota-min.bin
  3. Use Tasmota minimal firmware to flash Arduino BasicOTA
  4. Now I could use Arduino to flash the WLED software

For the WLED build, I ended up using the Arduino IDE as it is more familiar to me. I disabled all the optional components to reduce the memory footprint and turned on the settings to use ANALOG WLED and 5 channel LED. Imagine my surprise and delight when it worked first time!

The bad news is that the lights randomly restart. Sometimes after 30 seconds, sometimes after 8 hours, or anywhere in between. In monitoring the Info page through the web interface, the heap appears stable, and so my hypothesis at this time is that this is NOT a memory leak, it is more likely some kind of buffer overwrite.

As this is a physical light bulb, there is no serial connection available for debugging. HOWEVER, I was able to shrink the memory footprint enough that I was JUST able to squeeze the RemoteDebug library into the image. This yielded no additional information because of course the library flushes its debug info within the main loop and so it is never able to isolate the crash.

I am happy to share more specifics on the configuration, but thought I would start by asking this forum for general thoughts on what approach I could take to try and isolate where the crash is occurring and what is causing it as I am out of ideas.

A quick update. I switched over to using the recommended build approach using VS Code and am reproducing the same results as when using Arduino IDE