How do users connect IOT device to WiFi? - Page 1
Forum section: electronics / projects

author: Kasper
author_rank: Frequent Contributor
timestamp: August 07, 2019, 04:53:29 am
content: 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?

author: bitseeker
author_rank: Super Contributor
timestamp: August 07, 2019, 05:47:23 am
content: 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.

author: Fire Doger
author_rank: Regular Contributor
timestamp: August 07, 2019, 06:20:08 am
content: 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 FCCOption 3:ya think?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.

author: Siwastaja
author_rank: Super Contributor
timestamp: August 07, 2019, 08:53:48 am
content: Quote from: bitseeker on August 07, 2019, 05:47:23 amThis 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 toguesseverything (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 asdfg2) Go towww.configpage.xyzAnd you are good to go.

author: bitseeker
author_rank: Super Contributor
timestamp: August 07, 2019, 08:00:56 pm
content: Yes, that is how it's usually done. Just a short Getting Started guide to set it up.

author: Kasper
author_rank: Frequent Contributor
timestamp: August 07, 2019, 10:12:14 pm
content: Thanks everyone. Very helpful.I'll do it this way:Quote from: bitseeker on August 07, 2019, 05:47:23 am

author: Kasper
author_rank: Frequent Contributor
timestamp: August 07, 2019, 10:27:13 pm
content: Quote from: Fire Doger on August 07, 2019, 06:20:08 am1 - 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?

author: ejeffrey
author_rank: Super Contributor
timestamp: August 07, 2019, 10:46:02 pm
content: 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.

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: August 07, 2019, 10:50:04 pm
content: 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

author: djacobow
author_rank: Super Contributor
timestamp: August 08, 2019, 12:59:54 am
content: 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.

author: Kasper
author_rank: Frequent Contributor
timestamp: August 08, 2019, 01:46:15 am
content: And the plot thickens... more good ideas. Thank you.Quote from: djacobow on August 08, 2019, 12:59:54 amThat sounds pretty slick, specially since I'm thinking about adding an illumination sensor anyways.

author: Kasper
author_rank: Frequent Contributor
timestamp: August 08, 2019, 01:49:54 am
content: Quote from: hamdi.tn on August 07, 2019, 10:50:04 pmThese sound like the easiest solutions for the users but would they be venerable to users' neighbors who are constantly sniffing or other hackers?

author: Richard Crowley
author_rank: Super Contributor
timestamp: August 08, 2019, 01:51:20 am
content: 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.

author: Kasper
author_rank: Frequent Contributor
timestamp: August 08, 2019, 01:53:50 am
content: Quote from: Richard Crowley on August 08, 2019, 01:51:20 amI guess I'll have to use a blinking-light instead of flashing-light

author: bitseeker
author_rank: Super Contributor
timestamp: August 08, 2019, 02:53:35 am
content: Quote from: djacobow on August 08, 2019, 12:59:54 amVery true. A method that is easy for the general public would be great to see. The flashing communication sounds pretty neat and much easier forJoe Publicthan 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 theTimex Datalinkwatch be prior art for ElectricImp's patent? Maybe they worked around it.

author: djacobow
author_rank: Super Contributor
timestamp: August 08, 2019, 02:57:36 am
content: Quote from: Kasper on August 08, 2019, 01:53:50 amYeah, 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.

author: bitseeker
author_rank: Super Contributor
timestamp: August 08, 2019, 03:01:41 am
content: Yep. As they say, the real cost of having a patent is defending it.

author: ejeffrey
author_rank: Super Contributor
timestamp: August 08, 2019, 03:04:06 am
content: 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.

author: Fire Doger
author_rank: Regular Contributor
timestamp: August 08, 2019, 06:10:57 am
content: Quote from: djacobow on August 08, 2019, 12:59:54 amAndroid 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...Use a pattern as SSID SmartThingie_xxxxxxFor xxxxx use ESP's serial or something similarPassword:option 1 Use the same for all devicesoption 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 YouTubeAlso I think Bluetooth doesn't require anything extra if you don't use it in marketing, just classic FCC and similar for other countries.

author: Jeroen3
author_rank: Super Contributor
timestamp: August 08, 2019, 06:42:33 am
content: 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: August 08, 2019, 06:58:37 am
content: Quote from: djacobow on August 08, 2019, 12:59:54 amDoesn'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 twiceas a single-time eventis 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.

author: Jeroen3
author_rank: Super Contributor
timestamp: August 08, 2019, 09:35:48 am
content: 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.

