4 Commits

Author SHA1 Message Date
52648c8915 Footer, info pro ESP32, lepsi reset stranka 2019-10-04 19:30:14 +02:00
e66a3306f1 Navrh na footer 2019-10-04 13:03:23 +02:00
4033637b82 Indikace stavu pripojeni pro ESP32 2019-10-04 10:50:35 +02:00
ed1659791a Odstraneni HTML5 validatoru 2019-09-02 06:46:45 +02:00
5 changed files with 69 additions and 15 deletions

View File

@@ -12,7 +12,7 @@
"type": "git",
"url": "http://git.xpablo.cz/pablo2048/WiFiConfig.git"
},
"version": "6.3",
"version": "6.3.1",
"license": "MIT",
"frameworks": "arduino",
"platforms": ["espressif8266", "espressif32"],

View File

@@ -1,5 +1,5 @@
name=WiFiConfig
version=6.3
version=6.3.1
author=Pavel Brychta
maintainer=Pavel Brychta <Pablo@xpablo.cz>
sentence=Enables seamless module configuration.

View File

@@ -1,4 +1,9 @@
/*
* v6.3.2- 4.10.2019 - Informace o aplikaci a jeji verzi do footeru, zrychlen restart z 10 na 5 sekund, vylepsena stranka pro reset
* verze pro ESP32 zobrazuje neco malo informaci o stavu pripojeni a duvodu vstupu do WifiConfig
*
* V6.3.1- 1.9.2019 - Odstraneni HTML5 validatoru - delaly akorat problemy a nedala se ulozit konfigurace i kdyz byly polozky skryty
*
* V6.3 - 12.8.2019 - IP adresa Captive portalu je zmenena na 172.217.28.1 kvuli funkcnosti na Android zarizenich (viz. zmena zde https://github.com/esp8266/Arduino/blob/master/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino)
* ladici vypis pri zachyceni presmerovani v Captive portalu.
*
@@ -82,6 +87,7 @@
#include <ESP8266WebServer.h>
#else
#include <WebServer.h>
#include <rom/rtc.h> // duvod resetu (https://github.com/espressif/arduino-esp32/issues/449)
#endif
#include "WiFiConfig.h"
#include <EEPROM.h>
@@ -456,7 +462,24 @@ void WiFiConfig::_handleRoot(void)
break;
}
#else
content.concat(F("Prozatím nedostupné"));
switch (_status)
{
case WL_CONNECT_FAILED:
content.concat(F("Připojení selhalo"));
break;
case 0xfe:
content.concat(F("Špatná EEPROM"));
break;
case 0xff:
content.concat(F("Vynucená konfigurace"));
break;
default:
content.concat(F("Neznámý"));
break;
}
#endif
content.concat(F("</div>"));
content.concat(FPSTR(PAGE_CAPTIVEPORTALCATCH2)); // 2. cast stranky (ukonceni)

View File

@@ -2,7 +2,7 @@
* @file WiFiConfig.h
* @author Pavel Brychta, http://www.xpablo.cz
*
* Copyright (c) 2015-18 Pavel Brychta. All rights reserved.
* Copyright (c) 2015-19 Pavel Brychta. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

View File

@@ -58,10 +58,10 @@ static const char PAGE_INDEX2[] PROGMEM = R"=====(
<div>
<label><input id='_st' name='_st' type='checkbox' style="width: 10%; float: left; margin-top: 5px;" onclick='hSC();' {c}>Statická IP konfigurace</label>
<div id="staticip">
<label>IP adresa<br><input type="text" name="_i" pattern='((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$' title='ip adresa ve formatu <cislo>.<cislo>.<cislo>.<cislo>' value='{i}'></label><br>
<label>Síťová maska<br><input type="text" name="_m" pattern='((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$' title='ip adresa ve formatu <cislo>.<cislo>.<cislo>.<cislo>' value='{m}'></label><br>
<label>Síťová brána<br><input type="text" name="_g" pattern='((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$' title='ip adresa ve formatu <cislo>.<cislo>.<cislo>.<cislo>' value='{g}'></label><br>
<label>Server DNS<br><input type="text" name="_d" pattern='((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$' title='ip adresa ve formatu <cislo>.<cislo>.<cislo>.<cislo>' value='{d}'></label><br>
<label>IP adresa<br><input type="text" name="_i" value='{i}'></label><br>
<label>Síťová maska<br><input type="text" name="_m" value='{m}'></label><br>
<label>Síťová brána<br><input type="text" name="_g" value='{g}'></label><br>
<label>Server DNS<br><input type="text" name="_d" value='{d}'></label><br>
</div>
</div>
<script>hAP();hSC();</script>
@@ -81,9 +81,22 @@ static const char PAGE_PARAM[] PROGMEM = R"=====(
static const char PAGE_END[] PROGMEM = R"=====(
<br>
<button type='submit'>Uložit a restartovat</button></form>
</div></body></html>
</div>)====="
#if defined APP_NAME && defined APP_VERSION
R"=====(<div style='text-align:right;font-size:11px;'><hr/>)====="
APP_NAME
" v"
APP_VERSION
R"=====(</div>
)====="
#else
R"=====(<div style='text-align:right;font-size:11px;'><hr/><a href='http://xpablo.cz' target='_blank' style='color:#aaa;'>WiFiConfig by xPablo</a></div>)====="
#endif
R"=====(</body></html>
)=====";
/*
<div style='text-align:right;font-size:11px;'><hr/><a href='http://xpablo.cz' target='_blank' style='color:#aaa;'>WiFiConfig by xPablo</a></div>
*/
// Nenalezeno zadne SSID
static const char PAGE_NO_SSID[] PROGMEM = R"=====(
<div>Nenalezená žádná síť. Občerstvi stránku pro nové hledání.</div>
@@ -91,13 +104,13 @@ static const char PAGE_NO_SSID[] PROGMEM = R"=====(
// Konfigurace ulozena - restartuji...
static const char PAGE_SAVED[] PROGMEM = R"=====(
<!DOCTYPE html><html lang="cs"><head><meta http-equiv="refresh" content="10;url=/"/>
<!DOCTYPE html><html lang="cs"><head><meta http-equiv="refresh" content="5;url=/"/>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1"/>
<title>xPablo Setup - Konfigurace uložena</title>
<style>div,input {margin-bottom: 5px;}body{width:200px;display:block;margin-left:auto;margin-right:auto;}</style>
</head><body>
Uloženo do EEPROM...<br/>
Restart za 10 sekund.
Restart za 5 sekund.
</body></html>
)=====";
@@ -111,11 +124,29 @@ static const char PAGE_CAPTIVEPORTALCATCH[] PROGMEM = R"=====(
<form action="/config" method="get"><button>Konfigurace WiFi</button></form><br/><form action="/i" method="get"><button>Informace o modulu</button></form><br/><form action="/r" method="post"><button class="red">Reset</button></form><br>
)=====";
// druha cast (mezi 1. a druhou cast muzeme doplnit dodatecne informace)
// druha cast (mezi 1. a 2. cast muzeme doplnit dodatecne informace)
static const char PAGE_CAPTIVEPORTALCATCH2[] PROGMEM = R"=====(
</div></body></html>
</div>
)====="
#if defined APP_NAME && defined APP_VERSION
R"=====(<div style='text-align:right;font-size:11px;'><hr/>)====="
APP_NAME
" v"
APP_VERSION
R"=====(</div>
)====="
#else
R"=====(<div style='text-align:right;font-size:11px;'><hr/><a href='http://xpablo.cz' target='_blank' style='color:#aaa;'>WiFiConfig by xPablo</a></div>)====="
#endif
R"=====(</body></html>
)=====";
static const char PAGE_RESTART[] PROGMEM = R"=====(
Restartuji...
<!DOCTYPE html><html lang="cs"><head><meta http-equiv="refresh" content="5;url=/"/>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1"/>
<title>xPablo Setup - Restart</title>
<style>div,input {margin-bottom: 5px;}body{width:200px;display:block;margin-left:auto;margin-right:auto;}</style>
</head><body>
Restartuji...
</body></html>
)=====";