Quote from https://github.com/nodemcu/nodemcu-firm ... les/adc.md
Depending on the setting in the "esp init data" (byte 107) one can either use the ADC to read an external voltage, or to read the system voltage (vdd33), but not both.
In ArduinoESP framework, we simply have to add globally the command "ADC_MODE(ADC_TOUT)".