Edited after reading in hopes to tackle the question a bit better...
http://espip/settings this is where you change your connection settings.
http://espip/edithttp://espip/varshttp://espip/filemngespip if not connected to wifi is 192.168.4.1
To print your esp ip if connected to wifi
Save and run that as your program.
To set static IP you must connect manually to wifi within your program.
connect ssid password ip gateway subnet
example:
Code: Select allconnect "networkName" "Password" "192.168.1.35" "192.168.1.1" "255.255.255.0"
To find your wifi ip you can log in to your router. View your devices...
If you are unable to access your router this tool works fairly well to tell you what is on the LAN.
http://www.nirsoft.net/utils/wireless_network_watcher.html for windows anyways.
If you are using linux I suspect you already are aware of how to find it.
Maybe this will answer your question I'm not entirely sure I got what the line of questioning was ... But this should give you some noitcerid <-----start reading word from this side :P