NRF7002-DK and DNS resolver

Hello,

I've been evaluating the NRF7002-DK with 2.3.0-rc1 SDK. Although there's almost no documentation on how to use Noridc's WiFi stack (at least I haven't found any), the samples in the SDK were great and I was able to get the scanning, connecting and DHCP working just fine.

Where I faced issues was with DNS host resolution using the getaddrinfo API - it just times out regardless the timeout value I put in configuration. I have a feeling this has to do with the configuration, but I wasn't able to figure this out. Attempting to debug the issue cause stack overflow as the library seem to be 'caught' in the middle of static initialization when VScode stops on 'main()' entry.

I would greatly appreciate any help to unblock the use of getaddrinfo() API. Thank you!

Here's what I have in the prj.conf

# WiFi stack.
CONFIG_WIFI=y
CONFIG_WIFI_NRF700X=y
CONFIG_NET_L2_WIFI_MGMT=y
# WPA Supplicant is required to establish WiFi connection.
CONFIG_WPA_SUPP=y

# Networking stack needed for WiFi to operate.
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_DHCPV4=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_NET_TCP=y
CONFIG_NET_SOCKETS_POLL_MAX=10
CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y

CONFIG_DNS_RESOLVER=y
CONFIG_DNS_NUM_CONCUR_QUERIES=2
CONFIG_DNS_RESOLVER_LOG_LEVEL_DBG=y
CONFIG_NET_SOCKETS_DNS_TIMEOUT=30000

# SSL?
CONFIG_POSIX_CLOCK=y
CONFIG_ENTROPY_GENERATOR=y

# Buffers.
CONFIG_NET_PKT_RX_COUNT=8
CONFIG_NET_PKT_TX_COUNT=8

# Memories.
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096
CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096

  • Hi,

    With regard to the MQTT sample, I have tested it with additional configuration (which was initially provided) added to the prj.conf. I used nRF7002-DK and NCS v2.3.0-rc1. I could not reproduce the issue with getaddrinfo(). In addition to your changes, I had to add several configuration options (which are shown below) to prj.conf.

    CONFIG_WIFI_CREDENTIALS_STATIC=y
    CONFIG_WIFI_CREDENTIALS_STATIC_SSID="YourAccesPointSSID"
    CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="YourPassword"


    Best regards,
    Dejan

  • I think I was finally able to pin-point the problem... My WiFi network is built on Eero Pro Wifi mesh that runs on both 2.4GHZ and 5GHZ frequencies. The DNS resolution works perfectly fine if I disable the 5GHZ band and stops working if both bands are enabled. I've tried to force the band in struct wifi_connect_req_params::band field and setting it to WIFI_FREQ_BAND_2_4_GHZ before connecting with both bands enabled on the WiFi, but the DNS resolution still didn't work.

    My understanding was the NRF7002 chip supports WiFi 6 and supposed to work on both bands, but the SDK seems to be under development still - is this something Nordic team is still working on?

  • Hi,

    What is the result if you disable 2.4 GHz band and enable 5 GHz band? 

    Could you try Wi-Fi Shell sample when only one, or both of the bands are enabled? What is the result when you run two commands shown below?

    net dns <hostname>
    net ping <resolved hostname>


    Best regards,
    Dejan

  • I tried with the wifi shell app, and the results are similar to what I experienced with my code (need to run wifi connect <ssid> 0 <psk> before running the commands you've suggested):

    2.4GHZ network

    uart:~$ net dns www.google.com
    Query for 'www.google.com' sent.
    dns: 142.250.72.164
    dns: All results received
    uart:~$ net ping  142.250.72.164
    PING 142.250.72.164
    28 bytes from 142.250.72.164 to 192.168.0.203: icmp_seq=0 ttl=59 time=42 ms
    28 bytes from 142.250.72.164 to 192.168.0.203: icmp_seq=1 ttl=59 time=35 ms
    28 bytes from 142.250.72.164 to 192.168.0.203: icmp_seq=2 ttl=59 time=43 ms
    

    Mixed 2.4GHZ+5GHZ network

    uart:~$ net dns www.google.com
    Query for 'www.google.com' sent.
    dns: Timeout while resolving name.
    

  • Hi,

    dejans said:
    What is the result if you disable 2.4 GHz band and enable 5 GHz band? 

    Could you provide the result on 5 GHz?

    Best regards,
    Dejan

Related