ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?

byjove
Posts: 3
Joined: Sat Jul 27, 2019 2:37 pm

ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?

Postby byjove » Sat Jul 27, 2019 3:35 pm

如果wifi mesh无路由组网后,root node 怎么让手机APP连接并控制所有节点?有没有这方面的DEMO?

ESP_Bond
Posts: 51
Joined: Mon Apr 15, 2019 1:37 pm

Re: ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?

Postby ESP_Bond » Mon Jul 29, 2019 8:17 am

MESH 的 AP 不支持 非mesh 设备接入, 你可以使用一个 ESP32 作用 softap, 可以参见: mesh -> "with-router" example work with ... IDF softAP

iPhone TCP Server..................< ESP32 softAP->........WROOM ESP-MDF router sample

byjove
Posts: 3
Joined: Sat Jul 27, 2019 2:37 pm

Re: ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?

Postby byjove » Fri Aug 02, 2019 12:31 pm

谢谢回复。
现在我用一个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);
}

ESP_Bond
Posts: 51
Joined: Mon Apr 15, 2019 1:37 pm

Re: ESP32-S 无路由MESH组网,APP怎么连接root接口的softAP?

Postby ESP_Bond » Tue Aug 06, 2019 9:32 am

请参考: mesh -> "with-router" example doesn't work with espressif IDF softAP #71 https://github.com/espressif/esp-mdf/issues/71

Image

```
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 23 guests