author: Daixiwen
author_rank: Frequent Contributor
timestamp: August 08, 2019, 09:54:22 am
content: 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.

author: soldar
author_rank: Super Contributor
timestamp: August 08, 2019, 02:51:07 pm
content: Four years ago I bought a Lidl Silvercrest WIFI plug switch. Like this:https://www.lidl-service.com/static/118127777/103043_FI.pdfThe 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

author: Kasper
author_rank: Frequent Contributor
timestamp: August 08, 2019, 10:11:05 pm
content: Quote from: bitseeker on August 08, 2019, 02:53:35 amMe too. One more reason to try to make it website based.

author: Kasper
author_rank: Frequent Contributor
timestamp: August 08, 2019, 10:24:13 pm
content: Quote from: Fire Doger on August 08, 2019, 06:10:57 amLast I checked, you can use bluetooth without bluetooth membership but you can not say bluetooth anywhere.It's hard not to use the word 'bluetooth' in a user guide that tells users to make bluetooth connection. "click the symbol that looks like a B" is probably a little iffy. I don't want users wondering why I have funny wording nor do I want bluetooth coming after me. As Dave would say, that would cumagutsa

author: Kasper
author_rank: Frequent Contributor
timestamp: August 08, 2019, 10:42:18 pm
content: Thanks everyone for all the replies. Lots of good ideas here.Audio: This could probably be done without the user even knowing about it which would be great but I think people are growing weary of everything having microphones so I don't want to go there.I am still leaning towards website based with AP, no app. It sounds like that is the standard and robust method. Many good ideas here though, some sound better but not better enough to justify going away from the standard, specially since this is not my area of expertise. This being my first product (on my own) I'd like to focus on making it solid more-so than fancy.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 09, 2019, 02:30:33 am
content: Quote from: Kasper on August 08, 2019, 10:24:13 pmHave the setup app be open source ("generic" and can be used for any device with a compatible implementation) and have the manual direct users to download that open source app to set it up. Any mention of Bluetooth would be in the app and only where absolutely necessary e.g. prompting the user to turn it on if not already.

author: Fire Doger
author_rank: Regular Contributor
timestamp: August 09, 2019, 05:37:40 am
content: How you will make the server infrastructure to work over the internet?

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: August 09, 2019, 12:05:30 pm
content: Quote from: Kasper on August 08, 2019, 01:49:54 amI think the frame is encrypted

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 09, 2019, 01:15:13 pm
content: Quote from: Fire Doger on August 09, 2019, 05:37:40 amThere are plenty of free dynamic DNS services. There's also Tor, but I think that's a bit too complex for an ESP8266.

author: soldar
author_rank: Super Contributor
timestamp: August 10, 2019, 11:22:10 am
content: Quote from: hamdi.tn on August 09, 2019, 12:05:30 pmI don't understand this. An APP is connected to the WLAN AP through the phone's OS. It wants to send a packet and it hands it to the OS and in the header is the address of the recipient. The OS encrypts the packet and sends it over the WIFI. Being encrypted makes it opaque to any and all listeners. So how is a device listening in going to get anything out of it?I don't understand how it can work.

author: Jeroen3
author_rank: Super Contributor
timestamp: August 10, 2019, 11:39:28 am
content: The length and destination of the packet are not encrypted.

author: Fire Doger
author_rank: Regular Contributor
timestamp: August 10, 2019, 12:42:48 pm
content: Quote from: NiHaoMike on August 09, 2019, 01:15:13 pmPosts above indicates that some users have hard time changing wifi network on their phones.Will they make an account to Free DNS provider, pass back and forth info and credentials to connect ESP to DNS and open any firewall setting on their router to give access from outside into the ESP?Also how secure is having a public server in your local network based on ESP?

author: soldar
author_rank: Super Contributor
timestamp: August 10, 2019, 01:05:23 pm
content: Quote from: Jeroen3 on August 10, 2019, 11:39:28 amThat does not answer my question. How is it done?Suppose the device is sniffing the airwaves and it "sees" several WLANs. Now what? Let us suppose it decides to listen to the strongest one and it "sees" packets, long and short, coming and going, among a bunch of different devices. Now what?The question is: How can it be done?

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: August 11, 2019, 08:33:37 am
content: Quote from: soldar on August 10, 2019, 01:05:23 pmthe device doesn't decide to listen to a particular AP based on the signal strength, it scan all available channel in sniffing mode. While i can't explain how it work in details, i can say it's based on the "CC3000 SmartConfig" by Texas Instrument, you may find more details by googling that instead of ESP-Touchhttp://depletionregion.blogspot.com/2013/10/cc3000-smart-config-transmitting-ssid.htmlHamdi

author: soldar
author_rank: Super Contributor
timestamp: August 11, 2019, 11:49:22 am
content: Quote from: hamdi.tn on August 11, 2019, 08:33:37 amI had a look. Well, the information is being transmitted in the packet size. This is a serious vulnerability because any listener can gather the same information and get into the network.I suppose additional security could be gained by encrypting the information but this is still not enough.I suppose my remotely-controlled switch might use this system.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 11, 2019, 02:00:21 pm
content: Quote from: soldar on August 11, 2019, 11:49:22 amPoint the smartphone camera at a LED on the device and now you have a way to securely negotiate an encryption key.

author: djacobow
author_rank: Super Contributor
timestamp: August 11, 2019, 04:41:03 pm
content: Quote from: NiHaoMike on August 11, 2019, 02:00:21 pmThis was discussed at the beginning of the thread. If you are going to do this, you don't need the AP mode at all.It does bring up another problem I have with the AP approach. It is perhaps a simple thing to fill in an ssid and passphrase over a web form, but the complexity goes up if you want to relay a firmware update or a certificate. You can do it, of course, but now you're asking users to find those files, upload them etc. Look how good people are at updating the fw on their home routers, almost all of which work this way.This issue is important to me because I want to build IOT devices that might be compatible with "the cloud" but are not at all dependent on it to be useful. For example, devices that interact with a small server inside the home. (The server then might relay messages outside the home if the user so wishes.)Let's say you want these devices to make https transactions with that little home server. Well, they'll need a cert so they can trust the server. You can either preshare such a cert with all the devices and put the same private key on all the servers when you program then at the factory (ugh), or you can require that users get a domain name and real cert for their server (ugh), or you can self sign something on the server when you configure it and then relay the cert to the devices when you provision them.Personally, I think the last case is most appropriate, but if you want to do it using the AP approach, you're looking at a bunch of manual steps that won't make much sense to Joe User. (An app will help here, though)Which is to say that Intranet-confined, secure, easily configured IOT is very difficult under prevailing models that don't have some out-of-band way (optical, audio, usb, headphone jack, keypad+screen) for trusted device x to talk to new device y.

author: soldar
author_rank: Super Contributor
timestamp: August 11, 2019, 06:44:02 pm
content: It seems inevitable that ease of use and security are inversely proportional. If you want ease of use then security will be bad and if you want security then it will be a PITA.

author: Fire Doger
author_rank: Regular Contributor
timestamp: August 11, 2019, 07:45:04 pm
content: Quote from: soldar on August 11, 2019, 06:44:02 pmNo it isn't. It just costs more because :It's hard to make something usable by average Joe, that's why there are UX designers and they make their living from it.It's hard to make something secure because networks are very complex and require a lot of knowledge.You have every tool that you need.You have company servers which can distribute fw updates, certificates or whatever.You have a powerfull device with internet, bluetooth, wifi and USB.You have a device wich can connect and host wifi, bluetooth, USB.If your implementation sucks in security or usability its your fault.The problem is that it's not as easy as an arduino board, write code 2 days and sell it. Some things requires development time and knowledge.And it's a lot easier when you don't reinvent the wheel on things that you are not an expert of because possible issues are already solved by others.Also you have to understand what your audience finds "hard". You may find easy to connect with it with a terminal, don't assume that this is usable by others!As already said you can read about UX design to find what is the most user friendly method now. (Accelerometer and vibration motor are not high in list...)*PS routers don't spam you about updates because they want to be performed by people who have basic knowledge about it and can comunicate in case of something goes wrong.They are not stupid, they just don't wont to spend money to make it idiotproof.

author: soldar
author_rank: Super Contributor
timestamp: August 11, 2019, 11:01:38 pm
content: Quote from: Fire Doger on August 11, 2019, 07:45:04 pmDon't argue withme. I have no dog in this fight. But the OP and many other manufacturers of IOT devices are trying to solve the same problem presented in the OP and it seems very difficult to come up with solutions that are user friendly and secure. If you have better ideas then the OP is looking for your input. I am just an interested bystander.

author: Kasper
author_rank: Frequent Contributor
timestamp: August 11, 2019, 11:29:38 pm
content: Quote from: Fire Doger on August 11, 2019, 07:45:04 pmHard = expensive. A lot of products have more features than most people want to pay for.Is this a feature people want to pay extra for?Will putting "secure and easy to use" in the marketting attract customers?

