NodeMCU powered with battery and use WiFi
It seem to be a problem with onboard regulator such as AMS1117. 
ESP are really sensitive to power instability. 
For every of my project i need to put capacitor on alimentation to prevent bugs. 
I think you dont have enougth voltage to work properly with your regulated input.
To correct this issue you should put two battery to get 7.5 volt on the regulated input. 
Another solution is using 3.3v input to pass trought the regulator.