Hi. this is my script
#include <WiFi.h>
#define ONBOARD_LED 2
const char* ssid = "wifi";
const char* password = "password";
WiFiServer server(80);
String header;
IPAddress local_IP(192, 168, 240, 20);
IPAddress gateway(192, 168, 240, 1);
IPAddress subnet(255, 255, 254, 0);
IPAddress primaryDNS(8, 8, 8, 8);
IPAddress secondaryDNS(8, 8, 4, 4);
void setup() {
pinMode(ONBOARD_LED,OUTPUT);
Serial.begin(115200);
if (!WiFi.config(local_IP, gateway, subnet, primaryDNS, secondaryDNS)) {
Serial.println("STA Failed to configure");
}
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
server.begin();
}
void loop() {
delay(1000);
digitalWrite(ONBOARD_LED,HIGH);
delay(100);
digitalWrite(ONBOARD_LED,LOW);
}
problem is, that if esp32 is not connected to wifi, LED wont blink. how can I fix it?