author: djacobow
author_rank: Super Contributor
timestamp: August 12, 2019, 12:26:27 am
content: At some point, the whole "will costumers pay for this feature" argument starts to weaken. People who sell stuff know more about the thing they are selling then do customers. There is some responsibility to make a safe, quality product. One day, when some preshared key baked into the firmware of every thermostat or door lock in the developed world is compromised, causing chaos, folks will maybe care about it.Nobody wanted to pay for seat belts, or collapsing steering wheel stalks, but we have them. It would be nice if industry started to take some responsibility for its products before someone from the government decides to do it for them in a way nobody likes.

author: Kasper
author_rank: Frequent Contributor
timestamp: August 12, 2019, 01:56:34 am
content: Quote from: djacobow on August 12, 2019, 12:26:27 amJudging by how many helmuts I see on ski hills now days, people would pay for seat belts even if they weren't mandated.I'm all for being responsible. I am looking for a solution that is solid and secure and balances eas of use vs costs."will customers pay for this feature" is one of the most common debates in the last 4 places I worked. I often push to release a solid basic version first with only a little consideration for extra features. There will be plenty of time for extra features later if we make sales before we run out of money. I've seen how wasteful scope creep can be and this is my chance to do better.

author: Jeroen3
author_rank: Super Contributor
timestamp: August 12, 2019, 06:05:27 am
content: Quote from: soldar on August 11, 2019, 06:44:02 pmThere is no motivation to make it secure, average users won't pay for that. Because they haveno clue. They'll happily forward port 80 in their home router to their IP cam running embedded linux from 10 years ago.Unless you want in on the Homekit MFi, then you have a few requirements.

author: soldar
author_rank: Super Contributor
timestamp: August 12, 2019, 09:41:09 am
content: Quote from: Kasper on August 11, 2019, 11:29:38 pmBefore that you need to ask if "secure and easy to use" is even possible because so far in this thread we have not seen it.We have seen secure but PITA and we have seen easier but insecure. So far we have not seen both. Before you discuss whether the cost is justified you need to know whether it is possible. So far we have not seen it is possible.WPS was supposed to make WPA login easy and secure. It turned out security was non-existent to the point I do not understand how it was even ever released.

author: Siwastaja
author_rank: Super Contributor
timestamp: August 12, 2019, 09:51:18 am
content: WPS is of course one of those utter failures which try to make a 3-step, 1-minute manual process "easier" and results in a multi-page flow diagram instead. For WPS, four totally different "operating modes" are specified and they all suck.Sometimes it is just easier to accept some manual work in exchange for predictability and simplicity. The "temporarily join the AP -> enter config page -> enter your network credentials" is the only way which seems to actually work without major pain, or pages long specifications. It took the device manufacturers years to realize such a simplistic and hacky scheme is the way to go: now the sticker is in thedeviceyou just bought, and you are not relying on finding a sticker, or a push-button on your 5-year-old home hotspot which may be installed in a hard-to-reach place.

author: soldar
author_rank: Super Contributor
timestamp: August 12, 2019, 02:34:51 pm
content: Not too long ago I was having lunch at a cousin's place and I asked for the WIFI password. She was reading it off the bottom side of the router and it was 20 characters in tiny print which she was having trouble reading. I was trying to type it into a tiny screen of an iphone and with my fat fingers half the time I was getting the wrong character. Each try took quite a while and after three or four unsuccesful tries we just gave up.I guess that is what WPS was trying to address except it was a shoddy attempt which just created a big hole.But, getting back to how to connect IOT devices which have no keyboard or other input device, you can say that starting up in AP mode is "easy" and it is, for certain values of "easy". The system that I mentioned my device does where the APP transmits the credentials encoded in packet length is, much easier and much more insecure.People will generally choose convenience over security and will later bitch and complain when security is compromised.

author: Kasper
author_rank: Frequent Contributor
timestamp: August 12, 2019, 03:27:00 pm
content: Quote from: soldar on August 12, 2019, 02:34:51 pmI take a picture of it then read from the picture.I am aiming for as few tech support calls and negative comments online as possible.

author: frozenfrogz
author_rank: Frequent Contributor
timestamp: August 12, 2019, 03:44:52 pm
content: Search the web for ESP8266 WiFi manager. There are a couple of options. I like running the device in AP mode without password on first boot (and accessible via button, optional), connect to the web server running on it, input the WiFi credentials it should connect to and then let it reboot into client mode.There are various options, but that is my preferred way.

