@awwwwa 好的,感谢我试试
M
Mxf4511 发布的最新帖子
-
R128 作为TCP客户端连接问题
R128作为AP,电脑作为STA连接上R128的WIFI之后,
R128作为TCP的客户端,电脑作为TCP的服务端,在R128这边创建socket之后,进行connect的时候,一直连接失败,用wireshark抓包看,R128这边好像发不出任何TCP的数据包然后就返回connect失败了,
connect() 返回的错误码是103,
然后R128自己输出的LOG是 [WAR:1612]drop=1341, fctl=0x00d0.电脑端IP地址:
tcp客户端连接代码:void app_tcp_open_socket(char* ip_addr, uint16_t port) { printf("[AppTcp] create a socket\n"); tcp_sock = socket(AF_INET, SOCK_STREAM, 0); if (tcp_sock < 0) { printf("[AppTcp] Unable to create socket: errno %d\n", errno); return ; } tcp_dest_addr.sin_family = AF_INET; // tcp_dest_addr.sin_addr.s_addr = inet_addr(ip_addr); tcp_dest_addr.sin_port = htons(port); if (inet_aton(ip_addr, &tcp_dest_addr.sin_addr) == 0) { printf("Error: Invalid server IP address\n"); close(tcp_sock); return; } printf("[AppTcp] Socket created, connecting to %s:%d", ip_addr, port); int err = connect(tcp_sock, (struct sockaddr *)&tcp_dest_addr, sizeof(tcp_dest_addr)); if (err != 0) { printf("[AppTcp] Socket unable to connect: errno %d\n", errno); return ; } printf("[AppTcp] Successfully connected"); }
Hello,R128!! [csi_jpeg][csi] probe ok, irq is 109 [csi_err]output size morn than sensor size, sensor:640*480, output:1280*768 [csi_jpeg]csi_size = 0, jpeg_size = 51200, total size = 52863 [gc2145]V4L2_IDENT_SENSOR = 2145 [gc2145]GC2145 chip id read success 0x2145 [gc2145]GC2145 Init Done [gc2145]GC2145 Init ok!! [ACT D][ring_buff_init,29]enter [ACT D][ring_buff_start,176]ring buffer start enter [ACT D][ring_buff_start,190]ring buffer start quit en0: CTRL-EVENT-TERMINATING [WAR:1262]join_status:0 [WAR:852]do not read pout from efuse!!!! interface name: en1 WIF: wifi mode ap onUsing interface en1 with hwaddr 18:1c:1d:1e:1f:20 and ssid "AP-XRADIO" en1: interface state UNINITIALIZED->ENABLED en1: AP-ENABLED en1: AP-DISANBLED g <wlan connected> [net INF] bring up netif [net INF] netif (IPv4) is up [net INF] address: 192.168.51.1 [net INF] gateway: 192.168.51.1 [net INF] netmask: 255.255.255.0 wifi enable [net INF] msg <network up> event unknow WAR: unknown msg (19, 0) vif0, AP/GO mode THROTTLE=38 en1: interface state ENABLED->DISABLED [net INF] msg <wlan disconnected> [net INF] netif is link down wifi disable [WAR:852]do not read pout from efuse!!!! Using interface en1 with hwaddr 18:1c:1d:1e:1f:20 and ssid "ToothScan" en1: interface state DISABLED->ENABLED en1: AP-ENABLED [net INF] msg <wlan connected> [net INF] netif is link up [net INF] netif is already up wifi enable [net INF] msg <network up> event unknow vif0, AP/GO mode THROTTLE=38 9, 0) ap param: ssid:ToothScan psk: wifi channel:6 IPV4 Addr:192.168.51.1 MAC Addr: 0: 0: 0: 0: 0: 0 Init app_tcp task xr_newassoc(): link_id:0 mac:60:45:2e:7f:0b:66 en1: STA 60:45:2e:7f:0b:66 IEEE 802.11: associated en1: AP-STA-CONNECTED 60:45:2e:7f:0b:66 [net INF] msg <wlan ap-sta connected> wifi sta connected dev param: dev: [WAR:1612]drop=1341, fctl=0x00d0. [WAR:1612]drop=1341, fctl=0x00d0. [AppTcp] Reconnect Tcp Services [AppTcp] create a socket [AppTcp] Socket created, connecting to 192.168.51.100 :1347[AppTcp] Socket unable to connect: errno 103
-
回复: R128 WIFI AP模式获取连接设备的IP地址的问题
@awwwwa LWIP找了几天,没有找到dhcp服务端获取已分配ip的例子,可以提供一个简单的例子吗?
-
回复: R128 WIFI AP模式获取连接设备的IP地址的问题
@awwwwa wifi -l ap 这个指令我也试过了,它调用的就是wifi_ap_get_config()来获取,它返回的ap的地址是对的,但是返回的sta信息好像是mac地址,不是ip地址.
而且很奇怪,我明明只有一个设备连接,但是获取到的sta_num却有4个 -
R128 WIFI AP模式获取连接设备的IP地址的问题
R128的WIFI在AP模式下,其它设备连接这个WIFI,怎么在R128这边获取到分配给连接设备的IP地址呢?
官方的文档里没看到有提到具体方法,代码里水平有限也找不到接口