diff --git a/cisco_wifi_ctl.py b/cisco_wifi_ctl.py index 8879e3d6..d799876c 100755 --- a/cisco_wifi_ctl.py +++ b/cisco_wifi_ctl.py @@ -113,7 +113,7 @@ def main(): parser.add_argument("--action", type=str, help="perform action", choices=["config", "debug_disable_all","no_logging_console", "line_console_0", "country", "ap_country", "enable", "disable", "summary", "advanced", "cmd", "txPower", "bandwidth", "manual", "auto","no_wlan","show_wlan_summary", - "ap_channel", "channel", "show", "create_wlan", "enable_wlan", "disable_wlan", "wlan_qos", + "ap_channel", "auto_rf","channel", "show", "create_wlan", "enable_wlan", "disable_wlan", "wlan_qos", "disable_network_5ghz","disable_network_24ghz","enable_network_5ghz","enable_network_24ghz", "wireless_tag_policy","no_wlan_wireless_tag_policy","delete_wlan"]) parser.add_argument("--value", type=str, help="set value") @@ -954,6 +954,12 @@ def main(): else: command = "show advanced 802.11%s summary"%(band) + if ((args.action == "auto_rf") and ((args.ap is None))): + raise Exception("auto_rf requires AP name") + + if ((args.action == "auto_rf") and ((args.ap is None))): + command = "show ap auto-rf 802.11a %s"%(args.ap) + if ((args.action == "ap_country") and ((args.value is None) or (args.ap is None))): raise Exception("ap_country requires country and AP name") diff --git a/py-scripts/lf_cisco_dfs.py b/py-scripts/lf_cisco_dfs.py index 45e49109..61f08629 100755 --- a/py-scripts/lf_cisco_dfs.py +++ b/py-scripts/lf_cisco_dfs.py @@ -1363,6 +1363,31 @@ class L3VariableTime(Realm): return cc_ch + def read_auto_rf(self): + + logg.info("read_channel: cisco_wifi_ctl.py action advanced") + pss = "" + try: + logg.info("\ + scheme: {} ctlr: {} port: {} prompt: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.scheme, + self.ctlr,self.port,self.prompt,self.user, + self.passwd,self.ap,self.series,self.band,"advanced")) + + ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.scheme, "--prompt", self.prompt, "--port", self.port, "-d", self.ctlr, "-u", + self.user, "-p", self.passwd, + "-a", self.ap,"--series", self.series, "--band", self.band, "--action", "auto_rf"], + capture_output=True, check=True) + + pss = ctl_output.stdout.decode('utf-8', 'ignore') + logg.info(pss) + + except subprocess.CalledProcessError as process_error: + logg.info("Command Error, Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}". + format(process_error.returncode, process_error.output)) + time.sleep(1) + exit(1) + + def dfs_get_frequency(self,channel): # possibly have a dictionary @@ -1524,12 +1549,13 @@ class L3VariableTime(Realm): def ap_cac_verify(self): if(bool(self.ap_dict)): + pss = "" # will need to verify that timer has timed out on AP - need in results logg.info("DFS channel 5ghz {} done waiting CAC time, 2.4 ghz: {}".format(self.chan_5ghz, self.chan_24ghz)) - logg.info("####################################################################################################") + logg.info("##################################################################") logg.info("# READ changed to DFS channel {}, running CAC for 60 seconds.".format(self.chan_5ghz)) logg.info("# READ AP CAC_EXPIRY_EVT: CAC finished on DFS channel ") - logg.info("########################################################################################") + logg.info("##################################################################") logg.info("ap_dict {}".format(self.ap_dict)) logg.info("Read AP action: {} ap_scheme: {} ap_ip: {} ap_port: {} ap_user: {} ap_pw: {} ap_tty: {} ap_baud: {}".format("show_log",self.ap_dict['ap_scheme'],self.ap_dict['ap_ip'],self.ap_dict["ap_port"], self.ap_dict['ap_user'],self.ap_dict['ap_pw'],self.ap_dict['ap_tty'],self.ap_dict['ap_baud'])) @@ -1544,11 +1570,11 @@ class L3VariableTime(Realm): logg.info("ap_info was of type NoneType will set pss empty") except subprocess.CalledProcessError as process_error: - logg.info("####################################################################################################") + logg.info("###################################################") logg.info("# CHECK IF AP HAS CONNECTION ALREADY ACTIVE") - logg.info("####################################################################################################") + logg.info("###################################################") logg.info("# Unable to commicate to AP error code: {} output {}".format(process_error.returncode, process_error.output)) - logg.info("#####################################################################################################") + logg.info("###################################################") logg.info(pss) # fine CAC_TIMER for line in pss.splitlines(): @@ -1690,6 +1716,9 @@ class L3VariableTime(Realm): logg.info("FAIL: channel set on command line: {} not configured in controller: {} is there a DFS lockout condition".format(self.chan_5ghz,initial_channel)) pass_fail = "fail" + #if self.dfs + + best_csv_rx_row_data.append(initial_channel) best_csv_rx_row_data.append(final_channel) best_csv_rx_row_data.append(pass_fail)