Electronics > Projects, Designs, and Technical Stuff

How do users connect IOT device to WiFi?

<< < (11/14) > >>

frozenfrogz:
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.

soldar:
You might want to have a look at https://en.wikipedia.org/wiki/Wi-Fi_Direct

Kasper:
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 mode
2 - ESP creates network and webpage for wifi credential entry
3 - On user's device, join ESP32's network
4 - Read IP address from serial monitor
5 - Enter IP address in browser
6 - Enter wifi credentials for home network into ESP32's webpage
7 - ESP32 saves wifi credentials in EEPROM
8 - Reboot ESP32
9 - ESP32 joins home network and creates webpage
10 - On user's device, join home network
11 - Read IP address from serial monitor
12 - Enter IP address in browser to go to ESP32's webpage and control it

Next 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?

antintedo:
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.

Kasper:
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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod