Update to v0.9.6

pull/14/head
Hieromon Ikasamo 6 years ago
parent 757a9975fe
commit 095ca06155
  1. 4
      README.md
  2. 21
      docs/changelog/index.html
  3. 7
      docs/search/search_index.json
  4. 20
      docs/sitemap.xml
  5. 5
      mkdocs/changelog.md
  6. 9
      src/AutoConnect.cpp
  7. 6
      src/AutoConnectCredential.h
  8. 43
      src/AutoConnectPage.cpp

@ -81,6 +81,10 @@ Full documentation is available on https://Hieromon.github.io/AutoConnect, some
## Change log ## Change log
### [0.9.6] Sep. 27, 2018
- Improvement of detecting RSSI of saved SSID.
- Fixed disconnection SoftAP completely at the first connection phase of the AutoConnect::begin.
### [0.9.5] Aug. 27, 2018 ### [0.9.5] Aug. 27, 2018
- Supports the espressif arduino-esp32 core. - Supports the espressif arduino-esp32 core.
- Fixed that crash may occur if the number of stored credentials in the EEPROM is smaller than the number of found WiFi networks. - Fixed that crash may occur if the number of stored credentials in the EEPROM is smaller than the number of found WiFi networks.

@ -101,7 +101,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
<label class="md-overlay" data-md-component="overlay" for="drawer"></label> <label class="md-overlay" data-md-component="overlay" for="drawer"></label>
<a href="#095-aug27-2018" tabindex="1" class="md-skip"> <a href="#096-sep27-2018" tabindex="1" class="md-skip">
Skip to content Skip to content
</a> </a>
@ -400,6 +400,13 @@
<label class="md-nav__title" for="toc">Table of contents</label> <label class="md-nav__title" for="toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix> <ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#096-sep27-2018" title="[0.9.6] Sep.27, 2018." class="md-nav__link">
[0.9.6] Sep.27, 2018.
</a>
</li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#095-aug27-2018" title="[0.9.5] Aug.27, 2018." class="md-nav__link"> <a href="#095-aug27-2018" title="[0.9.5] Aug.27, 2018." class="md-nav__link">
[0.9.5] Aug.27, 2018. [0.9.5] Aug.27, 2018.
@ -476,6 +483,13 @@
<label class="md-nav__title" for="toc">Table of contents</label> <label class="md-nav__title" for="toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix> <ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#096-sep27-2018" title="[0.9.6] Sep.27, 2018." class="md-nav__link">
[0.9.6] Sep.27, 2018.
</a>
</li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#095-aug27-2018" title="[0.9.5] Aug.27, 2018." class="md-nav__link"> <a href="#095-aug27-2018" title="[0.9.5] Aug.27, 2018." class="md-nav__link">
[0.9.5] Aug.27, 2018. [0.9.5] Aug.27, 2018.
@ -530,6 +544,11 @@
<h1>Change log</h1> <h1>Change log</h1>
<h4 id="096-sep27-2018">[0.9.6] Sep.27, 2018.<a class="headerlink" href="#096-sep27-2018" title="Permanent link">&para;</a></h4>
<ul>
<li>Improvement of detecting RSSI of saved SSID.</li>
<li>Fixed disconnection SoftAP completely at the first connection phase of the AutoConnect::begin.</li>
</ul>
<h4 id="095-aug27-2018">[0.9.5] Aug.27, 2018.<a class="headerlink" href="#095-aug27-2018" title="Permanent link">&para;</a></h4> <h4 id="095-aug27-2018">[0.9.5] Aug.27, 2018.<a class="headerlink" href="#095-aug27-2018" title="Permanent link">&para;</a></h4>
<ul> <ul>
<li>Supports ESP32.</li> <li>Supports ESP32.</li>

