mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 02:38:03 +00:00 
			
		
		
		
	cisco_ap_ctl.py -> ap_ctl.py , lf_cisco_power.py, lf_dfs_test.py : update to use ap_ctl.py
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
		| @@ -13,7 +13,7 @@ $ pip3 install pexpect-serial | ||||
| 
 | ||||
| $ sudo pip3 install pexpect-serial | ||||
| 
 | ||||
| ./cisco_ap_ctl.py  | ||||
| ./ap_ctl.py  | ||||
| ''' | ||||
| 
 | ||||
| 
 | ||||
| @@ -78,9 +78,9 @@ class FileAdapter(object): | ||||
|         pass  # leave it to logging to flush properly | ||||
| 
 | ||||
| # Test command if lanforge connected ttyUSB0 | ||||
| # sudo ./cisco_ap_ctl.py -a lanforge -d 0 -o 0 -u "lanforge" -p "lanforge" -s "serial" -t "/dev/ttyUSB0" | ||||
| # sudo ./ap_ctl.py -a lanforge -d 0 -o 0 -u "lanforge" -p "lanforge" -s "serial" -t "/dev/ttyUSB0" | ||||
| # sample for lanforge 192.168.100.178 | ||||
| # sudo ./cisco_ap_ctl.py -a APA53.0E7B.EF9C -d 0 -o 0 -u "admin" -p "Admin123" -s "serial" -t "/dev/ttyUSB2" -z "show_log" | ||||
| # sudo ./ap_ctl.py -a APA53.0E7B.EF9C -d 0 -o 0 -u "admin" -p "Admin123" -s "serial" -t "/dev/ttyUSB2" -z "show_log" | ||||
| def main(): | ||||
| 
 | ||||
|     global logfile | ||||
| @@ -1641,8 +1641,8 @@ def main(): | ||||
|                             logg.info("####################################################################################################")  | ||||
|  | ||||
|                             try: | ||||
|                                 logg.info("cisco_ap_ctl.py: read AP power information") | ||||
|                                 ap_info= subprocess.run(["./cisco_ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                 logg.info("ap_ctl.py.py: read AP power information") | ||||
|                                 ap_info= subprocess.run(["./ap_ctl.py.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                                           "--user", ap_dict['ap_user'], "--passwd", ap_dict['ap_pw'],"--action", "powercfg"],stdout=subprocess.PIPE) | ||||
|                                 try: | ||||
|                                     pss = ap_info.stdout.decode('utf-8', 'ignore') | ||||
|   | ||||
| @@ -1625,9 +1625,9 @@ class L3VariableTime(Realm): | ||||
|             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'])) | ||||
|             try: | ||||
|                 logg.info("cisco_ap_ctl.py: read for CAC timer and CAC_EXPIRY_EVT") | ||||
|                 logg.info("ap_ctl.py: read for CAC timer and CAC_EXPIRY_EVT") | ||||
|                 # TODO remove position dependence if in tree  | ||||
|                 ap_info= subprocess.run(["./../cisco_ap_ctl.py", "--scheme", self.ap_dict['ap_scheme'], "--prompt", self.ap_dict['ap_prompt'],"--dest", self.ap_dict['ap_ip'], "--port", self.ap_dict["ap_port"], | ||||
|                 ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", self.ap_dict['ap_scheme'], "--prompt", self.ap_dict['ap_prompt'],"--dest", self.ap_dict['ap_ip'], "--port", self.ap_dict["ap_port"], | ||||
|                                           "--user", self.ap_dict['ap_user'], "--passwd", self.ap_dict['ap_pw'],"--tty", self.ap_dict['ap_tty'],"--baud", self.ap_dict['ap_baud'],"--action", "show_log"],capture_output=True, check=True) | ||||
|                 try: | ||||
|                     pss = ap_info.stdout.decode('utf-8', 'ignore') | ||||
| @@ -2499,9 +2499,9 @@ Sample script 2/11/2021 | ||||
|  | ||||
|                                                                         # clear log  (AP) | ||||
|                                                                         try: | ||||
|                                                                             logg.info("cisco_ap_ctl.py: clear log") | ||||
|                                                                             logg.info("ap_ctl.py: clear log") | ||||
|                                                                             # TODO remove position dependence if in tree  | ||||
|                                                                             ap_info= subprocess.run(["./../cisco_ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                                                             ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                                                                                       "--user", ap_dict['ap_user'], "--passwd", ap_dict['ap_pw'],"--tty", ap_dict['ap_tty'],"--baud", ap_dict['ap_baud'],"--action", "clear_log"],capture_output=True, check=True)#stdout=subprocess.PIPE) | ||||
|                                                                             try: | ||||
|                                                                                 pss = ap_info.stdout.decode('utf-8', 'ignore') | ||||
| @@ -2519,9 +2519,9 @@ Sample script 2/11/2021 | ||||
|  | ||||
|                                                                         # show log  (AP) | ||||
|                                                                         try: | ||||
|                                                                             logg.info("cisco_ap_ctl.py: show log") | ||||
|                                                                             logg.info("ap_ctl.py: show log") | ||||
|                                                                             # TODO remove position dependence if in tree  | ||||
|                                                                             ap_info= subprocess.run(["./../cisco_ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                                                             ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                                                                                       "--user", ap_dict['ap_user'], "--passwd", ap_dict['ap_pw'],"--tty", ap_dict['ap_tty'],"--baud", ap_dict['ap_baud'],"--action", "show_log"],capture_output=True, check=True) #stdout=subprocess.PIPE | ||||
|                                                                             try: | ||||
|                                                                                 pss = ap_info.stdout.decode('utf-8', 'ignore') | ||||
| @@ -2563,11 +2563,11 @@ Sample script 2/11/2021 | ||||
|                                                                                     ap_dict['ap_user'],ap_dict['ap_pw'],ap_dict['ap_tty'],ap_dict['ap_baud'],)) | ||||
|  | ||||
|                                                                             try: | ||||
|                                                                                 logg.info("cisco_ap_ctl.py: read for CAC timer and CAC_EXPIRY_EVT") | ||||
|                                                                                 logg.info("ap_ctl.py: read for CAC timer and CAC_EXPIRY_EVT") | ||||
|                                                                                 # TODO remove position dependence if in tree  | ||||
|                                                                                 #ap_info= subprocess.run(["./../cisco_ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                                                                 #ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                                                                 #                          "--user", ap_dict['ap_user'], "--passwd", ap_dict['ap_pw'],"--tty", ap_dict['ap_tty'],"--baud", ap_dict['ap_baud'],"--action", "cac_expiry_evt"],capture_output=True, check=True) | ||||
|                                                                                 ap_info= subprocess.run(["./../cisco_ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                                                                 ap_info= subprocess.run(["./../ap_ctl.py", "--scheme", ap_dict['ap_scheme'], "--prompt", ap_dict['ap_prompt'],"--dest", ap_dict['ap_ip'], "--port", ap_dict["ap_port"], | ||||
|                                                                                                           "--user", ap_dict['ap_user'], "--passwd", ap_dict['ap_pw'],"--tty", ap_dict['ap_tty'],"--baud", ap_dict['ap_baud'],"--action", "show_log"],capture_output=True, check=True) | ||||
|  | ||||
|                                                                                 try: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Chuck SmileyRekiere
					Chuck SmileyRekiere