OpenSprinkler Forums Comments, Suggestions, Requests Opensprinkler on ESP8266 Reply To: Opensprinkler on ESP8266

#42091

Ray
Keymaster

@ganralf: the OpenGarage project actually has a decent way to allow users to connect to their own WiFi, without having to hardcode ssid / password. This is probably something you can directly integrate into your work. Basically the way it works is: the controller starts in AP mode, presenting a simple webpage allowing you to select a detected network and put in password. Then it switches to AP+STA mode, trying to connect to your WiFi and report back the IP address. After this, the ssid and password are stored in a file in flash, and the controller restarts in STA mode only. Not the most elegant way (compared to smartconfig), but seems to work fine. In any case, the firmware code is at:
https://github.com/OpenGarage/OpenGarage-Firmware/tree/master/OpenGarage
and everything related to AP mode can be found by searching ‘OG_MOD_AP’ in main.cpp.