ESP8266 as WiFi Hotspot

Hi folks - I'm following the code here: ESP8266 WIFI HOTSPOT

... to use a NodeMCU as a WiFi hotspot.

Everything is working very well. Though I'm surprised the ESP8266 is getting an IP Address of 192.168.4.1.

I would've expected it to be 1.1 or maybe 1.2 or something.

Can someone help me understand the logic this will use to assign IPs? I'd like to know because I'm planning to have several NodeMCUs all connected to a hotspot, then I will connect a laptop to the hotspot and write some "autodiscover" logic that will send requests to /Discovery and look for 200 responses to discover what IP addresses are active. So I need to know what heuristic to use for the ipaddresses I will send requests to. Thanks.

it is the default IP address (range) of the esp8266 SoftAP

Thanks - I tried reading more softAP documentation (Soft Access Point Class — ESP8266 Arduino Core 3.1.1-21-g32323e55 documentation) but still have two questions then:

  1. Where can I find what the default range is? I noticed from the above doucmentation I can set the initial address, gateway, and subnet, but how do I see / set what the range is it will assign?

  2. The documentation says the max number of connected stations is 8?? Does that mean I can only have up to 8 clients connected to the hotspot network? Why is that limit there? That makes my scenario not work since I'm likely to have more than 8 nodes in my project....

larrywal32:

  1. Where can I find what the default range is? I noticed from the above doucmentation I can set the initial address, gateway, and subnet, but how do I see / set what the range is it will assign?

the ESP8266WiFi library doesn't expose the SoftAP DHCP settings. you could use the SDK API

larrywal32:
2. The documentation says the max number of connected stations is 8?? Does that mean I can only have up to 8 clients connected to the hotspot network? Why is that limit there? That makes my scenario not work since I'm likely to have more than 8 nodes in my project....

the esp8266 doesn't have the resources CPU and RAM.

Thanks - bummer but appreciate it. Can you help me understand what you mean by "use the SDK API"? I don't need to set it I just want to know with high probability what the range it will use is...

reading the source code I see, that WiFi.softAPConfig sets the range as IP + 99 to IP + 199. by default the softAPConfig is called with the library default IP address 192.168.4.1. (Espressif's default in SDK is 192.168.240.1)
so the assigned addresses with library defaults start at 192.168.4.100

https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/soft-access-point-class.html#softapconfig