maix.sys

maix.sys module

You can use maix.sys to access this module with MaixPy
This module is generated from MaixCDK

Module

No module

Enum

Variable

Function

os_version

def os_version() -> str
item doc
brief Get system version
return version string, e.g. "2024.4.1-13af4b"

C++ defination code:

std::string os_version()

device_name

def device_name() -> str
item doc
brief Get device name
return device name, e.g. "MaixCAM"

C++ defination code:

std::string device_name()

host_name

def host_name() -> str
item doc
brief Get host name
return host name, e.g. "maixcam-2f9f"

C++ defination code:

std::string host_name()

host_domain

def host_domain() -> str
item doc
brief Get host domain
return host domain, e.g. "maixcam-2f9f.local"

C++ defination code:

std::string host_domain()

ip_address

def ip_address() -> dict[str, str]
item doc
brief Get ip address
return ip address, dict type, e.g. {"eth0": "192.168.0.195", "wlan0": "192.168.0.123", "usb0": "10.47.159.1"}

C++ defination code:

std::map<std::string, std::string> ip_address()

mac_address

def mac_address() -> dict[str, str]
item doc
brief Get mac address
return mac address, dict type, e.g. {"eth0": "00:0c:29:2f:9f:00", "wlan0": "00:0c:29:2f:9f:01", "usb0": "00:0c:29:2f:9f:02"}

C++ defination code:

std::map<std::string, std::string> mac_address()

device_key

def device_key() -> str
item doc
brief Get device key, can be unique id of device
return device key, 32 bytes hex string, e.g. "1234567890abcdef1234567890abcdef"

C++ defination code:

std::string device_key()

memory_info

def memory_info() -> dict[str, int]
item doc
brief Get memory info
return memory info, dict type, e.g. {"total": 1024, "used": 512, "hw_total": 25610241024}
total: total memory size in Byte.
used: used memory size in Byte.
hw_total: total memory size in Byte of hardware, the total <= hw_total,
OS kernel may reserve some memory for some hardware like camera, npu, display etc.

C++ defination code:

std::map<std::string, int> memory_info()

bytes_to_human

def bytes_to_human(bytes: int, precision: int = 2, base: int = 1024, unit: str = 'B', sep: str = ' ') -> str
item doc
brief Bytes to human readable string
param bytes:: bytes size,e.g. 1234B = 1234/1024 = 1.205 KB
precision:: decimal precision, default 2
base:: base number, default 1024
unit:: unit string, e.g. "B"
sep:: separator string, e.g. " "
return human readable string, e.g. "1.21 KB"

C++ defination code:

std::string bytes_to_human(unsigned long long bytes, int precision = 2, int base = 1024, const std::string &unit = "B", const std::string &sep = " ")

cpu_freq

def cpu_freq() -> dict[str, int]
item doc
brief Get CPU frequency
return CPU frequency, dict type, e.g. {"cpu0": 1000000000, "cpu1": 1000000000}

C++ defination code:

std::map<std::string, unsigned long> cpu_freq()

cpu_temp

def cpu_temp() -> dict[str, float]
item doc
brief Get CPU temperature
return CPU temperature, unit dgree, dict type, e.g. {"cpu": 50.0, "cpu0": 50, "cpu1": 50}

C++ defination code:

std::map<std::string, float> cpu_temp()

cpu_usage

def cpu_usage() -> dict[str, float]
item doc
brief Get CPU usage
return CPU usage, dict type, e.g. {"cpu": 50.0, "cpu0": 50, "cpu1": 50}

C++ defination code:

std::map<std::string, float> cpu_usage()

npu_freq

def npu_freq() -> dict[str, int]
item doc
brief Get NPU frequency
return NPU frequency, dict type, e.g. {"npu0": 500000000}

C++ defination code:

std::map<std::string, unsigned long> npu_freq()

disk_usage

def disk_usage(path: str = '/') -> dict[str, int]
item doc
brief Get disk usage
param path:: disk path, default "/"
return disk usage, dict type, e.g. {"total": 1024, "used": 512}

C++ defination code:

std::map<std::string, unsigned long long> disk_usage(const std::string &path = "/")

disk_partitions

def disk_partitions(only_disk: bool = True) -> list[dict[str, str]]
item doc
brief Get disk partition and mount point info
param only_disk: only return real disk, tempfs sysfs etc. not return, default true.
return disk partition and mount point info, list type, e.g. [{"device": "/dev/mmcblk0p1", "mountpoint": "/mnt/sdcard", "fstype": "vfat"}]

C++ defination code:

std::vector<std::map<std::string, std::string>> disk_partitions(bool only_disk = true)

poweroff

def poweroff() -> None
item doc
brief Power off device

C++ defination code:

void poweroff()

reboot

def reboot() -> None
item doc
brief Power off device and power on

C++ defination code:

void reboot()

Class