esp32软AP:为客户端设置静态IP,将MAC地址绑定到IP地址

huangapple go评论124阅读模式
英文:

esp32 softAP : Static IP for CLIENTS , bind MAC adress to IP adress

问题

SoftAP是否可以在不使用DHCP服务器的情况下为客户端分配固定IP地址?如果不能,是否有任何替代方案可以允许ESP32为特定MAC地址分配特定IP地址?

我有4个ESP32 dongles:一个通过softAP用作接入点,另外3个作为客户端连接到第一个。我想为每个dongle分配一个固定的IP地址。在客户端方面,我没有问题。但在接入点方面,当我检查已连接的站点列表时,它们的IP地址都为0.0.0.0。

英文:

Is it possible to use softAP to give fixed IP addresses to clients without using the DHCP server? If not, are there any alternatives to softAP that would allow the use of an ESP 32 to assign specific IP addresses to specific MAC addresses?

I have 4 ESP32 dongles: one is used as an Access Point via softAP, the other 3 connect as clients to the first one. I would like to assign a fixed IP to each dongle. On the client side I have no problem with this. But on the Access Point side, when I check the list of connected stations, they all have IPs equal to 0.0.0.0.

答案1

得分: 3

我怀疑 ESP IDF 中的功能缺失,通过 Arduino 也是如此。ESP IDF 中的 DHCP 服务器似乎在函数 dhcps_poll_set() 中按照连接的客户端的顺序顺序分配 IP 地址。

如常,如果你感兴趣的话,可以编写一个更好的 DHCP 服务器 esp32软AP:为客户端设置静态IP,将MAC地址绑定到IP地址

英文:

I suspect that functionality is missing in ESP IDF and by extension in Arduino. The DHCP server in ESP IDF seems to allocate IP-s sequentially in order of clients connecting in function dhcps_poll_set().

As always, you can write a better DHCP server if you feel up to it esp32软AP:为客户端设置静态IP,将MAC地址绑定到IP地址

huangapple
  • 本文由 发表于 2023年4月20日 02:00:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76057563.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定