ello everyone!
For months I started building my own product which is using an ESP8266 (NodeMCU). I'm using the WifiManager library which creates an AP so the mobile phone can find it and connect with it through a portal where the user will select their WiFi and put the credentials. Everything is fine in that department.
Also the device connects against an MQTT Server (Aedes) and against an API for authentication. That's also working fine, no problems so far.
The challenge that I have now is the following:
I want to develop a mobile app (nowadays I just created a node view app for testing), and I would like to imitate the function of others mobiles apps for IoT projects, where you can search for your smart devices connected to the network and associate them with a user account. I don't want to do it by using bluetooth, I know there is another way to do it by using TCP/IP or UDP but I don't know how to do it, or better say, I don't know which are the steps to accomplish it.
I thought about assigning a hostname to the device by using WiFi.hostname("xx") and open a port where it serves an XMLs with its information, so the mobile app can find it and recognize it, but I'm not sure if this is the correct approach to do it neither how to do it correctly. Like: How can I scan the network by knowing only a part of the hostname? i.e: Hostname: "ESP-XX-AA11". I only will know ESP-XX.
So doubts I have are:
- Should I run a port/host scanner on Mobile (for testing, in js for my node webapp)? Do you know any of those?
- Should I create a fingerprint on my esp8266 device or something like that?
- Is there any other known way to discover devices?
Thank you in advance