author: soldar
author_rank: Super Contributor
timestamp: August 12, 2019, 05:47:03 pm
content: You might want to have a look athttps://en.wikipedia.org/wiki/Wi-Fi_Direct

author: Kasper
author_rank: Frequent Contributor
timestamp: September 28, 2019, 11:26:41 pm
content: Now that summer is over, I am being a bit more productive lately. Got the access point and webpage solution working fairly well except I need to read IP addresses from serial monitor and only works on local network. This is how it works:1 - Hold button on power on to enter AP mode2 - ESP creates network and webpage for wifi credential entry3 - On user's device, join ESP32's network4 - Read IP address from serial monitor5 - Enter IP address in browser6 - Enter wifi credentials for home network into ESP32's webpage7 - ESP32 saves wifi credentials in EEPROM8 - Reboot ESP329 - ESP32 joins home network and creates webpage10 - On user's device, join home network11 - Read IP address from serial monitor12 - Enter IP address in browser to go to ESP32's webpage and control itNext problems are with steps 4 and 11.Problem a: consumers can't read IP address from serial monitor.Problem b: I don't know how to access ESP32's webpages from outside my home network.Solution:Learn about DNS?I think DNS is what I need but the tutorials I am seeing are not something I can expect consumers to do, they download software onto a local PC that is always on and get into home networks router settings. There must be a better way. Do I just need to learn more about DNS or is there some other way to do this?How do users know how to find the ESP32's webpages?How do I make those webpages accessible from anywhere?How do I make them unique so all the units I sell won't all have the same address?

author: antintedo
author_rank: Contributor
timestamp: September 29, 2019, 01:26:06 am
content: For initial configuration: implement a captive portal. Good OS support and easy to use, users don't have to type in the IP.For device discovery in LAN: mDNS and/or SSDP. ESP SDK seems to support mDNS and there are libraries for the other. Obviously both will be able to differentiate between multiple devices of the same model.For access outside LAN: reverse proxy server on the internet that each ESP connects to. MQTT is used in many IoT devices but it does not fit the use case with the webpage.

author: Kasper
author_rank: Frequent Contributor
timestamp: September 30, 2019, 12:41:04 am
content: Thank you for the suggestion. mDNS looks like it should work for LAN side of things.For access outside the LAN, are you saying I need to run a server that all my users use? There's got to be an easier solution. I think users should be able to type their home network address and the name of my product into their browser and get access to it. Is that not possible?Please feel free to dumb it down for me. I am not familiar with internet, took one networking class in college 15 years ago and haven't touched it since.

author: sokoloff
author_rank: Super Contributor
timestamp: September 30, 2019, 01:00:54 am
content: Think of it this way; your users have overwhelmingly configured their home network such that devices on their network can reach the internet. Far fewer of them (almost none) have configured their network to allow inbound access to your device.Take advantage and make use of this natural condition. Run a server (or API gateway) in the Internet. You can do that super cheaply and easily nowadays with any number of cloud providers. I happen to have chosen AWS, but loads of options are other there.

author: Kasper
author_rank: Frequent Contributor
timestamp: September 30, 2019, 01:23:36 am
content: Even if it is easy and cheap to run a server, does that not mean I have to keep it running through the lifespan of my product?

author: sokoloff
author_rank: Super Contributor
timestamp: September 30, 2019, 01:26:18 am
content: For users to use whatever functions require internet connectivity, yes.

author: Kasper
author_rank: Frequent Contributor
timestamp: September 30, 2019, 01:38:16 am
content: That'd be a 10 - 20 year commitment. Are there really no other options?

author: jhpadjustable
author_rank: Frequent Contributor
timestamp: September 30, 2019, 02:23:51 am
content: mDNS resolves names on the LAN. UPnP (where permitted) enables the firewall to translate requests from the WAN address to the LAN address space. The problem is that the WAN address is not guaranteed not to change from day to day. Users may not know their home IP address from day to day, or properly, the address of the WAN interface on their router from the perspective of the global Internet, and may not be inclined to set up their network for a dynamic DNS service of their choice (no-ip, Dyn, etc.). Perhaps your UI can offer them a way to automate that setup, but then you're depending on you and/or the companies who offer it collectively maintaining a 10-20 year commitment to those services.One other option is to just be like Revolv, get bought by Google, and let them take the heat for bricking your product

