-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finding ESP when connected to any network. #7
Comments
Hi, Here is what you could do: wifiSTAGotIpHandler = WiFi.onStationModeGotIP(onSTAGotIP); void onSTAGotIP (WiFiEventStationModeGotIP ipInfo) { Otherwise if the ESP is both STA and AP, you could have the AP provide a small webpage on its IP (since you said you know it) and serve it to display the STA ip. You could also attach a screen and display the IP address on it :) |
Hi. I will not be having a serial monitor to get the ip. Also i have no
display to put it. Right now from Android device i am using ssdp to find
the service using unique name, But now the situation is the acess will be
from a desktop software developed in c#, so the socket is the fastest and
convenient way to access the functions on esp. Is there any option to find
and access the device with out knowing its ip to the end user.
…On Thu 21 Jun, 2018, 19:51 Reivaxy, ***@***.***> wrote:
Hi,
Would printing the IP to the serial port do ?
Here is what you could do:
wifiSTAGotIpHandler = WiFi.onStationModeGotIP(onSTAGotIP);
void onSTAGotIP (WiFiEventStationModeGotIP ipInfo) {
ipOnHomeSsid = ipInfo.ip.toString();
Serial.printf("Got IP on %s: %s\n", config->getHomeSsid(),
ipOnHomeSsid.c_str());
}
Otherwise if the ESP is both STA and AP, you could have the AP provide a
small webpage on its IP (since you said you know it) and serve it to
display the STA ip.
You could also attach a screen and display the IP address on it :)
<https://github.com/reivaxy/iotinator/raw/master/resources/switch_ready.jpg>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOR6rbNOEm1FtX9VLo7u3KXo5rKEuI3xks5t-6vOgaJpZM4Uxxqs>
.
|
Well, you could do an ip scan :( Do you know its Mac address ? |
@reivaxy : Every time scanning the IP will be the option i can consider, but still looking for more suitable way to make it work. |
You could have a third endpoint (like an AWS server) with a fixed ip. So that when the esp wakes up it will "register" it's local ip on that server (with some unique id you will hardcode, in case that you have multiple devices). |
Absolutely @gilmaimon, I have done a similar thing on https://github.com/reivaxy/iotinator. After the master ESP8266 connects to my home SSID using DHCP, it POSTs its IP address to www.iotinator.com where I have set up a mySql database and some php scripts (from the same repo) to record it. Then, querying HTTP GET my.iotinator.com will return the IP of all the modules connected to the same network as the gateway used by the querying client. If there is only one, the response is a redirect to that IP. |
Hi Guys i have developed a program for esp8266 to connect to any wifi station by providing SSID and password. I am using mDNS to find the device when its in AP Mode. but when in STA mode i cannot find it with the mDNS.
I am using websocket to communicate with the device , but here i need to know the IP address of the esp and then i can communicate with it.
What i want to achieve here is , I want to access the esp without knowing its IP address when it is connected to the network i am in. Also i cannot set a static ip address to the esp in my case.
What are the techniques to do so , please guide.
The text was updated successfully, but these errors were encountered: