I have an ESP8266 module (particularly, Cactus Micro r2), which is able to connect to local network and then communicate with my local server via HTTP protocol. However, I have to provide the network SSID, password and the IP address of my server.
Is is possible for the ESP module to send a HTTP broadcast to the whole network with a particular header? And then, the server recognizing the header would respond, thus its IP address would be detected automatically? If not with HTTP, is it achievable with UDP? And is there a communication pattern for the client and server to discover each other?
The only solution (or rather a work-around) I have invented so far, is to iterate through the whole address range of a local subnet (which is usually 192.168.1.1-192.168.1.254) and try to initiate communication. However, this is extremely slow (if the server's IP address is in the upper half of the range). Plus, it will not work on 10.0.0.0 network (not to mention pure IPv6 networks...).
arp -ajust tracks what IP/mac addresses has talked to your machine (or your machine has talked to). If it doesn't "know" the server, then it probably hasn't talked to it either. - Mats Petersson