Automated Self Watering with ESP8266 WiFi

I’m guessing that you’ve selected “Generic ESP8266” as your board type in the Arduino IDE, rather than NodeMCU.

Also, you don’t need to do this:

see the “Creating Interval Timers” section of this post:

Pete.