Concept:
an esp8266 controls some sensors or switches and another web connected device ( ex cell phone) needs to get and set the state of the sensors or switches.
Option 1:
esp8266 is a client and gets a dynamic IP address via an AP. The server gets the esp IP address.
The cell phone also gets a dynamic address and becomes a client of the central server the esp8266 is a client of.
Both the cell phone and the esp8266 know the central server IP either directly or via dsn.
The central server maintains a list of currently connected esp devices and transfers to the cell phone the list of IP's and relays sensor data and switch settings and allows the cell phone to set switch states of a selected esp8266 IP
Option 1 is working but needs a central server.
Option 2: ( not sure how to make this work)
esp8266 devices act as servers after obtaining a dynamic IP from an AP
cell phone via a browser receives a form from the esp8266 and via action GET sets switches.
( the issue is the esp8266 IP is dynamic and the esp8266 IP is not known ( I can make it work if the esp8266 IP is known))
Now a static IP would be better but I don't know how to set a static IP for the esp8266.
If the cell phone could address any of several esp8266 servers by name by dsn the dynamic IP would be discoverable by the cell phone.
Need ideas for Option 2