@@ -31,14 +31,14 @@ def __init__(self):
31
31
self .FUNCTION_SUFFIX = "endfunction"
32
32
self .display_arrows = False
33
33
34
- def start_network (self , robot_number :int ):
34
+ def start_network (self , robot_id :int ):
35
35
"""
36
36
Open an access point from the XRP board to be used as a captive host. The network password is "remote.xrp"
37
37
"""
38
- self .access_point = access_point (f"XRP_{ robot_number } " , "remote.xrp" )
38
+ self .access_point = access_point (f"XRP_{ robot_id } " , "remote.xrp" )
39
39
self .ip = network .WLAN (network .AP_IF ).ifconfig ()[0 ]
40
40
41
- def connect_to_network (self , ssid :str , password :str , timeout = 10 ):
41
+ def connect_to_network (self , ssid :str , password :str , robot_id : int , timeout = 10 ):
42
42
"""
43
43
Connect to a wifi network with the given ssid and password.
44
44
If the connection fails, the board will disconnect from the network and return.
@@ -62,8 +62,9 @@ def start_server(self):
62
62
"""
63
63
logging .info (f"Starting DNS Server at { self .ip } " )
64
64
dns .run_catchall (self .ip )
65
+ self .DOMAIN = self .ip
66
+ logging .disable_logging_types (logging .LOG_INFO )
65
67
server .run ()
66
- logging .info ("Webserver Started" )
67
68
68
69
def _index_page (self , request ):
69
70
# Render index page and respond to form requests
@@ -164,12 +165,12 @@ def _handleUserFunctionRequest(self, text) -> bool:
164
165
try :
165
166
user_function = self .buttons [text ]
166
167
if user_function is None :
167
- print ("User function " + text + " not found" )
168
+ logging . warning ("User function " + text + " not found" )
168
169
return False
169
170
user_function ()
170
171
return True
171
172
except :
172
- print ("User function " + text + " caused an exception" )
173
+ logging . error ("User function " + text + " caused an exception" )
173
174
return False
174
175
175
176
def _generateHTML (self ):
0 commit comments