So I have tried 5 different NodeMCU boards now. I have correctly added esp8266 library to board manager and download the USB software to upload sketches.
I am able to upload sketches onto these boards. However, it appears that void setup is not running properly. Here is the basic test code I am running that leads me to this conclusion:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Test void setup");
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("Test loop");
delay(1000);
Check the attachments for what happens in the serial monitor.
Essentially, the void loop runs fine but the serial.println is skipped. When I hit the reset button, this line is printed next to some gibberish. I thought maybe I could work around this for my project that will utilize and ultrasonic sensor to upload data to a Blynk app.
But, when I tried running that code:
// D = 1/2 × T × C
const int ECHOPIN = 4;
const int TRIGPIN = 3;
void setup() {
Serial.begin(9600);
pinMode(ECHOPIN, INPUT);
pinMode(TRIGPIN, OUTPUT);
Serial.println("Begin reading distance");
}
void loop() {
digitalWrite(TRIGPIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIGPIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIGPIN, LOW);
// Distance calc
float distance = pulseIn(ECHOPIN, HIGH);
distance = distance/58;
Serial.print(distance);
Serial.println(" cm");
delay(2000);
}
Nothing printed at all on the serial monitor (including loop print statements). That is a bad sign because I tested this on the Arduino Uno and it works fine. I do not think these boards are defective because this problem has repeated 4 times. Note I did not purchase 4 consecutive boards, I ordered the first two as a pair and thought maybe that brand had a bad batch. Then they sent me a replacement, after I had ordered another one from a different brand. Each has the exact same problem.

