Golioth Zephyr training nRF7002-DK issues

I am facing issue when I try the Golioth Zephyr training nRF7002-DK.
https://training.golioth.io/docs/golioth-exploration/golioth-intro/connect-nRF7002-to-golioth

The connection to the WIFI network works correctly and the card gets an IP address.

It works sometimes without explanation.
The rest of the time I get this error:

[00:05:45.764,251] <inf> golioth_system: Starting connect
[00:05:49.765,014] <err> golioth: Fail to get address (coap.golioth.io 5684) -101
[00:05:49.765,045] <err> golioth_system: Failed to connect: -11
[00:05:49.765,045] <wrn> golioth_system: Failed to connect: -11
[00:05:54.765,136] <inf> golioth_system: Starting connect
[00:05:58.765,899] <err> golioth: Fail to get address (coap.golioth.io 5684) -101
[00:05:58.765,930] <err> golioth_system: Failed to connect: -11
[00:05:58.765,930] <wrn> golioth_system: Failed to connect: -11

Full log

uart:~$ kernel reboot cold▒

[00:00:00.271,331] <inf> wifi_nrf: QSPI freq = 24 MHz

[00:00:00.271,362] <inf> wifi_nrf: QSPI latency = 1

[00:00:00.278,869] <inf> wifi_nrf: wifi_nrf_fmac_fw_load: LMAC patches loaded

[00:00:00.289,733] <inf> wifi_nrf: wifi_nrf_fmac_fw_load: LMAC boot check passed

[00:00:00.292,694] <inf> wifi_nrf: wifi_nrf_fmac_fw_load: UMAC patches loaded

[00:00:00.303,527] <inf> wifi_nrf: wifi_nrf_fmac_fw_load: UMAC boot check passed

[00:00:00.326,171] <inf> wifi_nrf: RPU LPM type: HW

*** Booting Zephyr OS build v3.2.99-ncs2 ***
[00:00:00.441,101] <inf> golioth_system: Initializing
[00:00:00.444,854] <inf> fs_nvs: 6 Sectors of 4096 bytes
[00:00:00.444,854] <inf> fs_nvs: alloc wra: 0, f78
[00:00:00.444,885] <inf> fs_nvs: data wra: 0, 100
[00:00:00.445,343] <inf> net_config: Initializing network
[00:00:00.445,373] <inf> net_config: Waiting interface 1 (0x20001950) to be up...
[00:00:00.446,197] <inf> net_config: IPv4 address: 192.168.1.99
[00:00:00.446,228] <inf> net_config: Running dhcpv4 client...
[00:00:00.447,418] <dbg> golioth_iot: main: Start Golioth IoT
[00:00:00.447,479] <inf> golioth_iot: Starting nrf7002dk_nrf5340_cpuapp with CPU frequency: 64 MHz
[00:00:00.447,723] <inf> wpa_supp: z_wpas_start: 385 Starting wpa_supplicant thread with debug level: 3

[00:00:00.447,937] <inf> wpa_supp: Successfully initialized wpa_supplicant
[00:00:01.447,631] <inf> golioth_iot: Static IP address (overridable): 192.168.1.99/255.255.255.0 -> 192.168.1.1
uart:~$
[00:00:12.721,099] <inf> golioth_system: Starting connect
[00:00:12.721,252] <err> golioth: Fail to get address (coap.golioth.io 5684) -11
[00:00:12.721,282] <err> golioth_system: Failed to connect: -11
[00:00:12.721,282] <wrn> golioth_system: Failed to connect: -11
[00:00:17.721,343] <inf> golioth_system: Starting connect
[00:00:17.721,496] <err> golioth: Fail to get address (coap.golioth.io 5684) -11
[00:00:17.721,527] <err> golioth_system: Failed to connect: -11
[00:00:17.721,527] <wrn> golioth_system: Failed to connect: -11

What can I do to fix that?

Regards

Here is the board status:

uart:~$ device list
devices:
- clock@5000 (READY)
- gpio@842800 (READY)
- gpio@842500 (READY)
- crypto@50844000 (READY)
- uart@8000 (READY)
- flash-controller@39000 (READY)
- mbox@2a000 (READY)
- wlan0 (READY)

It looks to me like you’re not receiving an IP address from the DHCP server so the network connection is not fully negotiated. That is consistent with the -11 (EAGAIN: no more contexts) error code which I believe is issued when no socket is available.

When the connection is fully established you should see more logging output about the IP address acquisition. Here’s what my board shows:

