Go Down

Topic: Connecting IoT "things" to a secured wireless network (Read 131 times) previous topic - next topic

shayelk

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.

Thanks a lot!

SamirTafesh

Dear shayelk,

If I understand your requirement, you are asking to configure your device via web,
and you want the device to store the Username and password,

if yes, you can use the EEPROM.h
where you can read and write on the device.
i already implement it on ESP8266-01, for home Automation devices.

hope i answered your requirement

regards
Samir Tafesh

shayelk

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"):
http://embedded-computing.com/articles/connecting-devices-to-the-internet-of-things-with-wi-fi/

It should look like this:
1) 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?)
2) User enters the device id to an app on his/her smartphone, which in turn sends the network info to the listening device
3) Device writes the network info to EEPROM (thanks for that! :) ) and connects to the network.

hope my question is clearer now

SamirTafesh

Dear Shayelk,

I got your point, it can be implemented by:

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

regards
Samir Tafesh

shayelk

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!

SamirTafesh

 :) dear shayelk,

Happy to hear that the solution answers your need,

Having more inquiry, please do not hesitate to contact me back

Regards
Samir tafesh

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy