I'm unsure where to post this. I'm using an ESP32-C3 Zero with the IDE v 2,3,4
I've created a trivial sketch to show the problem, here it is
//#include <WiFi.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial) delay(100); // wait for native usb
Serial.println("setup");
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("loop");
delay(1000);
}
It compiles, loads and runs as you would expect, printing 'setup' and then 'loop' forever.
The problem is, if you uncomment the #include <WiFi.h>, it compiles and loads but produces no serial output whatsoever!
I'm completely at a loss as to what's going on.
Thanks for the suggestion but as pointed out my syntax is correct. If it were not, it would not compile. BUT, as this seems so odd to me, I did try adding the curly braces and they made no difference.
I had a look at WiFi.h but debugging it is not easy.
I was a bit concerned that perhaps the sketch was in fact running and it was just the Serial that was broken so I added code to flash the internal LED. The sketch is NOT running at all when WiFi.h is included. Even though I'm not calling any WiFi code at all!