Skip to content

Commit

Permalink
Added hardware info for Jetson
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonghi committed Jan 27, 2025
1 parent f1c7911 commit 8bc46df
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/nanosaur/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

# Define default parameters
DEFAULT_PARAMS = {}

hardware = {}

def info(platform, params: Params, args):
"""Print version information."""
Expand Down Expand Up @@ -129,6 +129,12 @@ def info(platform, params: Params, args):
print(f" {TerminalFormatter.color_text(key, bold=True)}: {value}")
# Print Docker info
docker_info(platform)
if hardware:
print(TerminalFormatter.color_text("\nHardware Information:", bold=True))
# Print specific hardware information
for info in ['Module', 'L4T', 'Jetpack']:
if info in hardware:
print(f" {TerminalFormatter.color_text(info, bold=True)}: {hardware[info]}")


def install(platform, params: Params, args):
Expand Down Expand Up @@ -207,6 +213,9 @@ def main():
with jtop() as device:
if device.ok():
platform = device.board['platform']
if platform['Machine'] == 'aarch64':
global hardware
hardware = device.board['hardware']
except JtopException as e:
print(f"Error: {e}")
sys.exit(1)
Expand Down

0 comments on commit 8bc46df

Please sign in to comment.