Skip to content

Commit

Permalink
Merge files
Browse files Browse the repository at this point in the history
  • Loading branch information
vdsmax committed Jan 30, 2025
2 parents 86a27f6 + 405a60c commit 124c320
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ network_mesh_interface:
refresh_interval: 5000

devices_interface:
"00:30:1A:3A:4F:9A":
"00:30:1A:3A:10:C2":
name: "castor"
ip: "10.223.50.4"
type: "robot"
belongs_to: "beigebox"

"00:30:1A:3A:10:C2":
"00:30:1A:3A:4F:9A":
name: "basestation"
ip: "10.223.50.101"
type: "human_device_interface"
Expand Down Expand Up @@ -50,7 +50,7 @@ credentials:
ssh_commands:
cpu: "top -bn1 | grep 'Cpu(s)' | awk '{print $2+$4}'"
disk: "df -h / | tail -1 | awk '{print $4}'"
voltage: "bash -ic 'source /home/robot/ros2_ws/install/setup.bash && ros2 topic echo /motors/left/electrical --once | grep \"^voltage:\" | awk \"{print $1}\"'"
voltage: "bash -ic 'source /home/robot/ros2_ws/install/setup.bash && ros2 topic echo /motors/left/electrical --once | grep \"^voltage:\" | awk \"{print $0}\"'"

screen_sort:
value: "signal"
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
requests
pyyaml
paramiko
8 changes: 5 additions & 3 deletions watchdog_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ def authenticate(iface_name):
if 'result' in result and result['result'][0] == 0:
iface['token'] = result['result'][1]['ubus_rpc_session']
interface_states[iface_name]['connected'] = True
logging.info(f"Authenticated successfully with {iface_name}.")
# logging.info(f"Authenticated successfully with {iface_name}.")
return True
else:
interface_states[iface_name]['connected'] = False
logging.error(f"Authentication failed for {iface_name}: {result}")
# logging.error(f"Authentication failed for {iface_name}: {result}")
return False
except requests.exceptions.ConnectionError:
interface_states[iface_name]['connected'] = False
Expand Down Expand Up @@ -405,7 +405,9 @@ def update_data():
avg_cpu_str = f"{avg_cpu:.1f}%"

# Prepare data for top table
belongs_to = device_info.get('belongs_to', 'N/A') if device_info else 'N/A'
# belongs_to = MAC_TO_DEVICE.get(device_data.get('mac', 'N/A').lower()).get("belongs_to")
# belongs_to = device_info.get('belongs_to', 'N/A') if device_info else 'N/A'
belongs_to = f"{iface_name}"
signal = f"{device_data.get('signal', 'N/A')} dBm"
connected_time = f"{device_data.get('connected_time', 'N/A')} s"
throughput = f"{device_data.get('thr', 0)/1000:.2f} Mbps"
Expand Down

0 comments on commit 124c320

Please sign in to comment.