diff --git a/networkconfig.py b/networkconfig.py index 45edc0c..03b64a9 100644 --- a/networkconfig.py +++ b/networkconfig.py @@ -45,38 +45,68 @@ def send_response(client, payload, status_code=200): def handle_root(client): global wlan_sta - response_header = """ -

Wi-Fi Client Setup

-
- - - + + + + + + +
Wifi Name + + + + - - - -
+ WiFi Name + +
Password
-

- -

 

-
-
Your ssid and password information will be saved into the "passwd.dat" file in your ESP module for future usage. Be careful about security!
-
-

Some useful infos:

-
    -
  • Wi-Fi Client for MicroPython GitHub from cpopp
  • -
  • My github address tayfunulu
  • -
- - """ + response_footer = """\ + +
Password
+

+ +

+ +

 

+
+
+ + Your ssid and password information will be saved into the + "passwd.dat" file in your ESP module for future usage. + Be careful about security! + +
+
+

+ Some useful infos: +

+ + + """ send_response(client, response_header + response_variable + response_footer) @@ -99,11 +129,19 @@ def handle_configure(client, request): return False if do_connect(ssid, password): - response_footer = """ - -


-

ESP successfully connected to Wi-Fi network """ + ssid + """.

-

""" + response_footer = """\ + +
+

+

+ + ESP successfully connected to WiFi network %(ssid)s. + +

+

+
+ + """ % dict(ssid=ssid) send_response(client, response_footer) try: with open("passwd.dat", "r") as f: @@ -115,15 +153,21 @@ def handle_configure(client, request): f.write(ex_data) return True else: - response_footer = """ - -
-

Wi-Fi Not Configured to """ + ssid + """

-

-
- -
- """ + response_footer = """\ + +
+

+ + ESP could not connect to WiFi network %(ssid)s. + +

+

+
+ +
+
+ + """ % dict(ssid=ssid) send_response(client, response_footer) return False