-
-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For WebUI v3, ESP 800 was sending hardcoded values for the WebSocket …
…address, rather than the values as actually configured
- Loading branch information
1 parent
3c58324
commit fbc75ba
Showing
1 changed file
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fbc75ba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a failure mode here. If the response includes an explicit IP address, and later the WiFi router goes down and comes back up, a different IP address can be assigned but WebUI will still know the old one and be unable to reconnect. See lines 578-588 (line numbers after this patch) for more information.
fbc75ba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't disagree with the assessment, however, I'm not sure what could/should be done in that case.
The code here was copied from the ESP800 implementation that already existed for the V2 UI at line 579 of this file:
At the moment, this address is only being used in WebUI3 to fill out the modal dialog that appears when connecting from within the captive portal in AP mode.
fbc75ba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this a bit more....
If the router went down and lost connection, WebUI3 will detect the disconnect and show a screen with a "Connect again" button like this.
In this case, I believe it will reconnect, and retrieve the settings again with ESP800, which will contain the new address.
So practically speaking, I don't think there is a case with WebUI3 where this can cause an issue.
fbc75ba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test it? The easy way to simulate the router going down is to connect via a mobile hotspot. The mobile hotspot that is built into recent Windows is very convenient for such tests.
fbc75ba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did end up testing afterwards last night that the "Connect again" button does trigger the ESP800 to be sent again with WebUI3, which should only come into play if you are in STA mode with DHCP enabled, but connected using mDNS at http://fluid.local or whatever it's configured as.
Direct IP address connection will force you to do a full refresh when it changes. AP mode should not be affected.