Author Topic: How do users connect IOT device to WiFi?  (Read 6926 times)

0 Members and 1 Guest are viewing this topic.

Offline KasperTopic starter

  • Frequent Contributor
  • **
  • Posts: 793
  • Country: ca
How do users connect IOT device to WiFi?
« on: August 07, 2019, 04:53:29 am »
Hi everyone, I am working on a IOT device. Aiming to put it on kickstarter. Currently using ESP32 which has bluetooth and wifi. I want users to control the ESP32 via wifi with an app in their phone.

When users receive my product, how do they connect it to their wifi network?

How does the user tell it what network to connect to and what the password is?

Option 1: put a bluetooth pairing button on it so users can connect phone via bluetooth. Send wifi credentials via bluetooth so then it can connect to wifi. I'd rather not add a button or use bluetooth since both add costs.

Option 2: micro USB connector to make wired connection between phone and MCU. Making physical connection to peoples phones means there might be a risk of damaging phones and I'd like to avoid that.

Option 3: they tell me their wifi credentials when they order product and I type it into code before loading their device. Just kidding, I don't think that would go well.

How do these options sound? What are the other options?
 

Offline bitseeker

  • Super Contributor
  • ***
  • Posts: 9057
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: How do users connect IOT device to WiFi?
« Reply #1 on: August 07, 2019, 05:47:23 am »
Typically, the IoT device powers on as a WiFi access point. The user connects to its SSID via WiFi using their phone, laptop, etc. and goes to a pre-defined URL to access the configuration web page where they can specify the SSID and password of the access point/router it should use. Save and restart the device.

In case something goes wrong or the device needs to be re-configured, provide a way to reset it so it boots into access point mode again.
TEA is the way. | TEA Time channel
 
The following users thanked this post: Siwastaja, Kasper

Offline Fire Doger

  • Regular Contributor
  • *
  • Posts: 209
  • Country: 00
  • Stefanos
Re: How do users connect IOT device to WiFi?
« Reply #2 on: August 07, 2019, 06:20:08 am »
Option 1: ESP32 Already has BT capabilities, I assume you mean developing cost, that's true.
Option 2: If you are afraid that you may have leakage from high voltage source (mains or whatever) good luck on passing CE and FCC
Option 3:  :palm: ya think? :scared:

Option 4: Creating an Access Point is a very nice solution. You can trigger it without a button by applying-removing power to the device in a predefined pattern (5 sec on - 2 sec off - 5 sec on - 2 sec off) like some smart lamps (Dave edited a 2 hours video I think...).
I know that Android is very tricky if you want to make an app. If you want to use the browser and connect manually to AP its much easier and there are already ESP32 libraries doing it.
 
The following users thanked this post: Kasper

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9333
  • Country: fi
Re: How do users connect IOT device to WiFi?
« Reply #3 on: August 07, 2019, 08:53:48 am »
Typically, the IoT device powers on as a WiFi access point. The user connects to its SSID via WiFi using their phone, laptop, etc. and goes to a pre-defined URL to access the configuration web page where they can specify the SSID and password of the access point/router it should use. Save and restart the device.

In case something goes wrong or the device needs to be re-configured, provide a way to reset it so it boots into access point mode again.

This is a very good way, and intuitive (at least for a technical person). But instructions are everything; the first time I saw this process, I had to guess everything (although I won't complain; it was intuitive).

Provide a large sticker or a piece of paper which clearly instructs:
1) Join WiFi network xyz, using password asdfg
2) Go to www.configpage.xyz

And you are good to go.
« Last Edit: August 07, 2019, 08:56:03 am by Siwastaja »
 
The following users thanked this post: bitseeker, Kasper

Offline bitseeker

  • Super Contributor
  • ***
  • Posts: 9057
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: How do users connect IOT device to WiFi?
« Reply #4 on: August 07, 2019, 08:00:56 pm »
Yes, that is how it's usually done. Just a short Getting Started guide to set it up.
TEA is the way. | TEA Time channel
 
