GithubHelp home page GithubHelp logo

Comments (6)

reivaxy avatar reivaxy commented on August 19, 2024 2

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.
So I no longer need to know the IP of my ESP.

from espwebserver.

reivaxy avatar reivaxy commented on August 19, 2024

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 :)

from espwebserver.

ajinkyaw avatar ajinkyaw commented on August 19, 2024

from espwebserver.

reivaxy avatar reivaxy commented on August 19, 2024

Well, you could do an ip scan :(

Do you know its Mac address ?

from espwebserver.

ajinkyaw avatar ajinkyaw commented on August 19, 2024

@reivaxy : Every time scanning the IP will be the option i can consider, but still looking for more suitable way to make it work.
is the mac address of the esp fix ? does it change ever? so that i will try to find the solution to get the ipaddress from mac address.
Can we find it in a desktop app developed in c# ?

from espwebserver.

gilmaimon avatar gilmaimon commented on August 19, 2024

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).
EDIT: also, for me mDNS works fine on STA mode.. Maybe you are accessing it the wrong way? maybe from a client that does not support it?

from espwebserver.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.