Hey all,
I've got several IoT experiments going on, but it just occured to me today that there is a major elephant in the room that I need to address.
The ESP needs to connect to wifi to transmit data. And if I am to ever give or sell one of these things to someone else, they will need to configure it with their own SSID / password to make it work, without needing to access the code.
For the past few weeks, I was thinking "yeah sure, I'll make a config page online where they can enter their SSID / password". I now realize the enourmous flaw in that logic.
... so anyway, moving on, I'm thinking, I can store the SSID / password on an SD card, which they can remove and edit themselves. That seems to be the simplest solution, but it is a bit clunky.
I thought maybe I can add some kind of circuit to allow people to access the SD card from a USB port. Either from the one on the ESP, or a separate one. Not sure how difficult either option would be.
Or perhaps I can add a dipswitch to make the device boot in AP mode, allowing users to connect to it and configure it wirelessly.
Or perhaps I'm making this way more complicated than it needs to be, and I can just use WPS. I just looked into it now while typing this, and it's literally like 2 lines of code. I guess I can do this, and then also store it on an SD card, for extra redundancy, since not all routers have WPS support.
I guess I just want to know what kind of methods you guys use? Is there anything I'm overlooking perhaps?
Any guidance would be appreciated. Cheers!