Photon flashing white (cyan) with 2-3 orange flashes intermittently (1-3 minutes)

Update;

This problem is still haunting me, I am using the same code from above. When the photon get stuck in the rapid cyan flashing cycle i use particle flash --usb tinker which usually works, as it itll breathe cyan and will show online in the web IDE and on the phone app.

However, when i try to flash my code (above) even with the SYSTEM_THREAD(ENABLED)at the very top of the script it will sometimes work, but before or if i have to press the reset button it jumps into the same loop as before.

I’m assuming their is a bug in my code, if someone could let me know what in the code causes the hardware to malfunction it’d be greatly appreciated. Side note; I’m trying to get the blynk app on my phone to switch power and even when the code (above, which has all the blynk lib and statements in it) it still says offline on the app.