Reputation: 3252
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...).
Upvotes: 0
Views: 1094
Reputation: 2929
If you want your esp to find a dedicated server in any private network without requiring DNS and other setup this can be an answer:
Upvotes: 1