The following code worked out for a couple of days. Right now, the Esp8266 crashes before entering the setup() function. I have tried a couple of boards. I have also checked