Skip to main content

Get Raspberry Pi hardware info

Project description

PiHardwareInfo

image image image

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

Ref

Project details


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)

Uploaded Source

Built Distribution

PiHardwareInfo-0.6.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for pihardwareinfo-0.6.1.tar.gz
Algorithm Hash digest
SHA256 40cf3ecc6416636495ee7bbf8d8e26a257fdaa0f380334f84ee04e00e044d997
MD5 9ac6dda583b47499a4e568ba3c0c4a04
BLAKE2b-256 3adc13ce11a367c0ad947be7fc14c311de283fb7edc94444dd057035c76c4abf

See more details on using hashes here.

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

Hashes for PiHardwareInfo-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91e96604b121f04845aa8325bc535d4636545f905b8ecc338c3cb2e19544c0ff
MD5 229a029636a84eaf87b147dda5a6b1dc
BLAKE2b-256 d2888a117596c8d9b34860c9477a5d8cb023d3ad9cf55f67f73646aefcc84399

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page