esp-idf: Assign specific IPs?
Posted: Sat Apr 18, 2020 4:13 pm
Hi!
I have one ESP32 board working as an Access Point, several others as stations connecting to this AP.
Is there a way to assign them specific IPs? E.g., I have a list of MACs from the stations and whenever a specific board joins the WiFi, I'd like to assign it an IP corresponding to its index in this list, so that they're "ordered" in the same way for easier processing.
I'm using esp-idf. I wasn't able to find an API to assign IPs, would be cool if you could help me out.
Thanks in advance.
edit: alternatively, is the AP board able to read an IP (inside the event handler or something) and the MAC to create some sort of IP/MAC dictionary?
I have one ESP32 board working as an Access Point, several others as stations connecting to this AP.
Is there a way to assign them specific IPs? E.g., I have a list of MACs from the stations and whenever a specific board joins the WiFi, I'd like to assign it an IP corresponding to its index in this list, so that they're "ordered" in the same way for easier processing.
I'm using esp-idf. I wasn't able to find an API to assign IPs, would be cool if you could help me out.
Thanks in advance.
edit: alternatively, is the AP board able to read an IP (inside the event handler or something) and the MAC to create some sort of IP/MAC dictionary?