简体   繁体   中英

How to retrieve remote client IP address esp32 soft AP mode

My goal is to retrieve the IP address of client connected to an esp32 in soft Access Point mode WITHOUT client sending a request.

So far calling "remoteIP()" method from "client" object seems to be the only way I can successfully retrieve connected client IP is when an HTTP request is made.

If I call "client.remoteIP()" before the remote client sends an HTTP request I get All zeros, yikes.

Currently I'm polling the "softAPgetStationNum()" method from "WiFi" object and I'm alerted as soon as a device is connected or disconnected. I would like to get the client IP along with the new connection alert.

My advanced apologies for not including my code hopefully my description has enough clarity to properly relay my intended objective. Thanks

Ps- if I could get guidance on retrieving MAC of remote client too that would be dope!

我不知道 Arduino 在 Espressif 框架之上构建了什么接口,但底层的 ESP IDF v4.3 具有函数esp_wifi_ap_get_sta_list() ,它为您提供所有连接站(包括 MAC)的列表和映射此列表的esp_netif_get_sta_list()客户端到他们的 IP 地址。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM