Just to add, GPIO16 (Pin D0 on the NodeMCU) isn’t a great pin to use as it’s one of those ‘special’ pins.
Pete.