This function allows you to configure a static IP address, change the DNS, gateway, and subnet addresses on the WiFi shield manually. (WiFi.begin automatically configures to use DHCP)
WiFi.config(ip, dns, gateway);
WiFi.config(ip, dns, gateway, subnet);
- ip: the IP address of the device (array of 4 bytes)
- dns: the address for a DNS server.
- gateway: the IP address of the network gateway (array of 4 bytes). optional: defaults to the device IP address with the last octet set to 1
- subnet: the subnet mask of the network (array of 4 bytes). optional: defaults to 255.255.255.0