Skip to content

Commit 3c4aaec

Browse files
committed
Webserver only prints in resetbot if wlan is active
1 parent d2cd65b commit 3c4aaec

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

XRPLib/webserver.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ def start_network(self, ssid:str=None, robot_id:int= None, password:str=None):
6262
password = "remote.xrp"
6363
if password is not None and len(password) < 8:
6464
logging.warning("Password is less than 8 characters, this may cause issues with some devices")
65-
self.access_point = access_point(ssid, password)
65+
self.wlan = access_point(ssid, password)
6666
logging.info(f"Starting Access Point \"{ssid}\"")
67-
self.wlan = network.WLAN(network.AP_IF)
6867
self.ip = self.wlan.ifconfig()[0]
6968

7069
def connect_to_network(self, ssid:str=None, password:str=None, timeout = 10):
@@ -118,11 +117,12 @@ def stop_server(self):
118117
"""
119118
Shuts off the webserver and network and stops handling requests
120119
"""
121-
logging.enable_logging_types(logging.LOG_INFO)
122-
logging.info("Stopping Webserver and Network Connections")
123-
124-
stop()
125-
self.wlan.active(False)
120+
if self.wlan.active():
121+
logging.enable_logging_types(logging.LOG_INFO)
122+
logging.info("Stopping Webserver and Network Connections")
123+
124+
stop()
125+
self.wlan.active(False)
126126

127127
def _index_page(self, request):
128128
# Render index page and respond to form requests

0 commit comments

Comments
 (0)