Hi everybody,
My question was probably answered a thousand times, but it's so basic that I don't really know what to look for. Any link to get me started would be highly appreciated.
I want to create an IoT product which needs internet access, but it has no I/O capabilities that the user can use to configure it (i.e. tell it which WiFi network to connect to, and what the password is). Every piece needs to have a specific id, and there will be an app to control all the products the user has, so I was thinking of attaching a QR to each product, and when the user scans the QR with the app, it automatically configures the device to use the network.
I guess it should be complicated to write from scratch in a secure way, but it's a basic IoT demand, so I figured there must be a library to support it, but I can't find one.
I would really appreciate some info on the best way to do what I'm trying to do.
Hi SamirTafesh, thank you for taking the time to answer
You answered a question I didn't even realize I needed to ask (now that you introduced me to EEPROM it has become obvious that I need to write to the Arduino's non-volatile memory), so thanks for saving me a lot of troubles in the future!
My original question, though, was different:
I need to have a protocol that will let me configure this settings using my phone.
What I'm looking for is the last method in the following link (under "An alternative method"):
It should look like this:
User powers the device on for the first time -> device enters a listening mode and waits for network info from smartphone (how is that done? over WiFi? can the phone "talk" to the WiFi module which is not yet connected to the network?)
User enters the device id to an app on his/her smartphone, which in turn sends the network info to the listening device
Device writes the network info to EEPROM (thanks for that! ) and connects to the network.
1- in your code the Void Setup() will handle the job
a- when the device boots for the first time, the EEPROM parameters are empty, so you set your device as access point with fixed IP example 10.1.1.1, and it acts as a Web server, serving the config page as in the attachement
b- you connect your phone to the AP and you fill the attached form as an example, once you post the form, the parameters should be saved into the EEPROM
c- once done you reboot the device and it will will check the EEPROM, if filled then it will continue the normal JOB
hope this clarifies on how you should start, if you need more assistance, please do not hesitate to contact me back
Sounds like just what I'm looking for.
Now that I know where I'm going, I'll start learning how to implement this phone-arduino interface.
Thanks a lot for pointing me in the right direction!