The following users thanked this post: Kasper

Offline KasperTopic starter

  • Frequent Contributor
  • **
  • Posts: 793
  • Country: ca
Re: How do users connect IOT device to WiFi?
« Reply #5 on: August 07, 2019, 10:12:14 pm »
Thanks everyone.  Very helpful.

I'll do it this way:
Typically, the IoT device powers on as a WiFi access point. The user connects to its SSID via WiFi using their phone, laptop, etc. and goes to a pre-defined URL to access the configuration web page where they can specify the SSID and password of the access point/router it should use. Save and restart the device.

In case something goes wrong or the device needs to be re-configured, provide a way to reset it so it boots into access point mode again.
 

Offline KasperTopic starter

  • Frequent Contributor
  • **
  • Posts: 793
  • Country: ca
Re: How do users connect IOT device to WiFi?
« Reply #6 on: August 07, 2019, 10:27:13 pm »
Option 1: ESP32 Already has BT capabilities, I assume you mean developing cost, that's true.
Option 2: If you are afraid that you may have leakage from high voltage source (mains or whatever) good luck on passing CE and FCC
Option 3:  :palm: ya think? :scared:

Option 4: Creating an Access Point is a very nice solution. You can trigger it without a button by applying-removing power to the device in a predefined pattern (5 sec on - 2 sec off - 5 sec on - 2 sec off) like some smart lamps (Dave edited a 2 hours video I think...).
I know that Android is very tricky if you want to make an app. If you want to use the browser and connect manually to AP its much easier and there are already ESP32 libraries doing it.


1 - If I don't need BT then I might use ESP8266 instead of ESP32.  Lowers the per unit cost a bit.  Mostly I want to avoid BT membership headaches and costs and extra certification.

2 - Just 5V.  Trying to keep it simple.

4 - I would like to avoid having a button but I think I might opt for button over 5 sec, 2 sec ... just to make it easier for users.

I am more of a hardware guy, new to apps and browsers so I am very interested in the easiest solution.  Are you saying I can provide website(s) instead of app?  Not just for the initial setup but for after setup, when user wants to communicate while outside the ESP32's wifi range?
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 4033
  • Country: us
Re: How do users connect IOT device to WiFi?
« Reply #7 on: August 07, 2019, 10:46:02 pm »
One way to streamline this is to have a QR code printed on the back of the device.  That can encode the SSID, password, and URL of the setup network.
 This would let you use an encrypted network more easily to prevent your neighbors from jumping on and claiming your device before you get it configured.  This also helps if you are setting up multiple devices so that they don't conflict.

On the other hand, if your device has (or is) a camera you could do the reverse: display a QR code that tells it what network to connect to.

 
The following users thanked this post: Kasper

Offline hamdi.tn

  • Frequent Contributor
  • **
  • Posts: 626
  • Country: tn
Re: How do users connect IOT device to WiFi?
« Reply #8 on: August 07, 2019, 10:50:04 pm »
Hi,

ESP32 and ESP8266 support a feature called ESP Touch, it use only Wifi but it require an application running on a smartphone either Android or Ios, they have samples application if you want to edit it yourself. The idea is that this application will broadcast wifi credentials through the router on which the phone is already connected, while the module will be sniffing for those frames. You can connect multiple units at once using this method.

ESP32 support WPS as well, so a button on the device can be used, sample code can be found in ESP_IDF.

As  bitseeker mentioned, most iot devices will start as an Access point until you enter wifi credentials and i personally prefer this method, however some people (specially senior population) find it a bit lengthy procedure, so it depend on the use case scenario and your targeted clientele.

by the way a phone application in iot this days is almost a must from a marketing point of view, so i think you will end up developing one sooner or later


 
The following users thanked this post: Kasper

Offline djacobow

  • Super Contributor
  • ***
  • Posts: 1170
  • Country: us
  • takin' it apart since the 70's
Re: How do users connect IOT device to WiFi?
« Reply #9 on: August 08, 2019, 12:59:54 am »
Everyone has explained what most IOT devices do, but honestly, the AP approach is a terrible customer experience. It requires changing your associated network on your phone twice. Furthermore, I believe both Android and IOS do not allow apps to do this, so they user has to switch from the app to the os WiFi screen, then back again, then back to the WiFi screen, then usually back to the app. (Maybe this policy was changed?)

Also, it kind of blows that you need an app to configure an IOT device at all.

The current state of the art, in my opinion, is garbage.

There are other methods. Electric Imp used a photodiode to allow an app to flash a pattern on the screen that conveys the credentials to the device. You could do something similar with an audio modem and the phone's speaker and a mic in the device.
Both require apps, but i guess that's our world now.

Another approach is to use something like a PC to write a simple text file to a usb thumb drive, which you then plug into the iot device to be read during setup. At least this could be done without a phone and from non-mainstream OSes.

Regardless, it ain't pretty.
 
The following users thanked this post: Kasper, I wanted a rude username

Offline KasperTopic starter

  • Frequent Contributor
  • **
  • Posts: 793
  • Country: ca
Re: How do users connect IOT device to WiFi?
« Reply #10 on: August 08, 2019, 01:46:15 am »
And the plot thickens... more good ideas.  Thank you.

[...]
Electric Imp used a photodiode to allow an app to flash a pattern on the screen that conveys the credentials to the device. You could do something similar with an audio modem and the phone's speaker and a mic in the device.
[...]

That sounds pretty slick, specially since I'm thinking about adding an illumination sensor anyways. 
 

Offline KasperTopic starter

  • Frequent Contributor
  • **
  • Posts: 793
  • Country: ca
Re: How do users connect IOT device to WiFi?
« Reply #11 on: August 08, 2019, 01:49:54 am »
Hi,

ESP32 and ESP8266 support a feature called ESP Touch, it use only Wifi but it require an application running on a smartphone either Android or Ios, they have samples application if you want to edit it yourself. The idea is that this application will broadcast wifi credentials through the router on which the phone is already connected, while the module will be sniffing for those frames. You can connect multiple units at once using this method.

ESP32 support WPS as well, so a button on the device can be used, sample code can be found in ESP_IDF.

These sound like the easiest solutions for the users but would they be venerable to users' neighbors who are constantly sniffing or other hackers?
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4321
  • Country: us
  • KJ7YLK
Re: How do users connect IOT device to WiFi?
« Reply #12 on: August 08, 2019, 01:51:20 am »
Didn't the ElectricImp gang manage to get a patent on the "flashing-light" method of setup?
IMHO, another example of something that is both obvious and very likely "prior-art" getting a patent.
 

Offline KasperTopic starter

  • Frequent Contributor
  • **
  • Posts: 793
  • Country: ca
Re: How do users connect IOT device to WiFi?
« Reply #13 on: August 08, 2019, 01:53:50 am »
Didn't the ElectricImp gang manage to get a patent on the "flashing-light" method of setup?
IMHO, another example of something that is both obvious and very likely "prior-art" getting a patent.

I guess I'll have to use a blinking-light instead of flashing-light ;)
 

Offline bitseeker

  • Super Contributor
  • ***
  • Posts: 9057
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: How do users connect IOT device to WiFi?
« Reply #14 on: August 08, 2019, 02:53:35 am »
Regardless, it ain't pretty.

Very true. A method that is easy for the general public would be great to see. The flashing communication sounds pretty neat and much easier for Joe Public than editing text files and requiring a thumb drive (especially on a phone).

For me, the only drawback is that it requires an app. I'm so tired of the prevalence of apps and companies insisting that you must install their app to do rudimentary (and often, duplicate) things. A web page could probably do the flashing transmission.

Wouldn't the Timex Datalink watch be prior art for ElectricImp's patent? Maybe they worked around it.
TEA is the way. | TEA Time channel
 

Offline djacobow

  • Super Contributor
  • ***
  • Posts: 1170
  • Country: us
  • takin' it apart since the 70's
Re: How do users connect IOT device to WiFi?
« Reply #15 on: August 08, 2019, 02:57:36 am »
Didn't the ElectricImp gang manage to get a patent on the "flashing-light" method of setup?
IMHO, another example of something that is both obvious and very likely "prior-art" getting a patent.

I guess I'll have to use a blinking-light instead of flashing-light ;)

Yeah, I agree that such a patent would not (should not) hold up, but I guess you need to be prepared to defend yourself, and that could get expensive very fast.
 

Offline bitseeker

  • Super Contributor
  • ***
  • Posts: 9057
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: How do users connect IOT device to WiFi?
« Reply #16 on: August 08, 2019, 03:01:41 am »
Yep. As they say, the real cost of having a patent is defending it.
TEA is the way. | TEA Time channel
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 4033
  • Country: us
Re: How do users connect IOT device to WiFi?
« Reply #17 on: August 08, 2019, 03:04:06 am »
Yeah, access point method is nice because it is universal, but even in the best of situations it is clunky.

Bluetooth and NFC are much more suited to this but NFC isn't universal yet and Bluetooth just sucks.   WPS is a neat idea but too insecure.  USB connection to a desktop has too many driver and OS problems.  USB to a phone isn't much better.  Even if you have a screen and keypad forcing users to manually enter the password isn't great.

In short, everything is terrible, but the access point method is the least terrible option that works almost everywhere.
 

Offline Fire Doger

  • Regular Contributor
  • *
  • Posts: 209
  • Country: 00
  • Stefanos
Re: How do users connect IOT device to WiFi?
« Reply #18 on: August 08, 2019, 06:10:57 am »
Everyone has explained what most IOT devices do, but honestly, the AP approach is a terrible customer experience. It requires changing your associated network on your phone twice. Furthermore, I believe both Android and IOS do not allow apps to do this, so they user has to switch from the app to the os WiFi screen, then back again, then back to the WiFi screen, then usually back to the app. (Maybe this policy was changed?)

Also, it kind of blows that you need an app to configure an IOT device at all.

The current state of the art, in my opinion, is garbage.

There are other methods. Electric Imp used a photodiode to allow an app to flash a pattern on the screen that conveys the credentials to the device. You could do something similar with an audio modem and the phone's speaker and a mic in the device.
Both require apps, but i guess that's our world now.

Another approach is to use something like a PC to write a simple text file to a usb thumb drive, which you then plug into the iot device to be read during setup. At least this could be done without a phone and from non-mainstream OSes.

Regardless, it ain't pretty.
Android supports it, its just hard. In relative new Android versions it required location access because in theory from AP app can get a relative position of you.

Add a button and send credentials in Morse code... No app, everyone is happy... :palm:

Use a pattern as SSID SmartThingie_xxxxxx
For xxxxx use ESP's serial or something similar
Password:
option 1 Use the same for all devices
option 2 Use a secret key to generate a password based on SSID.
If you make an app scan for WiFi with this pattern and connect to it. On finish reconnect to last connected network.

When you connect to ESP's network esp is the router, it can do a lot of things. Search it on YouTube

Also I think Bluetooth doesn't require anything extra if you don't use it in marketing, just classic FCC and similar for other countries.
 

Online Jeroen3

  • Super Contributor
  • ***
  • Posts: 4209
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: How do users connect IOT device to WiFi?
« Reply #19 on: August 08, 2019, 06:42:33 am »
I have seen other methods:

1. By sound. Communication by encoding the data in sound near the device, old school modem days. Drawback: it needs a mic and audio processing. Can be as simple as a single AM modulated carrier.
2. By packet length. It's called SmartConfig and available in the CC3000 from TI. It listens to data encoded in WiFi packet length. You can't read the encrypted packets, but you can read the length of them. So the phone just spits out a sort of morse code with some UDP frames.
You do need smartphone or laptop for both of these.

3. SD card/USB tool.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9333
  • Country: fi
Re: How do users connect IOT device to WiFi?
« Reply #20 on: August 08, 2019, 06:58:37 am »
Everyone has explained what most IOT devices do, but honestly, the AP approach is a terrible customer experience. It requires changing your associated network on your phone twice. Furthermore, I believe both Android and IOS do not allow apps to do this, so they user has to switch from the app to the os WiFi screen, then back again, then back to the WiFi screen, then usually back to the app. (Maybe this policy was changed?)

Also, it kind of blows that you need an app to configure an IOT device at all.

Doesn't need an app. If it does, you are right, it sucks. OTOH, if the normal usage needs app anyway, then requiring the same app for configuration isn't an extra nuisance.

Configuration is normally done once or maybe twice per product lifetime.

Changing to different WiFi networks, OTOH, is done on a daily basis by many - think about visiting cafes, other public spaces, friends, etc.
I do it maybe 3-4 times a day on average.

If changing the WiFi network twice as a single-time event is a nuisance, the mobile device is broken beyond use, and using it is a major PITA anyway. It's not a problem of the IoT configuration procedure, but a problem of the broken phone UI. The user has already accepted this nuisance if using such broken device.

Of course, having everything configure and "just work" automatically would be very nice. Such attempts often end up being total failures, or cause total vendor-lock-in. The described procedure (without an app) takes approx. 60 seconds of manual user intervention (including changing the WiFi network twice), but it works, will always work, and work with any device in existence.
 

Online Jeroen3

  • Super Contributor
  • ***
  • Posts: 4209
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: How do users connect IOT device to WiFi?
« Reply #21 on: August 08, 2019, 09:35:48 am »
To be fair, they did come up with a standardized way to make this easier to do.
They call is Wi-Fi Protected Setup, WPS for short. Where you set the device in pairing mode, and then press the button on your router.
 

Offline Daixiwen

  • Frequent Contributor
  • **
  • Posts: 367
  • Country: no
Re: How do users connect IOT device to WiFi?
« Reply #22 on: August 08, 2019, 09:54:22 am »
How about hardcoding the password to something like "1234" and ask your user to change his wifi password to that?
Of course there is an obvious flaw to that approach: if several manufacturers start doing this they will have to agree on the actual password to hardcode.

More seriously, at least in the Android world as Fire Dodger says when given the correct permissions an app can configure the phone's wifi settings to do the whole process automatically. I have seen it personally in use with Google's Home application to set up a Chromecast, and I think (but I'm not 100% sure) an app from HP to set up a wifi printer.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: How do users connect IOT device to WiFi?
« Reply #23 on: August 08, 2019, 02:51:07 pm »
Four years ago I bought a Lidl Silvercrest WIFI plug switch. Like this:
https://www.lidl-service.com/static/118127777/103043_FI.pdf

The APP makes me open an account with whoever is at the other end. Give email and an account password.

Then, to connect from the phone app to the device it already selects the wifi network. I assume it can get that info from the phone itself?

The phone app asks me for the wifi network password, so I assume it cannot get that info from the phone, and somehow transmits it to the switch which is, obviously, not yet connected to the network.

I have no idea how the phone transmits the wifi name and password to the switch device.

I have never used it because, although it does work over the LAN, I cannot get it to work over the internet, maybe because of the strange network configuration I have. Never used it. Still in its original package.


This does not seem to be the AP system
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline KasperTopic starter

  • Frequent Contributor
  • **
  • Posts: 793
  • Country: ca
Re: How do users connect IOT device to WiFi?
« Reply #24 on: August 08, 2019, 10:11:05 pm »
[...]
I'm so tired of the prevalence of apps and companies insisting that you must install their app to do rudimentary (and often, duplicate) things.
[...]

Me too.  One more reason to try to make it website based.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf