Skip to content
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

Add link to next Webui #11

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions wifimgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ap_ssid = "WifiManager"
ap_password = "tayfunulu"
ap_authmode = 3 # WPA2
link_to_next_webui = True

NETWORK_PROFILES = 'wifi.dat'

Expand Down Expand Up @@ -202,11 +203,19 @@ def handle_configure(client, request):
<span style="color: #ff0000;">
ESP successfully connected to WiFi network %(ssid)s.
</span>
</h1>
</h1>""" % dict(ssid=ssid)
if link_to_next_webui:
response += """\
<p style="text-align: center;">
<a href="http://%(ip)s/">To new Interface</a><br>
(You must be connected to the set network to follow this Link)
</p>
""" % dict(ip=wlan_sta.ifconfig()[0])
response += """\
<br><br>
</center>
</html>
""" % dict(ssid=ssid)
"""
send_response(client, response)
try:
profiles = read_profiles()
Expand Down Expand Up @@ -290,4 +299,3 @@ def start(port=80):
handle_not_found(client, url)
finally:
client.close()