Can't resolve mDNS name
Posted: Wed Apr 16, 2014 9:35 am
Hi
I'm trying to put a system together with a Raspberry Pi acting as a web socket server for WiFIDipCortex WiFi nodes. I'm using mDNS and on the RPi I'm using Avahi to set and report a mDNS name of server.local. This works and I can resolve this correctly on iOS and Windows based machines running Bonjour. However, when I try to do this with mbed using the CC3000 library on the WiFiDipCortex, when using gethostbyname() I get:
Get IP address for server.local
gethostbyname Returned code : -73
Failed to resolve
This code works fine for 'ordinary' DNS names and resolves these correctly to their IP address
The code is:
uint32_t ip;
int32_t resolveRetCode = 0;
uint8_t *HostToPing = (uint8_t *)ACTIFI_SERVER_URL;
printf("Get an IP address for %s\r\n",HostToPing);
sprintf (DebugTextBuffer, "Get IP address for %s\r\n",HostToPing); REPORT;
resolveRetCode = wifi._socket.gethostbyname(HostToPing,strlen((const char *)HostToPing), &ip);
sprintf (DebugTextBuffer, "gethostbyname Returned code : %i \r\n", resolveRetCode); REPORT;
REPORT being a macro which supports serial port debug messages and which works fine.
Any ideas?
I'm trying to put a system together with a Raspberry Pi acting as a web socket server for WiFIDipCortex WiFi nodes. I'm using mDNS and on the RPi I'm using Avahi to set and report a mDNS name of server.local. This works and I can resolve this correctly on iOS and Windows based machines running Bonjour. However, when I try to do this with mbed using the CC3000 library on the WiFiDipCortex, when using gethostbyname() I get:
Get IP address for server.local
gethostbyname Returned code : -73
Failed to resolve
This code works fine for 'ordinary' DNS names and resolves these correctly to their IP address
The code is:
uint32_t ip;
int32_t resolveRetCode = 0;
uint8_t *HostToPing = (uint8_t *)ACTIFI_SERVER_URL;
printf("Get an IP address for %s\r\n",HostToPing);
sprintf (DebugTextBuffer, "Get IP address for %s\r\n",HostToPing); REPORT;
resolveRetCode = wifi._socket.gethostbyname(HostToPing,strlen((const char *)HostToPing), &ip);
sprintf (DebugTextBuffer, "gethostbyname Returned code : %i \r\n", resolveRetCode); REPORT;
REPORT being a macro which supports serial port debug messages and which works fine.
Any ideas?