Arduino Fix IP wifi

ใส่ code นี้ตอนกำหนด parameter

IPAddress staticIP(192, 168, xx, xx); //ESP static IP address
IPAddress gateway(192, 168, xx, 1); //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0); //Subnet mask
IPAddress primaryDNS(8, 8, 8, 8); //optional
IPAddress secondaryDNS(8, 8, 4, 4); //optionalDNS

แทรก code ถัดจาก void setup()

// Configures static IP address
if (!WiFi.config(staticIP, gateway, subnet, primaryDNS, secondaryDNS)) {
Serial.println(“STA Failed to configure”);
}