WiFi configuration for e.g. esp32 (DNS Issue)

I was trying to use WiFi.config command in the WiFi Library in the format reported in the IDE documentation https://www.arduino.cc/en/Reference/wiFiConfig

in particular in the form: WiFi.config(ip, dns, gateway, subnet);

but it never worked, checking the parameters then I found that the sintax is:

WiFi.config(ip,gateway,subnet,dns);
that worked perfectly.

I think it is a Typo in the IDE documentation.
Regards.
Marco

I think the problem is that ESP32 support is a third-party product that doesn't necessarily match the Arduino documentation. Have you looked at the ESP32 documentation?

https://docs.espressif.com/projects/arduino-esp32/en/latest/

Specifically:
https://docs.espressif.com/projects/arduino-esp32/en/latest/api/wifi.html#config

This shows what you have found:

bool config(local_ip, gateway, subnet, dns1, dns2);

I think they moved DNS to the end of the list so they could be made optional.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.