Skip to content

Commit 3de05c0

Browse files
committed
Add new revision info.
1 parent 684a772 commit 3de05c0

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

myDevices/system/hardware.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
try:
1414
with open("/proc/cpuinfo") as f:
15-
info = f.read()
15+
cpuinfo = f.read()
1616
rc = re.compile("Revision\s*:\s(.*)\n")
17-
result = rc.search(info)
17+
result = rc.search(cpuinfo)
1818
if result:
1919
CPU_REVISION = result.group(1)
2020
if CPU_REVISION.startswith("1000"):
@@ -28,7 +28,7 @@
2828
else:
2929
BOARD_REVISION = 3
3030
rc = re.compile("Hardware\s*:\s(.*)\n")
31-
result = rc.search(info)
31+
result = rc.search(cpuinfo)
3232
CPU_HARDWARE = result.group(1)
3333
except:
3434
exception("Error reading cpuinfo")
@@ -39,7 +39,7 @@ class Hardware:
3939

4040
def __init__(self):
4141
"""Initialize board revision and model info"""
42-
self.Revision = '0'
42+
self.Revision = '0'
4343
self.Serial = None
4444
try:
4545
with open('/proc/cpuinfo','r') as f:
@@ -68,20 +68,26 @@ def __init__(self):
6868
self.model = 'Raspberry Pi Compute Module'
6969
if self.Revision in ('0012', '0015'):
7070
self.model = 'Raspberry Pi Model A+'
71-
if self.Revision in ('a01041', 'a21041', 'a22042'):
71+
if self.Revision in ('a01040', 'a01041', 'a21041', 'a22042'):
7272
self.model = 'Raspberry Pi 2 Model B'
73-
if self.Revision in ('900092', '900093'):
73+
if self.Revision in ('900092', '900093', '920093'):
7474
self.model = 'Raspberry Pi Zero'
7575
if self.Revision in ('9000c1',):
7676
self.model = 'Raspberry Pi Zero W'
77-
if self.Revision in ('a02082', 'a22082'):
77+
if self.Revision in ('a02082', 'a22082', 'a32082'):
7878
self.model = 'Raspberry Pi 3 Model B'
79+
if self.Revision in ('a020d3'):
80+
self.model = 'Raspberry Pi 3 Model B+'
81+
if self.Revision in ('a020a0'):
82+
self.model = 'Raspberry Pi Compute Module 3'
7983
if 'Rockchip' in CPU_HARDWARE:
8084
self.model = 'Tinker Board'
8185
self.manufacturer = 'Element14/Premier Farnell'
82-
if self.Revision in ('a01041', '900092', 'a02082', '0012', '0011', '0010', '000e', '0008', '0004'):
86+
if self.Revision in ('a01041', '900092', 'a02082', '0012', '0011', '0010', '000e', '0008', '0004', 'a020d3', 'a01040', 'a020a0'):
8387
self.manufacturer = 'Sony, UK'
84-
if self.Revision in ('0014', '0015', 'a21041', 'a22082'):
88+
if self.Revision in ('a32082'):
89+
self.manufacturer = 'Sony, Japan'
90+
if self.Revision in ('0014', '0015', 'a21041', 'a22082', '920093'):
8591
self.manufacturer = 'Embest, China'
8692
if self.Revision in ('0005', '0009', '000f'):
8793
self.manufacturer = 'Qisda'

0 commit comments

Comments
 (0)