I'm making an IoT device that will serve a web app over WiFi which can be accessed to control it.
I would like to make it easy to set up. For example, the easiest way I can imagine is as follows; all it would need is a phone or similar with NFC capabilities. (Only hypothetically, because this assumes NFC etc can do it!)
- User powers up IoT device
- User holds phone against IoT device's NFC pad
- IoT device asks phone for WiFi credentials
- IoT device uses credentials to connect to WiFi
- IoT device directs phone's browser to its URL
But right away I can see possible flaws:
- Phone is unlikely to want to give credentials away; security risk.
- Phone is unlikely to want to navigate to the given URL; security risk.
- NFC probably doesn't have defined standards for these kinds of operations; even if security issues are mitigated (e.g. by asking user permission), I can't believe I'd be lucky enough for this to be implemented. So an app would have to be downloaded for the phone to do all this. Which means an app would need to be written for Apple, another for Android etc, plus in the case of Apple it would have to be approved, and either way the user would have to search for it, install it and learn how to use it - all defeating the purpose of having a web interface.
Obviously some users will not have NFC-compatible phones, so there would also have to be a secondary method.
The only awareness of a solution I have comes from how my WiFi IP security camera works. It requires first connecting it via Ethernet cable to a router with on a 192.168.1.X subnet with a given IP reserved (e.g. my camera required 192.168.1.100 to be reserved or free). Then from there, the user navigates to http://192.168.1.100/, logs in with the camera's supplied username and password, then from there, configures the camera with the WiFi access point name and password.
But that method had one serious disadvantage: it required that the router operates on the subnet 192.168.1.X. Mine operated on 192.168.0.X. Thankfully I was able to reconfigure it. But my new router doesn't have that ability!! I would have been stuck. Additionally, the above method is quite a pain; quite a few steps.
What other solutions have been implemented to solve the problem of setting up an IoT device's WiFi connection, and then informing the user of its IP address so he/she can access its web interface?