Skip to content

NSAPI DNS queries failing for some websites #3926

@sarahmarshy

Description

@sarahmarshy

Description


Bug

Target
K64F

Toolchain:
GCC_ARM|ARM|IAR

meed-os sha:
88a4baa Merge pull request #3902 from mazimkhan/master

Steps to reproduce
Run this simple program:

#include "mbed.h"
#include "TCPSocket.h"
#include "ESP8266Interface.h"

ESP8266Interface wifi(MBED_CONF_APP_WIFI_TX, MBED_CONF_APP_WIFI_RX);

int main()
{
    printf("WiFi example\r\n\r\n");

    printf("\r\nConnecting...\r\n");
    int ret = wifi.connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
    if (ret != 0) {
        printf("\r\nConnection error\r\n");
        return -1;
    }

    printf("Success\r\n\r\n");

    TCPSocket socket;

    socket.open(&wifi);
    ret = socket.connect("www.arm.com", 80);
    printf("%d\r\n", ret);

    wifi.disconnect();

    printf("\r\nDone\r\n");
}

Get this output:

WiFi example


Connecting...
Success

-3009

Done

-3009 indicates connection to address failed. Looking deeper, it fails at the DNS resolution step.

However, if you try to connect to google.com, you get this output:

WiFi example


Connecting...
Success

0

Done

This seems to also be affecting mbed-client behavior - ARMmbed/mbed-os-example-client#205.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions