small system wifi auto-config? (eg, esp8266, arduino) - Page 1
Forum section: electronics / general

author: linux-works
author_rank: Super Contributor
timestamp: May 17, 2015, 02:45:40 pm
content: I'm wondering how people are solving the config-data issue on minimal embedded systems that use wifi.for example, I'm playing with the infamous esp8266 $8 wifi module and for now, I've just hard coded things like the SSID, password, maybe even target ip addr or URL - just to get things working. but that's not how you want a final product, even if its just a one/few-off DIY.at the very least, I need to allow some simple remote config of wifi access control info. what is the best 'dhcp for wifi' so to speak? dhcp works great for getting an ip addr, default router, dns server, when you boot up on a wired (or even authenticated wireless) network. I know there are some complex solutions about pressing 2 buttons on devices at the same time and having a wifi autoconfig swap of some sorts. that's probably too much for a very small embedded system, though.I've heard of something called 'esp-touch' and TI has something else, as well (forget the name). I'm still researching this whole notion and looking for some advice on how to proceed. if you dealt with, and solved this problem, what did you use?I don't want to require a 'phone' (and I'm not at all interested in having a phone involved in this in any real way). I think the esp-touch or similar ideas use magic udp packets? is that right? if so, then there should be standard linux demo apps/servers - but I'm not finding them.please share your experience with this. I have the luxury of a serial port, and I could always just go into a config mode and read a few csv-delimited ascii fields and store those in local eeprom; but its not very user-friendly.

author: asgard20032
author_rank: Regular Contributor
timestamp: May 17, 2015, 03:42:57 pm
content: Texas got simplelink for their CC31xx and CC32xx. For their CC30xx, they got smartconfig. Neither of those fulfil your need, since they require a smartphone with android or iOS to configure. Aside from vendor specific solution that require a smartphone, the other popular way of doing this is to turn your device in an AP, with a config page in html. Then once the info are filled up, restart the device in normal device. Other solution involve using WPS, but it require a compatible router. Or you could config it by USB trough for example CDC, simple terminal to enter SSID and password.By the way, using AP solution require that you got a computer with wireless card or a smartphone or a tablet to connect to it...You could also use IR to make the configuration.

author: zapta
author_rank: Super Contributor
timestamp: May 17, 2015, 04:32:42 pm
content: Quote from: linux-works on May 17, 2015, 02:45:40 pmThat's an expensive one ;-)I am using a configuration console via the serial port with simple commands such as set_ap <ssid, password>, set_server <ip, post>, set_device <device_id, device_password>, that allows the device to connect to the ap, then to the server and to assume a given identity.It works well but I am also looking for something simple. Currently looking into a smartphone based options to replace the serial based setting.

author: asgard20032
author_rank: Regular Contributor
timestamp: May 17, 2015, 05:32:54 pm
content: You don't need to use a serial terminal to make configuration by serial. You could make a small GUI with python, or language of your choice, so end user don't need to interact with a serial terminal. The GUI send serial command. Simple, low cost, everyone can use it without a smartphone.

author: linux-works
author_rank: Super Contributor
timestamp: May 20, 2015, 07:50:04 pm
content: I was thinking along the lines of a serial input method and also a simple UI to feed it sanitized data for its config. maybe I'll go along in that direction.how about this: a 2-level auto config. suppose you have (or create) an open wifi for a short time period and let the embedded system connect using that well-known ssid. as the ssid would be pre-programmed into the small system, so would an ip-addr and a path. is that asking too much?yes, it is, in some ways, but would enough people be willing to set that little bit up in order to have a more auto-configurable small system environment?if the device has a display of any kind, it could have a pre-programmed serial # or even generate something and then display it. a mac addr is ideal since we assume this is a wifi-config problem and you have to have a mac-addr to be a tcp/ip node, these days. that could be part of the url that you go 'fetch' from.you fetch a file and that has your access control info in it. if you do this over a secure transport (ssl, etc) you are ok, but of course, low end systems won't have crypto ability. but for a short controlled duration, on a captive network (as captive as you can make 'open wifi, lol), it may be ok. it saves you from having to enter data ON the device, it lets you reconfigure things as much as you want and the device simply has to reboot to start the cycle all over.if the device is remote or sealed, its not practical to require a hard wired serial connection. its a wifi device and so you can assume it has some kind of wifi and ip ability. maybe its ok to 2-stage it by booting up on a public wifi (that you provide), get credentials, disconnect the public wifi and then use the private credentials to get on the 'real' wifi network.for $30, you can buy battery powered wifi access points. a rasp pi could also be a private 'open' access point as well as a config file server over http.comments on this approach?

author: TJ232
author_rank: Frequent Contributor
timestamp: May 21, 2015, 11:02:15 am
content: Quote from: linux-works on May 20, 2015, 07:50:04 pmMight be a little bit convoluted for my taste but sounds as workable. Don't know exactly your project conditions.What exactly you don't like on the more classic approach: Press cfg button -> AP mode-> Configure thu web page->Reboot->Back to client mode on the new WIFI network?

author: macboy
author_rank: Super Contributor
timestamp: May 28, 2015, 05:17:51 pm
content: I like the idea of having the device come up in AP mode with simple web server to configure itself. But that seems like a lot of work. A web server isn't rocket science, but it isn't trivial. If you already had a web server for other purposes then this would be much simpler.Microchip has anapp note on WPS. I know you aren't using a PIC but it is still useful info.Your challenge is also examinedhere.