The sketch WIFI101 / WifiWebClient runs great (with Winc1500 breakout board).
It contains a google URL example but also says you can use google's IP address:
int status = WL_IDLE_STATUS; // if you don't want to use DNS (and reduce your sketch size) // use the numeric IP instead of the name for the server: //IPAddress server(74,125,232,128); // numeric IP for Google (no DNS) char server[] = "www.google.com"; // name address for Google (using DNS)
So I tried
char server[] = "(74,125,232,128)";
but it didn't work. Having searched the internet found this example from the Ethernet library in which the syntax seems the same but curly brackets are used:
So tried:
char server[] = "{74,125,232,128}";
but that didn't work either.
Also tried a number of other things (eg leaving off the brackets...) but no luck.
Anyone know how to make this sketch work with google's IP address instead of domain name?
Arduino has a special type called IPAddress that makes it easy to work with IP addresses. That is one of the allowed argument types of the WiFi101 library's connect function.
Change the line:
//IPAddress server(74,125,232,128); // numeric IP for Google (no DNS)
to:
IPAddress server(74,125,232,128); // numeric IP for Google (no DNS)
Change the line:
char server[] = "www.google.com"; // name address for Google (using DNS)
to:
//char server[] = "www.google.com"; // name address for Google (using DNS)