One of the most comprehensive books that I have read so far on ESP8266 is one from Neil Kolban. He started a book on the ESP8266 in January 2016; this evolved into a book that considered the ESP8266 and ESP32 together but when he realised that the two chips differed too much for a single book, split the book into two, one for each model. Rather than leave a link here that may well go stale, please search the Internet for the version you need. The early versions, which are still around, are incomplete and in note form; the later versions are more complete but still have gaps where information has not been made available by Espressif.

Book cover The completed combined ESP8266 and ESP32 book (November 2016) is here.

Book cover The completed ESP32 book (September 2018) is here.

Exclamation mark Both these PDFs are well out-of-date and no longer being maintained by Neil - see here for the reasons.