#include #include #include ESP8266WebServer Server; AutoConnect Portal(Server); AutoConnectConfig Config; // Enable autoReconnect supported on v0.9.4 void huePage(){ //HTML with the HUE selector and buttom to access to the autconnect menu String content = "" "" "" "" "" "" "" "" "" "

ESP Color Picker

" "Change Color " "
" "" "

" AUTOCONNECT_LINK(COG_24) "

" "" ""; //Send periodically the sever content Server.send(200, "text/html", content); if(Server.args()>0){ //If the header of the http changes, we will save the red, green and blue value for(int i=0;i<3;i++){ //Save the value of the colours rgb[i]=Server.arg(i).toInt(); } //If the light is on, update the color pixels_on(); } } void server_setup(){ //Set-up web sever and autoconnect wifi utility. Config.autoReconnect = true; Portal.config(Config); Server.on("/", huePage); // Establish a connection with an autoReconnect option. if (Portal.begin()) { Serial.println("WiFi connected: " + WiFi.localIP().toString()); } } void server_run(){ Portal.handleClient(); }