Get Raspberry Pi hardware info
Project description
# PiHardwareInfo
Get Raspberry Pi hardware info from /proc/cpuinfo
# Try
```bash
curl -s https://raw.githubusercontent.com/rexzhang/pi-hardware-info/master/pi_hardware_info.py | python3
```
```text
<PiHardwareInfo:0xa020d3, MODEL_3B_PLUS, BCM2837, 1024, 1.3, Sony_UK, 00000000d855943b>
```
# Install
```bash
pip install PiHardwareInfo
```
# Usage
```python
from pi_hardware_info import ModelType, get_info
info = get_info()
if info.model_type == ModelType.MODEL_3B_PLUS:
print('5G Wifi ready')
else:
print('only 2.4G Wifi')
```
# Other choice
* https://github.com/tompreston/raspi-version (work)
* https://pypi.org/project/pirev
* https://pypi.org/project/RPi.version
# Ref
* https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
* https://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/
* https://www.raspberrypi-spy.co.uk/2012/09/getting-your-raspberry-pi-serial-number-using-python/
Get Raspberry Pi hardware info from /proc/cpuinfo
# Try
```bash
curl -s https://raw.githubusercontent.com/rexzhang/pi-hardware-info/master/pi_hardware_info.py | python3
```
```text
<PiHardwareInfo:0xa020d3, MODEL_3B_PLUS, BCM2837, 1024, 1.3, Sony_UK, 00000000d855943b>
```
# Install
```bash
pip install PiHardwareInfo
```
# Usage
```python
from pi_hardware_info import ModelType, get_info
info = get_info()
if info.model_type == ModelType.MODEL_3B_PLUS:
print('5G Wifi ready')
else:
print('only 2.4G Wifi')
```
# Other choice
* https://github.com/tompreston/raspi-version (work)
* https://pypi.org/project/pirev
* https://pypi.org/project/RPi.version
# Ref
* https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
* https://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/
* https://www.raspberrypi-spy.co.uk/2012/09/getting-your-raspberry-pi-serial-number-using-python/
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.1.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for PiHardwareInfo-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d145f3fbe823617e600cb3a643fca3ec9b916ee1a504e26855148c681e8d6edd |
|
MD5 | da60a31a1a0dab48f540910f2e5de6be |
|
BLAKE2b-256 | 86c7089b914897b00f1dabe5992382951c09e5b8e9b95d1a2463fdfba8e9bebb |