@ -647,9 +647,14 @@
}, },
{ {
"location": "/changelog/index.html", "location": "/changelog/index.html",
"text": "[0.9.5] Aug.27, 2018.\n\u00b6\n\n\n\n\nSupports ESP32.\n\n\nFixed that crash may occur if the number of stored credentials in the EEPROM is smaller than the number of found WiFi networks.\n\n\n\n\n[0.9.4] May 5, 2018.\n\u00b6\n\n\n\n\nAutomatically focus passphrase after selecting SSID with Configure New AP.\n\n\nSupports AutoConnectConfig::autoReconnect option, it will scan the WLAN when it can not connect to the default SSID, apply the applicable credentials if it is saved, and try reconnecting.\n\n\n\n\n[0.9.3] March 23, 2018.\n\u00b6\n\n\n\n\nSupports a static IP address assignment.\n\n\n\n\n[0.9.2] March 19, 2018.\n\u00b6\n\n\n\n\nImprovement of string literal declaration with the examples, no library change.\n\n\n\n\n[0.9.1] March 13, 2018.\n\u00b6\n\n\n\n\nA release of the stable.", "text": "[0.9.6] Sep.27, 2018.\n\u00b6\n\n\n\n\nImprovement of detecting RSSI of saved SSID.\n\n\nFixed disconnection SoftAP completely at the first connection phase of the AutoConnect::begin.\n\n\n\n\n[0.9.5] Aug.27, 2018.\n\u00b6\n\n\n\n\nSupports ESP32.\n\n\nFixed that crash may occur if the number of stored credentials in the EEPROM is smaller than the number of found WiFi networks.\n\n\n\n\n[0.9.4] May 5, 2018.\n\u00b6\n\n\n\n\nAutomatically focus passphrase after selecting SSID with Configure New AP.\n\n\nSupports AutoConnectConfig::autoReconnect option, it will scan the WLAN when it can not connect to the default SSID, apply the applicable credentials if it is saved, and try reconnecting.\n\n\n\n\n[0.9.3] March 23, 2018.\n\u00b6\n\n\n\n\nSupports a static IP address assignment.\n\n\n\n\n[0.9.2] March 19, 2018.\n\u00b6\n\n\n\n\nImprovement of string literal declaration with the examples, no library change.\n\n\n\n\n[0.9.1] March 13, 2018.\n\u00b6\n\n\n\n\nA release of the stable.",
"title": "Change log" "title": "Change log"
}, },
{
"location": "/changelog/index.html#096-sep27-2018",
"text": "Improvement of detecting RSSI of saved SSID. Fixed disconnection SoftAP completely at the first connection phase of the AutoConnect::begin.",
"title": "[0.9.6] Sep.27, 2018."
},
{ {
"location": "/changelog/index.html#095-aug27-2018", "location": "/changelog/index.html#095-aug27-2018",
"text": "Supports ESP32. Fixed that crash may occur if the number of stored credentials in the EEPROM is smaller than the number of found WiFi networks.", "text": "Supports ESP32. Fixed that crash may occur if the number of stored credentials in the EEPROM is smaller than the number of found WiFi networks.",

@ -4,7 +4,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -12,7 +12,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//gettingstarted/index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//gettingstarted/index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -20,7 +20,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//menu/index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//menu/index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -28,7 +28,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//basicusage/index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//basicusage/index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -36,7 +36,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//advancedusage/index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//advancedusage/index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -44,7 +44,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//api/index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//api/index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -52,7 +52,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//examples/index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//examples/index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -60,7 +60,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//faq/index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//faq/index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -68,7 +68,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//changelog/index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//changelog/index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -76,7 +76,7 @@
<url> <url>
<loc>https://Hieromon.github.io/AutoConnect//license/index.html</loc> <loc>https://Hieromon.github.io/AutoConnect//license/index.html</loc>
<lastmod>2018-09-18</lastmod> <lastmod>2018-09-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>

@ -1,3 +1,8 @@
#### [0.9.6] Sep.27, 2018.
- Improvement of detecting RSSI of saved SSID.
- Fixed disconnection SoftAP completely at the first connection phase of the AutoConnect::begin.
#### [0.9.5] Aug.27, 2018. #### [0.9.5] Aug.27, 2018.
- Supports ESP32. - Supports ESP32.

@ -2,8 +2,8 @@
* AutoConnect class implementation. * AutoConnect class implementation.
* @file AutoConnect.cpp * @file AutoConnect.cpp
* @author hieromon@gmail.com * @author hieromon@gmail.com
* @version 0.9.5 * @version 0.9.6
* @date 2018-08-27 * @date 2018-09-27
* @copyright MIT license. * @copyright MIT license.
*/ */
@ -86,7 +86,10 @@ bool AutoConnect::begin(const char* ssid, const char* passphrase, unsigned long
// Overwrite for the current timeout value. // Overwrite for the current timeout value.
_portalTimeout = timeout; _portalTimeout = timeout;
// Start WiFi connection. // Start WiFi connection with station mode.
WiFi.softAPdisconnect(false);
WiFi.enableAP(false);
delay(100);
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
delay(100); delay(100);

@ -2,8 +2,8 @@
* Declaration of AutoConnectCredential class. * Declaration of AutoConnectCredential class.
* @file AutoConnectCredential.h * @file AutoConnectCredential.h
* @author hieromon@gmail.com * @author hieromon@gmail.com
* @version 0.9.5 * @version 0.9.6
* @date 2018-02-17 * @date 2018-09-27
* @copyright MIT license. * @copyright MIT license.
*/ */
@ -38,7 +38,7 @@ struct station_config {
class AutoConnectCredential { class AutoConnectCredential {
public: public:
AutoConnectCredential(); AutoConnectCredential();
AutoConnectCredential(uint16_t offset); explicit AutoConnectCredential(uint16_t offset);
~AutoConnectCredential(); ~AutoConnectCredential();
uint8_t entries() { return _entries; } uint8_t entries() { return _entries; }
bool del(const char* ssid); bool del(const char* ssid);

@ -2,8 +2,8 @@
* AutoConnect portal site web page implementation. * AutoConnect portal site web page implementation.
* @file AutoConnectPage.h * @file AutoConnectPage.h
* @author hieromon@gmail.com * @author hieromon@gmail.com
* @version 0.9.5 * @version 0.9.6
* @date 2018-08-27 * @date 2018-09-27
* @copyright MIT license. * @copyright MIT license.
*/ */
@ -617,6 +617,7 @@ const char AutoConnect::_PAGE_OPENCREDT[] PROGMEM = {
"<title>AutoConnect credentials</title>" "<title>AutoConnect credentials</title>"
"<style type=\"text/css\">" "<style type=\"text/css\">"
"{{CSS_BASE}}" "{{CSS_BASE}}"
"{{CSS_ICON_LOCK}}"
"{{CSS_INPUT_BUTTON}}" "{{CSS_INPUT_BUTTON}}"
"{{CSS_LUXBAR}}" "{{CSS_LUXBAR}}"
"</style>" "</style>"
@ -952,7 +953,7 @@ String AutoConnect::_token_LIST_SSID(PageArgument& args) {
String ssid = WiFi.SSID(i); String ssid = WiFi.SSID(i);
if (ssid.length() > 0) { if (ssid.length() > 0) {
ssidList += String(F("<input type=\"button\" onClick=\"document.getElementById('ssid').value=this.getAttribute('value');document.getElementById('passphrase').focus()\" value=\"")) + ssid + String(F("\">")); ssidList += String(F("<input type=\"button\" onClick=\"document.getElementById('ssid').value=this.getAttribute('value');document.getElementById('passphrase').focus()\" value=\"")) + ssid + String(F("\">"));
ssidList += String(F("<label>")) + String(AutoConnect::_toWiFiQuality(WiFi.RSSI(i))) + String(F("%</label>")); ssidList += String(F("<label>")) + String(AutoConnect::_toWiFiQuality(WiFi.RSSI(i))) + String(F("&#037;</label>"));
if (WiFi.encryptionType(i) != ENC_TYPE_NONE) if (WiFi.encryptionType(i) != ENC_TYPE_NONE)
ssidList += String(F("<span class=\"img-lock\"></span>")); ssidList += String(F("<span class=\"img-lock\"></span>"));
ssidList += String(F("<br>")); ssidList += String(F("<br>"));
@ -970,23 +971,32 @@ String AutoConnect::_token_HIDDEN_COUNT(PageArgument& args) {
String AutoConnect::_token_OPEN_SSID(PageArgument& args) { String AutoConnect::_token_OPEN_SSID(PageArgument& args) {
AutoConnectCredential credit(_apConfig.boundaryOffset); AutoConnectCredential credit(_apConfig.boundaryOffset);
struct station_config entry; struct station_config entry;
String ssidList = ""; String ssidList;
String rssiSym;
int16_t wn;
uint8_t creEntries = credit.entries();
if (creEntries > 0) {
ssidList = String("");
wn = WiFi.scanNetworks(false, true);
}
else
ssidList = String(F("<p><b>No saved credentials.</b></p>"));
uint8_t* bssid = WiFi.BSSID(); for (uint8_t i = 0; i < creEntries; i++) {
for (uint8_t i = 0; i < credit.entries(); i++) {
credit.load(i, &entry); credit.load(i, &entry);
AC_DBG("A credential #%d loaded\n", (int)i); AC_DBG("A credential #%d loaded\n", (int)i);
ssidList += String(F("<input id=\"sb\" type=\"submit\" name=\"" AUTOCONNECT_PARAMID_CRED "\" value=\"")) + String((char*)entry.ssid) + String(F("\">")); ssidList += String(F("<input id=\"sb\" type=\"submit\" name=\"" AUTOCONNECT_PARAMID_CRED "\" value=\"")) + String(reinterpret_cast<char*>(entry.ssid)) + String(F("\"><label>"));
ssidList += String(F("<label>")); rssiSym = String(F("N/A</label>"));
if (bssid != NULL && memcmp(bssid, entry.bssid, sizeof(station_config::bssid)) == 0) for (int8_t sc = 0; sc < wn; sc++) {
ssidList += String(AutoConnect::_toWiFiQuality(WiFi.RSSI())) + String("%"); if (!memcmp(entry.bssid, WiFi.BSSID(sc), sizeof(station_config::bssid))) {
else rssiSym = String(AutoConnect::_toWiFiQuality(WiFi.RSSI(sc))) + String(F("&#037;</label>"));
ssidList += String("N/A"); if (WiFi.encryptionType(sc) != ENC_TYPE_NONE)
ssidList += String(F("</label><br>")); rssiSym += String(F("<span class=\"img-lock\"></span>"));
break;
} }
}
if (ssidList.length() == 0) { ssidList += rssiSym + String(F("<br>"));
ssidList = String(PSTR("<p><b>No saved credentials.</b></p>"));
} }
return ssidList; return ssidList;
} }
@ -1059,6 +1069,7 @@ PageElement* AutoConnect::_setupPage(String uri) {
elm->setMold(_PAGE_OPENCREDT); elm->setMold(_PAGE_OPENCREDT);
elm->addToken(PSTR("HEAD"), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); elm->addToken(PSTR("HEAD"), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1));
elm->addToken(PSTR("CSS_BASE"), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); elm->addToken(PSTR("CSS_BASE"), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1));
elm->addToken(PSTR("CSS_ICON_LOCK"), std::bind(&AutoConnect::_token_CSS_ICON_LOCK, this, std::placeholders::_1));
elm->addToken(PSTR("CSS_INPUT_BUTTON"), std::bind(&AutoConnect::_token_CSS_INPUT_BUTTON, this, std::placeholders::_1)); elm->addToken(PSTR("CSS_INPUT_BUTTON"), std::bind(&AutoConnect::_token_CSS_INPUT_BUTTON, this, std::placeholders::_1));
elm->addToken(PSTR("CSS_LUXBAR"), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); elm->addToken(PSTR("CSS_LUXBAR"), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1));
elm->addToken(PSTR("MENU"), std::bind(&AutoConnect::_token_MENU, this, std::placeholders::_1)); elm->addToken(PSTR("MENU"), std::bind(&AutoConnect::_token_MENU, this, std::placeholders::_1));

Loading…
Cancel
Save