``*** Booting Zephyr OS build v3.2.99-ncs2 ***                                                                                                                   
[00:00:00.492,736] <inf> golioth_system: Initializing                                                                                                          
[00:00:00.496,826] <inf> fs_nvs: 6 Sectors of 4096 bytes                                                                                                       
[00:00:00.496,826] <inf> fs_nvs: alloc wra: 0, f88                                                                                                             
[00:00:00.496,856] <inf> fs_nvs: data wra: 0, b4                                                                                                               
[00:00:00.497,314] <inf> net_config: Initializing network                                                                                                      
[00:00:00.497,344] <inf> net_config: Waiting interface 1 (0x20001940) to be up...                                                                              
[00:00:00.498,138] <inf> net_config: IPv4 address: 192.168.1.99                                                                                                
[00:00:00.498,199] <inf> net_config: Running dhcpv4 client...                                                                                                  
[00:00:00.500,793] <inf> add_golioth: Starting nrf7002dk_nrf5340_cpuapp with CPU frequency: 64 MHz                                                             
[00:00:00.501,007] <inf> wpa_supp: z_wpas_start: 385 Starting wpa_supplicant thread with debug level: 3                                                        
                                                                                                                                                               
[00:00:00.501,220] <inf> wpa_supp: Successfully initialized wpa_supplicant                                                                                     
[00:00:01.500,915] <inf> add_golioth: Static IP address (overridable): 192.168.1.99/255.255.255.0 -> 192.168.1.1                                               
[00:00:03.105,895] <inf> add_golioth: Connection requested                                                                                                     
[00:00:06.691,406] <inf> wpa_supp: wlan0: SME: Trying to authenticate with c6:ff:d4:a8:fa:10 (SSID='YourWiFiSSID' freq=2437 MHz)                        
[00:00:06.694,732] <inf> wifi_nrf: wifi_nrf_wpa_supp_authenticate:Authentication request sent successfully                                                     
                                                                                                                                                               
[00:00:06.953,857] <inf> wpa_supp: wlan0: Trying to associate with c6:ff:d4:a8:fa:10 (SSID='YourWiFiSSID' freq=2437 MHz)                                
[00:00:06.961,822] <inf> wifi_nrf: wifi_nrf_wpa_supp_associate: Association request sent successfully                                                          
                                                                                                                                                               
[00:00:06.978,027] <inf> wpa_supp: wlan0: Associated with c6:ff:d4:a8:fa:10                                                                                    
[00:00:06.978,179] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0                                                                             
[00:00:07.001,251] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with c6:ff:d4:a8:fa:10 [PTK=CCMP GTK=CCMP]                                            
[00:00:07.001,464] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to c6:ff:d4:a8:fa:10 completed [id=0 id_str=]                                      
[00:00:07.010,131] <inf> add_golioth: Connected                                                                                                                
[00:00:07.011,413] <inf> golioth_system: Starting connect                                                                                                      
[00:00:07.013,580] <err> golioth: Fail to get address (coap.golioth.io 5684) -11                                                                               
[00:00:07.013,580] <err> golioth_system: Failed to connect: -11                                                                                                
[00:00:07.013,610] <wrn> golioth_system: Failed to connect: -11                                                                                                
[00:00:07.034,118] <inf> net_dhcpv4: Received: 192.168.1.127                                                                                                   
[00:00:07.034,210] <inf> net_config: IPv4 address: 192.168.1.127                                                                                               
[00:00:07.034,240] <inf> net_config: Lease time: 43200 seconds                                                                                                 
[00:00:07.034,271] <inf> net_config: Subnet: 255.255.255.0                                                                                                     
[00:00:07.034,301] <inf> net_config: Router: 192.168.1.1                                                                                                       
[00:00:07.035,095] <inf> add_golioth: DHCP IP address: 192.168.1.127                                                                                           
[00:00:12.013,671] <inf> golioth_system: Starting connect                                                                                                      
This is the main loop: 0                                                                                                                                       
[00:00:12.650,390] <inf> golioth_system: Client connected!

I wonder if you can try moving closer to the router in case it’s signal strength, or try a different AP to see if that is an issue?

Another good troubleshooting step for wifi devices is setting up a hotspot on your mobile (the phone serves up WiFi), since you can often view that a device has been connected. It gives me additional troubleshooting powers since i don’t normally have access to my WiFi router’s admin menus (I try to lock those down)

My nRF7002 kit no longer works. It is defective. I have to get a new one.

There was an issue with my nRF7002-DK board. I got a new one and it works now:

[00:23:34.916,961] <inf> golioth_iot: Sending hello! 280
[00:23:34.919,494] <inf> golioth_iot: Streaming Temperature to Golioth: 28.140000
[00:23:39.919,738] <inf> golioth_iot: Sending hello! 281
[00:23:39.922,271] <inf> golioth_iot: Streaming Temperature to Golioth: 28.110000
[00:23:44.922,515] <inf> golioth_iot: Sending hello! 282
[00:23:44.925,048] <inf> golioth_iot: Streaming Temperature to Golioth: 28.240000
[00:23:49.925,323] <inf> golioth_iot: Sending hello! 283
[00:23:49.927,856] <inf> golioth_iot: Streaming Temperature to Golioth: 27.890000
[00:23:54.928,100] <inf> golioth_iot: Sending hello! 284
[00:23:54.930,633] <inf> golioth_iot: Streaming Temperature to Golioth: 28.340000