diff --git a/works/Danja Vasiliev/otastaImg/data/.DS_Store b/works/Danja Vasiliev/otastaImg/data/.DS_Store index 4df1045..5008ddf 100644 Binary files a/works/Danja Vasiliev/otastaImg/data/.DS_Store and b/works/Danja Vasiliev/otastaImg/data/.DS_Store differ diff --git a/works/Danja Vasiliev/otastaImg/data/index.html b/works/Danja Vasiliev/otastaImg/data/index.html index 3c0dcbb..e5c9729 100644 --- a/works/Danja Vasiliev/otastaImg/data/index.html +++ b/works/Danja Vasiliev/otastaImg/data/index.html @@ -189,7 +189,7 @@

Your browser could not connect to phone's sensors.

-

Please use Android + Firefox browser!

+

Please use Android + Firefox browser! Or try rubbing with two fingers!

diff --git a/works/Dennis de Bel & Anton Jehle/.DS_Store b/works/Dennis de Bel & Anton Jehle/.DS_Store index 7c5c85f..5008ddf 100644 Binary files a/works/Dennis de Bel & Anton Jehle/.DS_Store and b/works/Dennis de Bel & Anton Jehle/.DS_Store differ diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/DNSServer.h b/works/Dennis de Bel & Anton Jehle/esp-files/DNSServer.h old mode 100755 new mode 100644 index 2bade4b..d58efbb --- a/works/Dennis de Bel & Anton Jehle/esp-files/DNSServer.h +++ b/works/Dennis de Bel & Anton Jehle/esp-files/DNSServer.h @@ -69,4 +69,3 @@ class DNSServer void replyWithCustomCode(); }; #endif - diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/data/.DS_Store b/works/Dennis de Bel & Anton Jehle/esp-files/data/.DS_Store index 4df1045..5008ddf 100644 Binary files a/works/Dennis de Bel & Anton Jehle/esp-files/data/.DS_Store and b/works/Dennis de Bel & Anton Jehle/esp-files/data/.DS_Store differ diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/data/connect.html b/works/Dennis de Bel & Anton Jehle/esp-files/data/connect.html new file mode 100644 index 0000000..d996335 --- /dev/null +++ b/works/Dennis de Bel & Anton Jehle/esp-files/data/connect.html @@ -0,0 +1,24 @@ + + + + + + + + + +CONNECT (Close Captive Portal) + + + + + + + \ No newline at end of file diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/data/download.html b/works/Dennis de Bel & Anton Jehle/esp-files/data/dl-android.html similarity index 85% rename from works/Dennis de Bel & Anton Jehle/esp-files/data/download.html rename to works/Dennis de Bel & Anton Jehle/esp-files/data/dl-android.html index f4397f8..4015971 100644 --- a/works/Dennis de Bel & Anton Jehle/esp-files/data/download.html +++ b/works/Dennis de Bel & Anton Jehle/esp-files/data/dl-android.html @@ -1,9 +1,8 @@ - + - - - Paracity Gallery v0.41 - + + Paracity Gallery v0.41 + - - - + + + + + +
+

@@ -124,8 +128,22 @@ ':`

-Download -
- - +DOWNLOAD FILES + + + + + + + + + \ No newline at end of file diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/data/index_download_newwindow.html b/works/Dennis de Bel & Anton Jehle/esp-files/data/dl.html similarity index 87% rename from works/Dennis de Bel & Anton Jehle/esp-files/data/index_download_newwindow.html rename to works/Dennis de Bel & Anton Jehle/esp-files/data/dl.html index 281c848..7a7fc2d 100644 --- a/works/Dennis de Bel & Anton Jehle/esp-files/data/index_download_newwindow.html +++ b/works/Dennis de Bel & Anton Jehle/esp-files/data/dl.html @@ -1,9 +1,8 @@ - + - - - Paracity Gallery v0.41 - + + Paracity Gallery v0.41 + - - - + + + +

@@ -135,14 +125,21 @@ ':`

-
- +DOWNLOAD FILES + + + + + - - + \ No newline at end of file diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/data/index.html b/works/Dennis de Bel & Anton Jehle/esp-files/data/index.html index 716f4a1..6e66bed 100644 --- a/works/Dennis de Bel & Anton Jehle/esp-files/data/index.html +++ b/works/Dennis de Bel & Anton Jehle/esp-files/data/index.html @@ -1,9 +1,8 @@ - + - - - Paracity Gallery v0.41 - + + Paracity Gallery v0.41 + - - - + + + + +
+

@@ -125,9 +136,25 @@ ':`

-CONNECT -Download -
- - +CONNECT + + + + + + + + + + + + \ No newline at end of file diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/data/index_download_applink.html b/works/Dennis de Bel & Anton Jehle/esp-files/data/index_download_applink.html deleted file mode 100644 index f4397f8..0000000 --- a/works/Dennis de Bel & Anton Jehle/esp-files/data/index_download_applink.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - Paracity Gallery v0.41 - - - - - -
-

- -,-.----. -\ / \ ___ -| : \ ,--, ,--.'|_ -| | .\ : __ ,-. ,--.'| | | :,' -. : |: | ,' ,'/ /| | |, : : ' : -| | \ : ,--.--. ' | |' | ,--.--. ,---. `--'_ .;__,' / .--, -| : . // \ | | ,'/ \ / \ ,' ,'| | | | /_ ./| -; | |`-'.--. .-. |' : / .--. .-. | / / ' ' | | :__,'| : , ' , ' : -| | ; \__\/: . .| | ' \__\/: . .. ' / | | : ' : |__/___/ \: | -: ' | ," .--.; |; : | ," .--.; |' ; :__ ' : |__ | | '.'|. \ ' | -: : : / / ,. || , ; / / ,. |' | '.'|| | '.'|; : ; \ ; : -| | : ; : .' \---' ; : .' \ : :; : ;| , / \ \ ; -`---'.| | , .-./ | , .-./\ \ / | , / ---`-' : \ \ - `---` `--`---' `--`---' `----' ---`-' \ ' ; - ,----.. ,--, ,--, `--` - / / \ ,--.'| ,--.'| -| : : | | : | | : __ ,-. -. | ;. / : : ' : : ' ,' ,'/ /| -. ; /--` ,--.--. | ' | | ' | ,---. ' | |' | .--, -; | ; __ / \ ' | | ' | | / \ | | ,' /_ ./| -| : |.' .'.--. .-. || | : | | : / / |' : /, ' , ' : -. | '_.' : \__\/: . .' : |__' : |__ . ' / || | '/___/ \: | -' ; : \ | ," .--.; || | '.'| | '.'|' ; /|; : | . \ ' | -' | '/ .'/ / ,. |; : ; : ;' | / || , ; \ ; : -| : / ; : .' \ , /| , / | : | ---' \ \ ; - \ \ .' | , .-./---`-' ---`-' \ \ / : \ \ - `---` `--`---' ,--, `----' \ ' ; - ,----.. ,--.'| ,---, `--` - / / \ ,--, | : ,`--.' | - / . : ,---.'| : ' / / : - .---. . / ;. \; : | | ;: |.' ' - /. ./| . ; / ` ;| | : _' |`----': | - .-' . ' | ; | ; \ ; |: : |.' | ' ' ; -/___/ \: | | : | ; | '| ' ' ; : | | | -. \ ' . . | ' ' ' :\ \ .'. | ' : ; - \ \ ' ' ; \; / | `---`: | ' | | ' - \ \ ___\ \ ', / ' ; | ' : | - \ \ / .\; : / | : ; ; |.' - '---"\ ; |\ \ .' ' ,/ '---' - `--" `---` '--' - - -

-

- . - . - . ;. - .; - ;;. - ;.;; - ;;;;. - ;;;;; - ;;;;; - ;;;;; - ;;;;; - ;;;;; - ..;;;;;.. - ':::::' - ':` - -

-Download -
- - - \ No newline at end of file diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/data/index_download_old.html b/works/Dennis de Bel & Anton Jehle/esp-files/data/index_download_old.html deleted file mode 100644 index 5a66cc2..0000000 --- a/works/Dennis de Bel & Anton Jehle/esp-files/data/index_download_old.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - Paracity Gallery v0.41 - - - - - -
-

- -,-.----. -\ / \ ___ -| : \ ,--, ,--.'|_ -| | .\ : __ ,-. ,--.'| | | :,' -. : |: | ,' ,'/ /| | |, : : ' : -| | \ : ,--.--. ' | |' | ,--.--. ,---. `--'_ .;__,' / .--, -| : . // \ | | ,'/ \ / \ ,' ,'| | | | /_ ./| -; | |`-'.--. .-. |' : / .--. .-. | / / ' ' | | :__,'| : , ' , ' : -| | ; \__\/: . .| | ' \__\/: . .. ' / | | : ' : |__/___/ \: | -: ' | ," .--.; |; : | ," .--.; |' ; :__ ' : |__ | | '.'|. \ ' | -: : : / / ,. || , ; / / ,. |' | '.'|| | '.'|; : ; \ ; : -| | : ; : .' \---' ; : .' \ : :; : ;| , / \ \ ; -`---'.| | , .-./ | , .-./\ \ / | , / ---`-' : \ \ - `---` `--`---' `--`---' `----' ---`-' \ ' ; - ,----.. ,--, ,--, `--` - / / \ ,--.'| ,--.'| -| : : | | : | | : __ ,-. -. | ;. / : : ' : : ' ,' ,'/ /| -. ; /--` ,--.--. | ' | | ' | ,---. ' | |' | .--, -; | ; __ / \ ' | | ' | | / \ | | ,' /_ ./| -| : |.' .'.--. .-. || | : | | : / / |' : /, ' , ' : -. | '_.' : \__\/: . .' : |__' : |__ . ' / || | '/___/ \: | -' ; : \ | ," .--.; || | '.'| | '.'|' ; /|; : | . \ ' | -' | '/ .'/ / ,. |; : ; : ;' | / || , ; \ ; : -| : / ; : .' \ , /| , / | : | ---' \ \ ; - \ \ .' | , .-./---`-' ---`-' \ \ / : \ \ - `---` `--`---' ,--, `----' \ ' ; - ,----.. ,--.'| ,---, `--` - / / \ ,--, | : ,`--.' | - / . : ,---.'| : ' / / : - .---. . / ;. \; : | | ;: |.' ' - /. ./| . ; / ` ;| | : _' |`----': | - .-' . ' | ; | ; \ ; |: : |.' | ' ' ; -/___/ \: | | : | ; | '| ' ' ; : | | | -. \ ' . . | ' ' ' :\ \ .'. | ' : ; - \ \ ' ' ; \; / | `---`: | ' | | ' - \ \ ___\ \ ', / ' ; | ' : | - \ \ / .\; : / | : ; ; |.' - '---"\ ; |\ \ .' ' ,/ '---' - `--" `---` '--' - - -

-

- . - . - . ;. - .; - ;;. - ;.;; - ;;;;. - ;;;;; - ;;;;; - ;;;;; - ;;;;; - ;;;;; - ..;;;;;.. - ':::::' - ':` - -

-Download -
- - - \ No newline at end of file diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/data/paracity_gallery_v041.zip b/works/Dennis de Bel & Anton Jehle/esp-files/data/paracity_gallery_v041.zip index ecda115..01dd22d 100644 Binary files a/works/Dennis de Bel & Anton Jehle/esp-files/data/paracity_gallery_v041.zip and b/works/Dennis de Bel & Anton Jehle/esp-files/data/paracity_gallery_v041.zip differ diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/data/pic.jpg b/works/Dennis de Bel & Anton Jehle/esp-files/data/pic.jpg new file mode 100644 index 0000000..f42774e Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/esp-files/data/pic.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/esp-files/esp-files.ino b/works/Dennis de Bel & Anton Jehle/esp-files/esp-files.ino index 547dc40..14b5e06 100644 --- a/works/Dennis de Bel & Anton Jehle/esp-files/esp-files.ino +++ b/works/Dennis de Bel & Anton Jehle/esp-files/esp-files.ino @@ -1,4 +1,5 @@ // Captive portal with (arduino) OTA + SPIFFS + // some crap https://community.arubanetworks.com/t5/Controller-Based-WLANs/Apple-CNA-take-a-long-time-to-change-the-Cancel-Button-to-Done/ta-p/267612 #include #include @@ -8,23 +9,27 @@ #include #include "./DNSServer.h" // Dns server #include // SPIFFS - + #include // for storing state flags in memory + #define EEPROM_SIZE 1 // define the number of bytes you want to access + + DNSServer dnsServer; const byte DNS_PORT = 53; ESP8266WebServer server(80); #ifndef STASSID - #define STASSID "Paracity Gallery v041" + #define STASSID "\xF0\x9F\x9B\xB4 beta" //#define STASPSK "mypassword" #endif - IPAddress apIP(8, 8, 8, 8); //changed to google dns to try make it more android friendly? + IPAddress apIP(8, 8, 8, 8); const char* ssid = STASSID; - //const char* password = STAPSK; + //const char* password = STAPSK; void setup() { Serial.begin(115200); + EEPROM.begin(EEPROM_SIZE); Serial.println("Booting"); WiFi.mode(WIFI_AP); @@ -39,25 +44,35 @@ //Over-the-Air updates ArduinoOTA.setHostname("opencoil"); - //ArduinoOTA.setPassword("change-me"); //disabled to allow data uploads + //ArduinoOTA.setPassword("change-me"); //enabling password disables SPIFFS upload ArduinoOTA.begin(); SPIFFS.begin(); - server.on("/hotspot-detect.html", handleAppleCaptivePortal);//test captive avoid on ios (works!) - //redirect all traffic to index.html + //close the captive portal screen on ios! (does not work anymore.. somehow..still allows for faking internet connection but not for closing CNA automatically) + server.on("/CONNECT", closeCNAdelay); + + //restart esp after donwloading (hack to make sure captive portal re-opens again when a new user connects to the portal) + server.on("/RESTART", restartESP); + + + server.on("/generate_204", androidRedirect); //Adnroid captive portal, create notification and pops up android cna, but does not connect or go away after...needs closeCNAdelay like handler + //server.on("/favicon.ico", androidRedirect); //Another Android captive portal + server.on("/fwlink", androidRedirect); //Microsoft captive portal + + //if page is not found, redirect traffic to index.html (cheap way to redirect all traffic to our landing page) server.onNotFound([]() { - if(!handleFileRead(server.uri())){ - const char *metaRefreshStr = "

redirecting...

"; - server.send(200, "text/html", metaRefreshStr); - } - }); + if(!handleFileRead(server.uri())){ + const char *metaRefreshStr = "

redirecting...

"; + server.send(200, "text/html", metaRefreshStr); + } + }); server.begin(); } void loop() { - dnsServer.processNextRequest(); + dnsServer.processNextRequest(); ArduinoOTA.handle(); server.handleClient(); delay(50); @@ -82,16 +97,6 @@ String getContentType(String filename){ return "text/plain"; } -void handleAppleCaptivePortal() { - String Page = F("SuccessSuccess"); - - server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); - server.sendHeader("Pragma", "no-cache"); - server.sendHeader("Expires", "-1"); - server.send(200, "text/html", Page); - return; -} - //Given a file path, look for it in the SPIFFS file storage. Returns true if found, returns false if not found. bool handleFileRead(String path){ if(path.endsWith("/")) path += "index.html"; @@ -107,3 +112,36 @@ bool handleFileRead(String path){ } return false; } + +void handleAppleCaptivePortal() { + String Page = F("SuccessSuccess"); + server.sendHeader("Cache-Control","no-cache, no-store, must-revalidate"); + server.sendHeader("Pragma", "no-cache"); + server.sendHeader("Expires", "-1"); + server.send(200, "text/html", Page); + return; + } + + +void closeCNAdelay(){ + // write to fil or memory that the function has been executed + server.on("/hotspot-detect.html", handleAppleCaptivePortal); //only for ios, osx asks for random urls, issue: this stays 'open' for ever...also for new clients.. + //delay(1000); + //ESP.restart(); + return; +} + +void restartESP(){ + delay(1000); + ESP.restart(); + return; +} + +void androidRedirect(){ + String Page = F("

redirecting...

"); + server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); + server.sendHeader("Pragma", "no-cache"); + server.sendHeader("Expires", "-1"); + server.setContentLength(CONTENT_LENGTH_UNKNOWN); + server.send ( 200, "text/html", Page ); +}