Merge pull request #14 from Hieromon/enhance/v0.9.6

Enhance/v0.9.6
pull/29/head
Hieromon Ikasamo 6 years ago committed by GitHub
commit 036600a68e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      README.md
  2. 23
      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. 45
      src/AutoConnectPage.cpp

@ -81,6 +81,10 @@ Full documentation is available on https://Hieromon.github.io/AutoConnect, some
## Change log
### [0.9.6] Sep. 27, 2018
- Improvement of RSSI detection for saved SSIDs.
- Fixed disconnection SoftAP completely at the first connection phase of the AutoConnect::begin.
### [0.9.5] Aug. 27, 2018
- 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.

@ -101,7 +101,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
<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
</a>
@ -400,6 +400,13 @@
<label class="md-nav__title" for="toc">Table of contents</label>
<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">
<a href="#095-aug27-2018" title="[0.9.5] Aug.27, 2018." class="md-nav__link">
[0.9.5] Aug.27, 2018.
@ -476,6 +483,13 @@
<label class="md-nav__title" for="toc">Table of contents</label>
<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">
<a href="#095-aug27-2018" title="[0.9.5] Aug.27, 2018." class="md-nav__link">
[0.9.5] Aug.27, 2018.
@ -530,7 +544,12 @@
<h1>Change log</h1>
<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="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 RSSI detection for saved SSIDs.</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>
<ul>
<li>Supports ESP32.</li>
<li>Fixed that crash may occur if the number of stored credentials in the EEPROM is smaller than the number of found WiFi networks.</li>

@ -647,9 +647,14 @@
},
{
"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 RSSI detection for saved SSIDs.\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"
},
{
"location": "/changelog/index.html#096-sep27-2018",
"text": "Improvement of RSSI detection for saved SSIDs. 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",
"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>
<loc>https://Hieromon.github.io/AutoConnect//index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>
@ -12,7 +12,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//gettingstarted/index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>
@ -20,7 +20,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//menu/index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>
@ -28,7 +28,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//basicusage/index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>
@ -36,7 +36,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//advancedusage/index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>
@ -44,7 +44,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//api/index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>
@ -52,7 +52,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//examples/index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>
@ -60,7 +60,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//faq/index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>
@ -68,7 +68,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//changelog/index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>
@ -76,7 +76,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//license/index.html</loc>
<lastmod>2018-09-18</lastmod>
<lastmod>2018-10-03</lastmod>
<changefreq>daily</changefreq>
</url>

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

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

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

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

Loading…
Cancel
Save