ESP8266 failure to connect to router
In my case when I try to connect to my router, I get the following output:
AT+CWJAP=&quot;myssid&quot;,&quot;mypassword&quot;
WIFI CONNECTED
+CWJAP:1

FAIL
WIFI DISCONNECT

The reason is that the ESP8266 I have is setup with DHCP disabled by default. To enable it you can try the following:
AT+CWDHCP=1,1

If that works, you will get this message:
OK
WIFI GOT IP