cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

New Contributor II
Every once in a while the second call to wiced_hostname_lookup() in sequence below returns the same IP address of the first call:

    WPRINT_APP_INFO(("Resolving IP address of Cometa server

" ));

    wiced_hostname_lookup("service.cometa.io", &ip_address, 15000);

    WPRINT_APP_INFO(("Cometa is at %u.%u.%u.%u

", (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 24),

                                                  (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 16),

                                                  (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 8),

                                                  (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 0) ) );

    #define APP_SERVER "www.cloudfridge.io"

    WPRINT_APP_INFO( ( "Resolving IP address of Application server %s

", APP_SERVER));

    result = wiced_hostname_lookup(APP_SERVER, &app_ip_address, 15000);

if (result != WICED_SUCCESS) {

       WPRINT_APP_INFO(("Error in DNS lookup for App server.

"));

       return;

      }

    WPRINT_APP_INFO( ( "App server is at %u.%u.%u.%u

", (uint8_t)(GET_IPV4_ADDRESS(app_ip_address) >> 24),

                                                  (uint8_t)(GET_IPV4_ADDRESS(app_ip_address) >> 16),

                                                  (uint8_t)(GET_IPV4_ADDRESS(app_ip_address) >> 8),

                                                  (uint8_t)(GET_IPV4_ADDRESS(app_ip_address) >> 0)));
0 Likes
Reply
3 Replies
New Contributor II

It is an issue in 2.4. In general I find wiced_hostname_lookup() very unreliable.

0 Likes
Reply
Employee

Some more comments:

Part of this may be because the lookup() function sends a UDP request to all the registered DNS servers, and then waits for the remaining time (derived from the timeout passed to lookup()), for a reply. So, there is actually no retries happening.

0 Likes
Reply
New Contributor II

This explains the behavior I am seeing. It may be worthwhile documenting.

In general, I cannot rely on the lookup() function. I wonder if you can provide any other insights.

0 Likes
Reply