WiFi.config format is not correct

ForumCategory: esp32WiFi.config format is not correct
Tim asked 3 weeks ago

The format of WiFi.config in the code above is incorrect:

WiFi.config(ip, dns, gateway, subnet);

It should be:

WiFi.config(staticIP, gateway, subnet, dns, dns)

The format given above does indeed correctly set the static IP correctly. However, the remaining values are set incorrectly. This can be demonstrated by including these lines after the Wifi.config statement:

Serial.print("connected as: ");
Serial.print("Subnet Mask: ");
Serial.print("Gateway IP: ");
Serial.print("DNS 1: ");
Serial.print("DNS 2: ");
Click to rate this post!
[Total: 0 Average: 0]
Do NOT follow this link or you will be banned from the site!
DIY Projects