ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?
ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?
如果wifi mesh无路由组网后,root node 怎么让手机APP连接并控制所有节点?有没有这方面的DEMO?
Re: ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?
MESH 的 AP 不支持 非mesh 设备接入, 你可以使用一个 ESP32 作用 softap, 可以参见: mesh -> "with-router" example work with ... IDF softAP
iPhone TCP Server..................< ESP32 softAP->........WROOM ESP-MDF router sample
iPhone TCP Server..................< ESP32 softAP->........WROOM ESP-MDF router sample
Re: ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?
谢谢回复。
现在我用一个DEMO板做AP,另一个做MESH来组网,然后MESH能连到AP,但不能connect 到AP上的TCP SERVER
用的示例是esp-idf\examples\mesh\internal_communication
struct sockaddr_in serv_addr;
fd_set read_set, write_set, error_set;
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd == -1) {
ESP_LOGE(TAG, "create socket failed!");
continue;
}
memset( &serv_addr, 0 , sizeof (serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(SERVER_PORT);
serv_addr.sin_addr.s_addr = inet_addr(SERVER_IP);
int conn_ret = connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
if (conn_ret == -1) {
ESP_LOGE(TAG, "connect to server failed! errno=%d", errno);
close(sockfd);
continue;
} else {
ESP_LOGI(TAG, "connected to tcp server OK, sockfd:%d...", sockfd);
}
现在我用一个DEMO板做AP,另一个做MESH来组网,然后MESH能连到AP,但不能connect 到AP上的TCP SERVER
用的示例是esp-idf\examples\mesh\internal_communication
struct sockaddr_in serv_addr;
fd_set read_set, write_set, error_set;
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd == -1) {
ESP_LOGE(TAG, "create socket failed!");
continue;
}
memset( &serv_addr, 0 , sizeof (serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(SERVER_PORT);
serv_addr.sin_addr.s_addr = inet_addr(SERVER_IP);
int conn_ret = connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
if (conn_ret == -1) {
ESP_LOGE(TAG, "connect to server failed! errno=%d", errno);
close(sockfd);
continue;
} else {
ESP_LOGI(TAG, "connected to tcp server OK, sockfd:%d...", sockfd);
}
Re: ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?
请参考: mesh -> "with-router" example doesn't work with espressif IDF softAP #71 https://github.com/espressif/esp-mdf/issues/71
```
tcpip_adapter_ip_info_t ip_info = {
.ip.addr = ipaddr_addr("192.168.1.1"),
.netmask.addr = ipaddr_addr("255.255.255.0"),
.gw.addr = ipaddr_addr("192.168.1.1"),
};
tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP);
tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &ip_info);
tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP);
```
```
tcpip_adapter_ip_info_t ip_info = {
.ip.addr = ipaddr_addr("192.168.1.1"),
.netmask.addr = ipaddr_addr("255.255.255.0"),
.gw.addr = ipaddr_addr("192.168.1.1"),
};
tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP);
tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &ip_info);
tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP);
```
Who is online
Users browsing this forum: No registered users and 10 guests