环境是立创衡山派D133,SDIO0挂载RTL871x WIFI,默认SDK配置下编译能通过(编译配置是 list->“3. d13x_JLC_rt-thread_helloworld”),但是测试时发生以下问题: wlan wifi_scan //这步正常搜到wifi wlan wifi_connect SSID PASSWORD //显示连接上wifi,但是路由器端并未显示 dhcpc WL0 start //尝试过在这条指令前加入额外的dhcpc WL0 stop 之后使用ifconfig: aic /> ifconfig WL0: IPv4 Address : 0.0.0.0 Default Gateway: 0.0.0.0 Subnet mask : 0.0.0.0 MAC addr : 28:f5:2b:9b:a2:1d 并没有连接,路由器后台也找不到; 换过两个路由器,更改过ssid,尝试取消过密码; 完整过程: ***** aic /> aic /> wlan wifi_scan aic /> RTL871X: survey done event(30) RTL871X: +indicate_wx_scan_complete_event 1 Infra 58:d9:d5:69:69:71 -36 1 6 WPA2 AES PSK Ciallo 2 Infra 52:77:cc:40:eb:5c -70 1 6 WPA2 AES PSK 可乐网 RTL871X: rtw_surveydone_event_callback: to_join: 0 wlan wifi_connect Ciallo 0d000721 RTL871X: wpa_set_auth_algs, AUTH_ALG_OPEN_SYSTEM RTL871X: wpa_set_encryption()=>dot11AuthAlgrthm=0, ndisauthtype=7, ndisencryptstatus=1, dot11PrivacyAlgrthm=4, dot118021XGrpPr RTL871X: set wpa passphrase=0d000721, len=8 RTL871X: wpa passphrase=0d000721, len=8 RTL871X: =>rtw_wx_set_essid RTL871X: ssid=Ciallo, len=6 RTL871X: set ssid [Ciallo] RTL871X: Set SSID under fw_state=0x00000000 RTL871X: <=rtw_wx_set_essid, ret 0 RTL871X: rtw_update_scanned_network: add network, ssid=Ciallo RTL871X: survey done event(7) RTL871X: +indicate_wx_scan_complete_event RTL871X: rtw_surveydone_event_callback: to_join: 1 RTL871X: [by_bssid:0][assoc_ssid:Ciallo]new candidate: Ciallo(58:d9:d5:69:69:71) rssi:-29 RTL871X: rtw_select_and_join_from_scanned_queue: candidate: Ciallo(58:d9:d5:69:69:71) RTL871X: rsn_len=22 wpa_len=0 RTL871X: psk_init pGblInfo->AuthKeyMgmt = 2 RTL871X: link to Ralink AP RTL871X: update_mgnt_tx_rate(): rate = 2 RTL871X: link to Ralink AP RTL871X: start auth to 58:d9:d5:69:69:71 RTL871X: issue_auth RTL871X: OnAuthClient RTL871X: auth success, start assoc RTL871X: network.SupportedRates[0]=82 RTL871X: network.SupportedRates[1]=84 RTL871X: network.SupportedRates[2]=8B RTL871X: network.SupportedRates[3]=96 RTL871X: network.SupportedRates[4]=12 RTL871X: network.SupportedRates[5]=24 RTL871X: network.SupportedRates[6]=48 RTL871X: network.SupportedRates[7]=6C RTL871X: network.SupportedRates[8]=0C RTL871X: network.SupportedRates[9]=18 RTL871X: network.SupportedRates[10]=30 RTL871X: network.SupportedRates[11]=60 RTL871X: bssrate_len = 12 RTL871X: OnAssocRsp RTL871X: association success(res=16) RTL871X: report_join_res(16) pcur_network->join_res(16) RTL871X: rtw_joinbss_update_network RTL871X: +rtw_update_ht_cap() RTL871X: rtw_joinbss_update_stainfo RTL871X: ### Set STA_(0) info ### RTL871X: STA - psta->cmn.mimo_type:0 RTL871X: STA - MAC_ID:0, SM_PS 3 RTL871X: Use WPA_STA_INFO(0) pInfo=30081f04 RTL871X: HW_VAR_BASIC_RATE: 15f -> 15f -> 15f RTL871X: WMM(0): 0, a42b RTL871X: WMM(1): 0, a44f RTL871X: WMM(2): 0, 5e4322 RTL871X: WMM(3): 0, 2f3222 RTL871X: HTOnAssocRsp RTL871X: rtl8188f_set_FwMediaStatusRpt_cmd(): mstatus = 1 macid=0 RTL871X: =>mlmeext_joinbss_event_callback RTL871X: client mode 4-1 RTL871X: client mode 4-1: Set UnicastCipher to 4 RTL871X: client mode 4-2 RTL871X: send eapol packet RTL871X: client mode 4-3 RTL871X: GTK p_KDE RTL871X: client mode 4-3: Set MulticastCipher to 4 RTL871X: client mode 4-4 RTL871X: client mode 4-Way Message 4-4 done RTL871X: send eapol packet RTL871X: Set unicastkey for MAC: 58:d9:d5:69:69:71 RTL871X: Reset GTK CCMP key id 1 rx pn to -1 RTL871X: ==> rtw_set_key algorithm(4),keyid(1),key_mask(2) RTL871X: indicate_wx_custom_event WPA/WPA2 handshake done RTL871X: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) RTL871X: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1 [I] cmd_wifi_connect()533 Connected after 2059ms. [I] cmd_wifi_connect()545 Got IP after 2064ms. aic /> dhcpc WL0 start aic /> ifconfig WL0: IPv4 Address : 0.0.0.0 Default Gateway: 0.0.0.0 Subnet mask : 0.0.0.0 MAC addr : 28:f5:2b:9b:a2:1d aic /> ping 192.168.137.1 aic /> Request timed out Request timed out Request timed out Request timed out Ping statistics for 192.168.137.1: Packets: Sent = 4 Received = 0 Lost = 4(100% loss) ***** 然后是参考了t_11929.html、t_11507.html两个帖子,按照第一个使用第三方包中的lwIP,然后按照第二个去掉 RT-Thread Components一的 [] Enable ifconfig features 和 [] Enable ping features 此时编译报错: ***** bsp\examples\test-lwip\test-eth\test_eth.c: In function 'udp_sock_set': bsp\examples\test-lwip\test-eth\test_eth.c:50:20: error: storage size of 'time' isn't known 50 | struct timeval time; | ^~~~ bsp\examples\test-lwip\test-eth\test_eth.c:53:20: error: 'ERR_OK' undeclared (first use in this function) 53 | if (ret_val != ERR_OK) { | ^~~~~~ bsp\examples\test-lwip\test-eth\test_eth.c:53:20: note: each undeclared identifier is reported only once for each function it appears in bsp\examples\test-lwip\test-eth\test_eth.c:59:73: error: invalid application of 'sizeof' to incomplete type 'struct timeval' 59 | ret_val = setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, &time, sizeof(struct timeval)); | ^~~~~~ bsp\examples\test-lwip\test-eth\test_eth.c:64:73: error: invalid application of 'sizeof' to incomplete type 'struct timeval' 64 | ret_val = setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, &time, sizeof(struct timeval)); | ^~~~~~ bsp\examples\test-lwip\test-eth\test_eth.c:50:20: warning: unused variable 'time' [-Wunused-variable] 50 | struct timeval time; | ^~~~ bsp\examples\test-lwip\test-eth\test_eth.c: In function 'cmd_test_eth': bsp\examples\test-lwip\test-eth\test_eth.c:111:14: error: called object 'socket' is not a function or function pointer 111 | socket = socket(AF_INET, SOCK_DGRAM, 0); | ^~~~~~ bsp\examples\test-lwip\test-eth\test_eth.c:75:9: note: declared here 75 | int socket; | ^~~~~~ bsp\examples\test-lwip\test-eth\test_eth.c:128:20: error: 'ERR_OK' undeclared (first use in this function) 128 | if (ret_val != ERR_OK) { | ^~~~~~ scons: *** [output\d13x_JLC_rt-thread_helloworld\bsp\examples\test-lwip\test-eth\test_eth.o] Error 1 scons: building terminated because of errors. tokis@LAPTOP-6DI9DDVE D:\MD\HSPI\3\luban-lite ***** 我希望能在这块D133上使用网络套接字,有可行的方法吗?