maximkulkin / esp-wifi-config Goto Github PK
View Code? Open in Web Editor NEWLibrary to bootstrap WiFi-enabled accessories WiFi config
License: MIT License
Library to bootstrap WiFi-enabled accessories WiFi config
License: MIT License
The idea comes from Ravensystem who recently implemented it into his HAA firmware (1.6.0~1.6.3)
quoting from his change log:
Setup Mode: Added RSSI and BSSID information to WiFi Scanner.
Setup Mode: WiFi Scanner now shows all WiFi even if different APs have same SSID.
Setup Mode: Added option to force WiFi to connect to a specific WiFi BSSID.
It would be very helpful if it was possible to have channel and RSSI, BSSID information of the available wifi networks. Based on that information, the user could make informed decisions, on which network to select. This information makes sense when Powerline(s), or Wifi Extender(s) are used which all share the same SSID. The user could instruct the esp device to always connect to a specific BSSID which has stronger signal. Or maybe, for whatever reason, there is a need to avoid an extender which is closer to the esp device and has very strong signal.
Having this feature will give more control to users who might experience connectivity issues.
Current observation: there is an unnecessary (and long) wait after the IP is acquired
Suggestion: add a callback related to assignment of IP and set a semaphore which does the waiting instead of a timer...
connected with xxx, channel 6
dhcp client start...
ip:192.168.178.109,mask:255.255.255.0,gw:192.168.178.1
>>> wifi_config: wifi_config_sta_connect_timeout_callback: Successfully connected
Currently the code has no protection against not entering a password. for wifi_config_init
. But having no password will cause the code to crash.
When I restart my router, I notice that my thermostats are restarting.
I still have not checked what causes the restart and first decided to ask if it is possible for the library to restart the device when I restart the wifi router?
Hello,
If the ssid contain a '&' within the name the configuration fail because of the post form will fill the value with &so the ssid is wrong and unable to connect to the wifi network.
As a workaround, you can post the rights values with postman for example.
in the body x-www-form-urlencoded with ssid and password keys.
cant fine the file fatal error: index.html.h: No such file in wifi_config.c
Hi! Is it possible to upload .png images that shows up when the wi-fi config page loads?
I want to show my logo inside the captive portal.
Is it possible? If yes, any example avaible?
Thanks
I want to know how to increase time to start AP mode after a disconnecting from wifi. thank y
I am quite a newbie with building and modifying projects of this size, but would like to know if I can use this directly with the homekit-demo examples/esp32/led in the same way that it was used in sonoffbasic. Will the button.c work as well? How hardware specific is the code between esp8266 and esp32? Can I just copy and modify the code from within the esp32 directory with the same makefile and it will build as expected?
Hi Maxim,
this light version of WifiManager is amazing, but it is possible to have on your wifi_config_init() a callback also for wifi disconnect event?
Thanks in advance
I have a persistent problem with power failures, my ESP's never recover from them because my router need a lot more time to start than the ESP, so it never connects. I usually have to disarm a circuit breaker to make it connect or do the softAp config again...
I raised the WIFI_CONFIG_CONNECT_TIMEOUT to 300000 and now the router have enough time to return online, I think 15 seconds is not sufficient time to a number of routers to boot up.
What do you think about raising the timeout on the library?
The trade-offs will not affect the setup process because as the softAp starts immediately when there is no saved config.
Not sure where to ask, so will try here. I did get the wifi config popup, selected my AP in the list, entered the password and clicked "join", but the config doesn't seem to be applied, as the Sonoff AP is still visible. This is what I see in the console log:
wifi_config: http_task: Got 64 incomming data
wifi_config: http_task: Got 16 incomming data
wifi_config: wifi_config_server_on_settings_update: Update settings, body = ssid=dodies&password=mypasswordhere
wifi_config: wifi_config_station_connect: No configuration found
wifi_config: Client disconnected
scandone
scandone
What am I doing wrong?
Am I correct that (xTaskGetTickCount() - context->connect_start_time) should be divided by portTICK instead of multiplied?
static void wifi_config_sta_connect_timeout_callback(void *arg) {
if (sdk_wifi_station_get_connect_status() == STATION_GOT_IP) {
// Connected to station, all is dandy
DEBUG("Successfully connected");
sdk_os_timer_disarm(&context->sta_connect_timeout);
wifi_config_softap_stop();
if (context->on_wifi_ready)
context->on_wifi_ready();
wifi_config_context_free(context);
context = NULL;
return;
}
if ((xTaskGetTickCount() - context->connect_start_time) * portTICK_PERIOD_MS < WIFI_CONFIG_CONNECT_TIMEOUT) {
// Still have time, continue trying
return;
}
sdk_os_timer_disarm(&context->sta_connect_timeout);
DEBUG("Timeout connecting to WiFi network, starting config AP");
// Not connected to station, launch configuration AP
wifi_config_softap_start();
}
There seems to be an issue on current iOS, and even macOS, where after selecting your wifi AP and clicking the Join button you get a white screen and it never goes away. Highly repeatable.
Realy nice Repo!!!!
The embed.py is not working properly for me the resulting HTML (index.html.h) code contains a unwanted line ending.
const char *html_settings_header =
"<!DOCTYPE html>
"
"<html>
"
"<head>
"
By changing the below line with a extra strip it works for me
def process_part(part):
return "\n".join(
- "\"" + line.lstrip().replace('"', '\\"') + "\""
+ "\"" + line.lstrip().replace('"', '\\"').strip() + "\""
for line in part.split("\n")
if line.strip()
)
Result:
const char *html_settings_header =
"<!DOCTYPE html>"
"<html>"
"<head>"
Is this something you can fix, ore should i create a pull request?
any way connecting to hidden ssid with
wifi_config_init("my-accessory", "my-password", on_wifi_ready);
Hi Maxim,
as far as I understand, when an already paired device restarts, it tries to reconnect to the last known Wifi SSID for xxx seconds (DWIFI_CONFIG_CONNECT_TIMEOUT=xxx) and then if it does not succeed it turns into AP mode.
I was wondering if it's possible to create a timeout for the period operating in AP mode. For example a device could stay in AP and wait for any connections and then if nothing happens for i.e. 5-10 minutes it would try to reconnect again to the last known Wifi network.
In the current implementation if for whatsoever reason the device does not connect to Wifi SSID, it turns into AP mode and stays there until you physically disconnect it from the mains. Having to power reset a device in such situation is sometimes tricky or difficult (i.e. in cases that a device is installed into an electrical box etc).
Similar discussions here: RavenSystem/esp-homekit-devices#169
and here RavenSystem/esp-homekit-devices#164
Thank you,
Yiannis
And does it support https://github.com/tzapu/WiFiManager#custom-parameters ?
There seems to be a memory leak somewhere when the esp-wifi-config
goes into AP mode. When combining it with esp-homekit
, this causes the SRP shared secret to fail.
The free heap before the shared secret fails AP mode is 21888
The free heap before the shared secret is created without AP Mode is 30324
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.