mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #819] Server returns http 400 when connected to SSID with password #686
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#686
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jbrepogmailcom on GitHub (Jan 31, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/819
Hello, I have noticed following strange behavior.
I have multiple SSIDs provided by my home ZYXEL router, some with password, some without it. I use WiFiManager.h to autoconnect to SSID. When it does not detect connection, it launches captive portal, where I can select some of my SSID, enter password and ESP then connects to that SSID.
Then I use OTA from web server, with ESP8266HTTPClient.h and ESP8266httpUpdate.h. I noticed that when I am connected to SSID with password, I can not connect to OTA server and it returns http code 400. When I reconnect to other SSID without password, then OTA server returns http code 200 and server the update file.
Jan
@tablatronix commented on GitHub (Jan 31, 2019):
SO when your esp is connected to an anoymous ap it works, and when its connected to a secure ap it doesn't ?
and have you tried this without wm , because it doesn't sound like anything to do with wm.
Sounds like a subnet or ip routing problem
@jbrepogmailcom commented on GitHub (Jan 31, 2019):
Yes exactly. It could be a problem of internal ZYXEL routing, because SSIDs have different MAC addresses.
However, when I tried HttpClient example from Arduino library that does not use WM, it connects to server correctly through both secure and insecure AP. My example with WM only connects to web server when connected to insecure AP (without password). I can send you problematic sketch, but not over this issue management, it would make messages hard to read.
@tablatronix commented on GitHub (Jan 31, 2019):
Are you setting mode(WIFI_STA) explicitly, and making sure it is not falling back to STA_AP ?
@jbrepogmailcom commented on GitHub (Jan 31, 2019):
In Arduino example yes and it works. In my sketch that uses WM there is no such setting, I connect with following code. It works well and does connect to AP (but not to http server, only with empty password). By the way, I had troubles with secure SSID earlier, I discovered I was using beta version of JSON library. I could not connect to secure SSID. When I downgraded JSON library, then secure SSID connection started to work.
Serial.println("Setting WiFi connection..."); delay(100); pinMode(LED_ESP, OUTPUT); ticker.attach(0.6, tick); WiFiManager wifiManager; wifiManager.setAPCallback(configModeCallback); if (!wifiManager.autoConnect(D_Name)) { Serial.println("failed to connect and hit timeout"); ESP.reset(); delay(1000); } Serial.println("connected...yeey :)");@tablatronix commented on GitHub (Jan 31, 2019):
that is the only thing I can think of, that the esp is being left in the default sta ap mode and you are not changing it in your code. This could cause issues with connecting to some aps, set mode explicitly in your code to what you need it to do
@jbrepogmailcom commented on GitHub (Jan 31, 2019):
Does "wifiManager.autoConnect()" set STA mode itself? Or how do I do it? Googling did not help much...
@tablatronix commented on GitHub (Jan 31, 2019):
WiFi.mode(WIFI_STA);
@jbrepogmailcom commented on GitHub (Jan 31, 2019):
I have added it after autoConnect():
WiFi.mode(WIFI_STA); Serial.println("connected...yeey :)");but the problem remains, http GET only works with SSID without password. With password, server returns 400 (error -11).
Interesting is that GET and telegram check connection DOES NOT work, while BLYNK sending parameters DOES work even with secure SSID...
@tablatronix commented on GitHub (Feb 1, 2019):
If you want to provide all the information in the issue form I can look into it.
You can try the development branch and see if it already been fixed