Esp8266 keeps disconnect with wifi and reconnects back as loop

Also, you will run-iun to issues with these commands…

The way your code is written you could easily log two events per second (with the 500ms timers) and possibly 6 events per second.

There is a limit of 100 events per 24 hour period, so you could exceed this in 33 seconds with your current code.