-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is there any way to Integrate beginSmartConfig with this library? #429
Comments
Can you link to some reference for me? |
Sorry for incomplete info. http://espressif.com/en/products/software/esp-touch/overview Its very easy to configure ESP8266 or ESP32 through it.
There is simple Android Java Library provided by expressif which is very easy to use from Android App or cordova library. With this there is no need of WiFi Manager as such, But as it has its limitation we can keep both WiFi manager captive portal and SmartConfig side by side. It should be made available on press of some button or on some event. I've modified WiFimanager code for it but it does not looks like standard solution. |
Yeah ok this is the thing that sniffs data and pairs the ap using that credential, I do not have android to test this. Does it work well, i thought it was flaky. |
Works Excellent. Looks ok. People are talking about its issue with not compatible with 5GHz wifi channel. |
Ahh I see ill look at the examples |
I've created this cordova plugin.
|
There seems to be a few espressif IOS apps , but they do not appear to work. And my esp keeps throwing exceptions running this |
Try this. Actually its just single line but i tried to make it more useful for me. #include "WiFi.h"
unsigned long _connectTimeout = 0;
boolean _tryWPS = false;
void setup() {
Serial.begin(115200);
//Init WiFi as Station, start SmartConfig
WiFi.mode(WIFI_AP_STA);
if (connectWifi("", "") == WL_CONNECTED) {
Serial.println("IP Address:");
Serial.println(WiFi.localIP());
//connected
}
}
void loop() {
}
int connectWifi(String ssid, String pass) {
Serial.println("Connecting as wifi client...");
//fix for auto connect racing issue
if (WiFi.status() == WL_CONNECTED) {
Serial.println("Already connected. Bailing out.");
return WL_CONNECTED;
}
//check if we have ssid and pass and force those, if not, try with last saved values
if (ssid != "") {
WiFi.begin(ssid.c_str(), pass.c_str());
} else {
if (WiFi.SSID()) {
Serial.println("Using last saved values, should be faster");
//trying to fix connection in progress hanging
//ETS_UART_INTR_DISABLE();
//wifi_station_disconnect();
//ETS_UART_INTR_ENABLE();
WiFi.begin();
} else {
Serial.println("No saved credentials");
//Added Smart config by ioCare
WiFi.beginSmartConfig();
//Wait for SmartConfig packet from mobile
Serial.println("Waiting for SmartConfig.");
while (!WiFi.smartConfigDone()) {
delay(500);
Serial.print(".");
}
//Wait for WiFi to connect to AP
Serial.println("Waiting for WiFi");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("WiFi Connected.");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
}
}
int connRes = waitForConnectResult();
Serial.println ("Connection result: ");
Serial.println ( connRes );
//not connected, WPS enabled, no pass - first attempt
if (_tryWPS && connRes != WL_CONNECTED && pass == "") {
//startWPS();
//should be connected at the end of WPS
connRes = waitForConnectResult();
}
return connRes;
}
uint8_t waitForConnectResult() {
if (_connectTimeout == 0) {
return WiFi.waitForConnectResult();
} else {
Serial.println("Waiting for connection result with time out");
unsigned long start = millis();
boolean keepConnecting = true;
uint8_t status;
while (keepConnecting) {
status = WiFi.status();
if (millis() > start + _connectTimeout) {
keepConnecting = false;
Serial.println("Connection timed out");
}
if (status == WL_CONNECTED || status == WL_CONNECT_FAILED) {
keepConnecting = false;
}
delay(100);
}
return status;
}
} |
Also you must enter STA mode before starting smart config Those changes should fix that sketch But i still get wdt resets everytime after it runs for a bit |
Does anyone know how airkiss works, specifically with wechat? I thought a simple ap qrcode would work , but it must require something special. |
Yes ! you are right it should be WiFi.mode(WIFI_STA);. |
Its not me, |
Ok i tried this at home and it works, it must be only suitable for soho networks, or it just takes a really long time and the app times out or the esp crashes before it can work in environments with lots of APs, I have over 30 in my testing location, |
I don't know how airkiss works. But it looks like esp has it already as there is a lib file in SDK called libairkiss.a. Or might be smartconfig is using similar library. |
I think it is essentially the same thing, but airkiss is built into wechat, but the docs are only in chinese, and i have no idea how you initialize the pairing ( using wechat that is ) |
Do you have any ideas how wm would incorporate this ? |
Hello, Any news on this? Is it possible to use smart config with WiFiManager? I would like to use it in order to configure my ESP8266 using iOS with ESP-Touch protocol. Thanks. |
I can look at it again, but I don't see a reason to incorporate it, when you can just do it in code as it cannot work with wm ap mode.. |
Actually wm and SmartConfig are little different ideas. There is one big advantage with using wm, which makes it possible to save additional parameters by providing a config portal. The major challenge with wifi provisioning and device config is the tedious process which makes it difficult for end user to use the device during first time config. What everyone wants is easy, smooth and one click process to setup wifi on device. We can some how combine these two advantages together by providing some settings to enable smartconfig at startup, if successful then just bypass wm config if not then enter into wm autoconfig mode. also to add some on-demand way to to start smartconfig again. Also I'm always in favor of rest api for mobile companion app interface, I understand this is off-topic, but thats all what it comes down eventually for any commercial product. |
I have not found a decent smartconfig app, has the esp one been improved ? This is why I wanted to get airkiss working, its built into wechat, just not standardized outside of china, and has sparse docs. |
If you work with cordova, I have this small example app. this will create a complete app with smartconfig functionality. Load ESP with example smartconfig sketch. |
is there any way to Integrate beginSmartConfig with this library?
The text was updated successfully, but these errors were encountered: