Comments (6)
Looks useful. Let me add it.
from espasyncwifimanager.
class AsyncWiFiManager
{
public:
AsyncWiFiManager(AsyncWebServer * server, DNSServer *dns);
void scan();
String scanme();
String handleInfome();
/** Handle the info ME page */
String AsyncWiFiManager::handleInfome() {
DEBUG_WM(F("Info"));
String pager;
String page ;
page += F("<dt>Chip ID</dt><dd>");
page += ESP.getChipId();
page += F("</dd>");
page += F("<dt>Flash Chip ID</dt><dd>");
page += ESP.getFlashChipId();
page += F("</dd>");
page += F("<dt>IDE Flash Size</dt><dd>");
page += ESP.getFlashChipSize();
page += F(" bytes</dd>");
page += F("<dt>Real Flash Size</dt><dd>");
page += ESP.getFlashChipRealSize();
page += F(" bytes</dd>");
page += F("<dt>Soft AP IP</dt><dd>");
page += WiFi.softAPIP().toString();
page += F("</dd>");
page += F("<dt>Soft AP MAC</dt><dd>");
page += WiFi.softAPmacAddress();
page += F("</dd>");
page += F("<dt>Station SSID</dt><dd>");
page += WiFi.SSID();
page += F("</dd>");
page += F("<dt>Station IP</dt><dd>");
page += WiFi.localIP().toString();
page += F("</dd>");
page += F("<dt>Station MAC</dt><dd>");
page += WiFi.macAddress();
page += F("</dd>");
page += F("</dl>");
pager = page;
return pager;
DEBUG_WM(F("Sent info page"));
}
Usage;
String handleInfome = wifiManager.handleInfome();
ws.textAll(handleInfome);
Please can you add this also?
@alanswx Thanks a lot!
from espasyncwifimanager.
Html part for wifiManager.scanme();
<script>
function c(l) {
document.getElementById('ssid').value = l.innerText || l.textContent;
document.getElementById('passwordnet').focus();
}
</script>
from espasyncwifimanager.
I am not sure about the interrupt - but the scan should be separate from printing out the results of the scan. We have to scan in the background because the async web server can't pause during a request. Therefore, I try to have the last scan cached. I think you want two calls - one to scan, and one to return the results in a string.
I am not sure where your HTML goes.. If you want to submit a sample with a websocket example that would be great.
from espasyncwifimanager.
I pushed some changes. Here are the relevant calls:
String scanModal();
String infoAsString()
Does this work for you? Thanks!!
from espasyncwifimanager.
Hi Thanks for update! It works clearly!
You can get this interrupt like this;
html-js
websocket.onopen = function(evt) {
console.log("CONNECTED");
websocket.send("sendMebaby");
}
trigger ws message in ws events...
String infoAsString = wifiManager.infoAsString();
ws.textAll(infoAsString);
// directly append returning string to a div element in html.
I saw resets so i put a bool in the loop which works stabile
if (searchWifi) {
String ok = wifiManager.scanModal();
// directly append returning string to a div element in html.
ws.textAll(ok);
searchWifi = false;
}
in html js-jquey needed ;
websocket.onmessage = function(evt) {
if (evt.data.indexOf("<div><a href=") > -1) {
// console.log(evt.data);
$("#temp").remove();
$('#network').append("<div id='temp'></div>");
$('#temp').append(evt.data);
}
if (evt.data.indexOf("Chip ID") > -1) {
// console.log(evt.data);
$("#tempinfos").remove();
$('#infos').append("<div id='tempinfos'></div>");
$('#tempinfos').append(evt.data);
}
}
from espasyncwifimanager.
Related Issues (20)
- AsyncWiFiManagerParameter add boolean parameter
- Works with ESP32? HOT 4
- dont save ssid and pass HOT 1
- Get SSID and PASSWORD for current connect WIFI HOT 1
- how to allow use with CTBot HOT 1
- how to use a different port to 80 for the portal HOT 2
- My ConfigAP not removed from phones Wifi list after a connection HOT 1
- Option to set debug to other Serial
- Config portal Custom link
- Custom AsyncWiFiManagerParameter Invalid conclusion HTML
- How to get Manager state
- Why does it use <form> for links?
- ESP8266 I can't get the wifi credentials to be forgotten HOT 9
- ESPAsyncWiFiManager forgets data after reboot HOT 10
- Compilation file with Esp8266 3.1.0
- ESPAsyncWiFiManager garbled in Chinese words
- Build Failure ESPAsyncWiFiManager.cpp:398:51 HOT 4
- ESP32 reconnect when connection lost HOT 4
- undefined reference and ld returned 1 exit status
- add support to set hotname
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from espasyncwifimanager.