D3 = GPIO0, which isn’t a good pin to use.it MUST be HIGH at boot time, otherwise the NodeMCU will go in to flash mode.
Pete.