I am setting up a simple WiFi client for testing. but every time I try to upload and connect my NodeMCU, I get this error/soft reset message in Serial Monitor in Arduino IDE:
TEST
Soft WDT reset
>>>stack>>>
ctx: cont
sp: 3ffffdf0 end: 3fffffc0 offset: 01b0
3fffffa0: feefeffe 00000000 3ffee59c 40203d30
3fffffb0: feefeffe feefeffe 3ffe8508 401009a5
<<<stack<<<
ets Jan 8 2013,rst cause:2, boot mode:(1,6)
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
I tried different MCU boards and cables to make sure hardware and connections are functioning, I tried resetting and flash reset. I tried with or without "WiFiClient client;" in the code
this is my code:
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
//WiFi Settings
const char ssid[] = "SVwifi";
const char password[] = "tech1234";
WiFiClient client;
void setup() {
Serial.begin(115200);
Serial.println("TEST");
//connect to wifi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED);
{
Serial.print(". ");
delay(500);
}
//Test connection
Serial.println("You are connected :)");
}