Get Raspberry Pi hardware info
Project description
PiHardwareInfo
Get Raspberry Pi hardware info from /proc/cpuinfo
and /sys/class/net/*
Try
run
curl -s https://raw.githubusercontent.com/rexzhang/pi-hardware-info/master/pi_hardware_info.py | python3
result
PiHardwareInfo(
{'revision_code': '0x0',
'model_type': <ModelType.RPI_5: 23>,
'model_name': 'Raspberry Pi 5 Model B Rev 1.0',
'processor': <Processor.BCM2712: 4>,
'memory': 8192,
'manufacturer': <Manufacturer.SONY_UK: 0>,
'revision': '1.0',
'serial_number': 'ecc0679911340000',
'mac_address': {'eth0': '2C:CF:67:00:00:00',
'wlan0': '2C:CF:67:00:00:00'},
'overvoltage': False,
'otp_program': False,
'otp_read': False}
)
Install
pip install PiHardwareInfo
Usage as library
from pi_hardware_info import ModelType, PiHardwareInfo
info = PiHardwareInfo()
if info.model_type == ModelType.MODEL_3B_PLUS:
print('5G Wifi ready')
elif info.model_type == ModelType.MODEL_3B:
print('only 2.4G Wifi')
Usage as tool
python -m pi_hardware_info
History
0.6.1 - 20250225
- Add, network interface MAC address info
- Refactor
0.5.0 - 20250224
- Add, Support to raspberry pi 5
- Codebase modernization Updates
- Drop py3.5 py3.6 py3.7 py3.8
- Add type hints
- Add unit test
- Add pyproject.toml
- Add pre-commit
0.4.0 - 20220810
- Add, support Zero2W/400/CM4
- Add, Overvoltage/OTP Program/OTP Read support
0.3.3 - 20190709
- Support raspberry pi 4B
- Rewrite some code
0.2.0 - 20190302
- Add old style revision code support, support 1A/1B
0.1.0 - 20190301
- First release
Alternative
- https://github.com/tompreston/raspi-version
- https://pypi.org/project/pirev
- https://pypi.org/project/RPi.version
Ref
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pihardwareinfo-0.6.1.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file pihardwareinfo-0.6.1.tar.gz
.
File metadata
- Download URL: pihardwareinfo-0.6.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
40cf3ecc6416636495ee7bbf8d8e26a257fdaa0f380334f84ee04e00e044d997
|
|
MD5 |
9ac6dda583b47499a4e568ba3c0c4a04
|
|
BLAKE2b-256 |
3adc13ce11a367c0ad947be7fc14c311de283fb7edc94444dd057035c76c4abf
|
File details
Details for the file PiHardwareInfo-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: PiHardwareInfo-0.6.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
91e96604b121f04845aa8325bc535d4636545f905b8ecc338c3cb2e19544c0ff
|
|
MD5 |
229a029636a84eaf87b147dda5a6b1dc
|
|
BLAKE2b-256 |
d2888a117596c8d9b34860c9477a5d8cb023d3ad9cf55f67f73646aefcc84399
|