Wifi 101 compile error : IPAddress.fromString

I'm using an Arduino Uno with the Wifi101 shield with v1.7.9 of the IDE.

When I try to compile the example code provided with Wifi101 shield, I get an error of

'class IPAddress' has no member named 'fromString'

The offending code is in Wifi101-master\src\Wifi.cpp in the WiFiClass::hostByName() function.

The GitHub history suggests this was added to handle a provided hostname that is already and ipaddress. I can work around this by just commenting out that test but am wondering why this seemingly incompatible mod was made.

Anyone else have this problem?

--Ed

I am doing some work to port this library to other arch and I found your issue.

I am using chipkit approach, the function that verify if the hostname is already an IP address is in Ethernet library, Dns.cpp, I decide to put it in the WiFi class but perhaps it later get into another place line the same Dns.cpp.

Here is the function

int WiFiClass::inet_aton(const char* aIPAddrString, IPAddress& aResult)
{
    // See if we've been given a valid IP address
    const char* p =aIPAddrString;
    while (*p &&
           ( (*p == '.') || (*p >= '0') || (*p <= '9') ))
    {
        p++;
    }

    if (*p == '\0')
    {
        // It's looking promising, we haven't found any invalid characters
        p = aIPAddrString;
        int segment =0;
        int segmentValue =0;
        while (*p && (segment < 4))
        {
            if (*p == '.')
            {
                // We've reached the end of a segment
                if (segmentValue > 255)
                {
                    // You can't have IP address segments that don't fit in a byte
                    return 0;
                }
                else
                {
                    aResult[segment] = (byte)segmentValue;
                    segment++;
                    segmentValue = 0;
                }
            }
            else
            {
                // Next digit
                segmentValue = (segmentValue*10)+(*p - '0');
            }
            p++;
        }
        // We've reached the end of address, but there'll still be the last
        // segment to deal with
        if ((segmentValue > 255) || (segment > 3))
        {
            // You can't have IP address segments that don't fit in a byte,
            // or more than four segments
            return 0;
        }
        else
        {
            aResult[segment] = (byte)segmentValue;
            return 1;
        }
    }
    else
    {
        return 0;
    }
}

Just add the prototype to .h

int inet_aton(const char* aIPAddrString, IPAddress& aResult);

and the if clause will be

// check if aHostname is already an ipaddress
if (inet_aton(aHostname, aResult)) {

I had same issue, but fixed it by updating Arduino IDE (which also updates libraries).

ejbaker: I'm using an Arduino Uno with the Wifi101 shield with v1.7.9 of the IDE.

When I try to compile the example code provided with Wifi101 shield, I get an error of

'class IPAddress' has no member named 'fromString'

The offending code is in Wifi101-master\src\Wifi.cpp in the WiFiClass::hostByName() function.

The GitHub history suggests this was added to handle a provided hostname that is already and ipaddress. I can work around this by just commenting out that test but am wondering why this seemingly incompatible mod was made.

Anyone else have this problem?

--Ed

please note that the current Arduino IDE is 1.6.9 downloadable from https://www.arduino.cc/en/Main/Software

update also the wifi101 library to 0.9.1