I'm building a mesh with ESP32 dev kits (ESP32-DevKitC V4) using the ESP-IDF VS Code extension and the ip_internal_network example project. The code for the example, common project components, and the API is linked. When the mesh nodes power on and build the network, they use the 10.0.0.0 network. How do I change the internal mesh network?
My operating assumptions:
- The root node receives an external IP address from an external DHCP server.
- The root node acts as an internal DHCP server to the mesh nodes.
- The root node performs network address translation.
- Its DHCPv4 server runs on the lwIP TCP/IP stack.
- Internal IP addresses are leased from a pool governed by the root node (but it's possible that nodes request a particular address from this network and the server provides the next available; I'm unsure).
- The network address is 10.0.0.0/8 (I inferred the subnet mask; it could be anything).
Obviously, the first thing I tried was searching for this network address in files. There was nothing in the project workspace and too many hits in the repo to be useful. I tried decimal and hex with no luck.
I also tried tracing the function that prints the IP address to the serial terminal to find the IP var, and working backwards to locate the statement that initializes this variable. I'm still reading event handler API documentation so I haven't made quick progress here either.
The programming interface is split among ESP-IDF component header files, build systems (CMake and Ninja?), KConfig options and host tools (idf.py?). C, FreeRTOS and build systems are all new to me so I would appreciate if someone with more experience could weigh in. Thank you.