The wrong NodeMCU pin reacts (D4 is not pin 4)
- ESP8266 NodeMCU
You may see
Why it happens
- D-numbers and GPIO numbers differ: D4 is usually GPIO 2.
- The D-names exist only when a NodeMCU board is chosen.
How to fix it
- Write
D4, not4, for the pin printed D4. - Choose NodeMCU 1.0 (ESP-12E Module) in Tools > Board.
It worked if: The LED on the pin you meant blinks.
Related errors
Tutorials where it can happen
From the official documentation. Pin names from the ESP8266 core documentation. Sources: ESP8266 Arduino core: boards.
Didn't help? Search another error or ask us.

