Error Message When adding a DHT11 sensor w/ ESP8266 NodeMCU

I’m currently trying to setup a temp and humidity sensor DHT11 on an ESP8266, but I am getting the following error in the serial monitor:

ets Jan 8 2013, rst cause:2, boot mode:(1,6)
ets Jan 8 2013, rst cause:4, boot mode:(1,6)
wdt reset

I don’t know what the error messages mean, and also, if it’s not too much ask, could someone recommend a good book to read that could help get me up to speed with coding for the arduino? I don’t want to flood the board with what would probably be silly questions to the more experienced people. Thanks in advance.

OH! The sketch I am using can be found here: https://github.com/titusece/ESP8266-MQTT-Publish-DHT11/blob/master/MQTT_ESP8266_DHT11.ino

after switching over to ESPEasy it’s pretty much all I’d recommend for stuff like this. Look into that. It’s really simple to set up the DHT11 for reporting.

This kind of reset error are most probably cause by a bad power supply, those ESP are pretty sensitive to it.

If not, it could be a flash that went wrong (try reflashing) or simply your code that crash.

Try commenting part of your code to see which part make it crash (after making sure you have a good power supply, and reflashing the esp 1 or 2 times).

Do you see anything at all in the serial console, before getting this error message?

you shouldn’t see anything because it’s the boot message. I’ve had these happen in the past and usually they’re just due to bad flash but it’s just a PITA to have to deal with. Usually something along the lines of, “I checked the 1M module when I should have checked the 4M module”

When it crash, it restart, so yes, you might see something before this message.