author: sokoloff
author_rank: Super Contributor
timestamp: September 30, 2019, 02:31:08 am
content: It’s probably cheaper to plan to run the server for 20 years than to engineer and customer support a way around that.

author: Kasper
author_rank: Frequent Contributor
timestamp: September 30, 2019, 05:48:30 am
content: ugh, I can hear the shelf calling my project back to its resting place.If I make an app instead of using a webpage for control, that would not solve this problen would it?

author: cyberfish
author_rank: Regular Contributor
timestamp: September 30, 2019, 02:10:15 pm
content: There's really no need to have a manual way to enter configuration mode. Just try to connect with stored SSID/password, and enter configuration mode (AP mode) if connection is unsuccessful (or non-existent on first boot).Most common reason why users need to change SSID/password is if they upgrade their router, or move somewhere else. In both those cases, the connection will fail, and the user can put in a new one.If a power user wants to switch the device from one router to another, she can just turn the old router off for a moment and restart the device.This only doesn't work if the neighbour decides to set up a network with your old SSID/password that you can't power off, but this is rare enough that it's probably not worth worrying about.This is what the Chromecast does.

author: sokoloff
author_rank: Super Contributor
timestamp: September 30, 2019, 02:13:12 pm
content: Chromecastalsohas a factory reset mode. (Hold button for 25 seconds to forget all user data.)

author: Kasper
author_rank: Frequent Contributor
timestamp: October 05, 2019, 05:34:53 pm
content: Quote from: sokoloff on September 30, 2019, 01:00:54 amThis seems strange to me but thanks for your explanation I guess it makes sense.I have no idea what to look for in a cloud provider. I dont think I need anything fancy. My products will probably need less than 10 bytes of data a day from each user. I'd like to get one at a price that works for very low sales volume but can scale if sales go well.What should I look for? Where is a good place to learn about servers or API gateways?

author: Kasper
author_rank: Frequent Contributor
timestamp: October 05, 2019, 05:35:43 pm
content: Quote from: cyberfish on September 30, 2019, 02:10:15 pmThat sounds like a nice addition. Thank you.

author: Kasper
author_rank: Frequent Contributor
timestamp: October 20, 2019, 06:29:23 pm
content: Quote from: antintedo on September 29, 2019, 01:26:06 ammDNS was very easy to add to my arduino code. Worked right away on my windows PC and iPad but does not work on android.Bonjour app: saw this recommended on various forums for mDNS on android but didn't work. Wouldn't discover anything, just gave spinning dots.Fing app: this works for android. Lists IPs for everything on my network. Android users must take IP from there and type it into browser.And with that, I have an MVP (minimum viable product). Not very smooth on android but it is easier than setup for my sonos speaker.Thanks again for the help. I think I will stick with this and make my initial goal be a product that works only on LAN and have stretch goal of remote access. That way I can have a low initial goal and hopefully get some of these out there before I need to commit to a server which I really don't want to do if I only sell 10 of these.

author: TomS_
author_rank: Frequent Contributor
timestamp: October 22, 2019, 01:00:19 pm
content: Quote from: bitseeker on August 08, 2019, 02:53:35 amApps can do things that web pages cant.For example, as long as the device is connected to the same network as your phone, you can simply open up the app, let it discover the things on your network, and you can then do stuff with them. That is convenient for most people who dont even know what an IP address is.What are you going to do, tell your users to save a list of bookmarks to IP addresses for their things, that might change each time their router reboots because most of them also dont know what static DHCP leases are; orHave an app that can talk to the device "by magic" (as far as the user is concerned)?Personally I am all for the latter.You have to consider who the target market is and what their skills and knowledge are. If your audience is purely technical, sure, forego the app and let them configure it via serial console or USB thumdrive or whatever. If your audience is consumer, you have to get a bit smarter or your product will probably be considered clunky in this day.

author: sokoloff
author_rank: Super Contributor
timestamp: October 22, 2019, 02:22:12 pm
content: The other thing to consider is that almost any customer contact or question is going to kill your profit on that sale. Maybe something you choose to ignore in a learning or Kickstarter phase of the product, but at scale, you’ve got to drive customer contacts to near zero for most IoT type of products.

author: Kasper
author_rank: Frequent Contributor
timestamp: October 23, 2019, 05:07:52 am
content: Ive been the one taking the phone calls and handelling returns, I am familiar with what a nightmare it can become and I want none of that. Hoping simple operation and a good user guide will minimize it.