Added iperf error handling, labelled RSRP outputs
This commit is contained in:
parent
96d12a24ce
commit
e2ce2d718c
18
relay.py
18
relay.py
|
|
@ -69,12 +69,28 @@ def calculate_ping(
|
|||
def relay_iperf(
|
||||
filename: str, base_address: str, relay_address: str, duration: str
|
||||
) -> None:
|
||||
try:
|
||||
collect_iperf(
|
||||
filename=filename, server_ip=base_address, duration=duration, stations="eg"
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"iPerf error: {e}")
|
||||
data = {
|
||||
"iperf_full": f"Error: {e}",
|
||||
"stations": "eg",
|
||||
}
|
||||
save_data_to_json(data=data, filename=filename)
|
||||
try:
|
||||
collect_iperf(
|
||||
filename=filename, server_ip=relay_address, duration=duration, stations="er"
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"iPerf error: {e}")
|
||||
data = {
|
||||
"iperf_full": f"Error: {e}",
|
||||
"stations": "er",
|
||||
}
|
||||
save_data_to_json(data=data, filename=filename)
|
||||
# try:
|
||||
# collect_iperf_remote(filename=filename)
|
||||
# except Exception as e:
|
||||
|
|
@ -117,7 +133,7 @@ def collect_data(
|
|||
# Send to server
|
||||
print(f"\nPing Time: {data.get('ping_time')}")
|
||||
print(
|
||||
f"RSRP: {data.get('RSRP PRX')} {data.get('RSRP DRX')} {data.get('RSRP RX2')} {data.get('RSRP RX3')}"
|
||||
f"RSRP: PRX: {data.get('RSRP PRX')} DRX: {data.get('RSRP DRX')} RX2: {data.get('RSRP RX2')} RX3: {data.get('RSRP RX3')}"
|
||||
)
|
||||
print(f"Service: {data.get('network information')}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user