12
12
13
13
try :
14
14
with open ("/proc/cpuinfo" ) as f :
15
- info = f .read ()
15
+ cpuinfo = f .read ()
16
16
rc = re .compile ("Revision\s*:\s(.*)\n " )
17
- result = rc .search (info )
17
+ result = rc .search (cpuinfo )
18
18
if result :
19
19
CPU_REVISION = result .group (1 )
20
20
if CPU_REVISION .startswith ("1000" ):
28
28
else :
29
29
BOARD_REVISION = 3
30
30
rc = re .compile ("Hardware\s*:\s(.*)\n " )
31
- result = rc .search (info )
31
+ result = rc .search (cpuinfo )
32
32
CPU_HARDWARE = result .group (1 )
33
33
except :
34
34
exception ("Error reading cpuinfo" )
@@ -39,7 +39,7 @@ class Hardware:
39
39
40
40
def __init__ (self ):
41
41
"""Initialize board revision and model info"""
42
- self .Revision = '0'
42
+ self .Revision = '0'
43
43
self .Serial = None
44
44
try :
45
45
with open ('/proc/cpuinfo' ,'r' ) as f :
@@ -68,20 +68,26 @@ def __init__(self):
68
68
self .model = 'Raspberry Pi Compute Module'
69
69
if self .Revision in ('0012' , '0015' ):
70
70
self .model = 'Raspberry Pi Model A+'
71
- if self .Revision in ('a01041' , 'a21041' , 'a22042' ):
71
+ if self .Revision in ('a01040' , ' a01041' , 'a21041' , 'a22042' ):
72
72
self .model = 'Raspberry Pi 2 Model B'
73
- if self .Revision in ('900092' , '900093' ):
73
+ if self .Revision in ('900092' , '900093' , '920093' ):
74
74
self .model = 'Raspberry Pi Zero'
75
75
if self .Revision in ('9000c1' ,):
76
76
self .model = 'Raspberry Pi Zero W'
77
- if self .Revision in ('a02082' , 'a22082' ):
77
+ if self .Revision in ('a02082' , 'a22082' , 'a32082' ):
78
78
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'
79
83
if 'Rockchip' in CPU_HARDWARE :
80
84
self .model = 'Tinker Board'
81
85
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' ):
83
87
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' ):
85
91
self .manufacturer = 'Embest, China'
86
92
if self .Revision in ('0005' , '0009' , '000f' ):
87
93
self .manufacturer = 'Qisda'
0 commit comments