| 4.22.0 |
2020-02-17 |
diff --git a/docs/index.html b/docs/index.html
index cfa35a7..95bb7ee 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -168,7 +168,7 @@
systeminformation
- Current Version: 4.22.0
+ Current Version: 4.22.1
diff --git a/lib/memory.js b/lib/memory.js
index bfe9632..ace26ac 100644
--- a/lib/memory.js
+++ b/lib/memory.js
@@ -15,6 +15,7 @@
const os = require('os');
const exec = require('child_process').exec;
+const execSync = require('child_process').execSync;
const util = require('./util');
let _platform = process.platform;
@@ -314,6 +315,62 @@ function memLayout(callback) {
}
});
}
+ if (!result.length) {
+ result.push({
+ size: os.totalmem(),
+ bank: '',
+ type: '',
+ clockSpeed: 0,
+ formFactor: '',
+ partNum: '',
+ serialNum: '',
+ voltageConfigured: -1,
+ voltageMin: -1,
+ voltageMax: -1,
+ });
+
+ // Try Raspberry PI
+ try {
+ let stdout = execSync('cat /proc/cpuinfo 2>/dev/null');
+ let lines = stdout.toString().split('\n');
+ let model = util.getValue(lines, 'hardware', ':', true).toUpperCase();
+ let version = util.getValue(lines, 'revision', ':', true).toLowerCase();
+
+ if (model === 'BCM2835' || model === 'BCM2708' || model === 'BCM2709' || model === 'BCM2835' || model === 'BCM2837') {
+
+ const clockSpeed = {
+ '0': 400,
+ '1': 450,
+ '2': 450,
+ '3': 3200
+ };
+ result[0].clockSpeed = version && version[2] && clockSpeed[version[2]] || 400;
+ result[0].clockSpeed = version && version[4] && version[4] === 'd' ? '500' : result[0].clockSpeed;
+ result[0].type = 'LPDDR2';
+ result[0].type = version && version[2] && version[2] === '3' ? 'LPDDR4' : result[0].type;
+ result[0].formFactor = 'SoC';
+
+ stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null');
+ lines = stdout.toString().split('\n');
+ let freq = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0;
+ if (freq) {
+ result.clockSpeed = freq;
+ }
+
+ stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null');
+ lines = stdout.toString().split('\n');
+ let voltage = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0;
+ if (voltage) {
+ result.voltageConfigured = voltage;
+ result.voltageMin = voltage;
+ result.voltageMax = voltage;
+ }
+ }
+ } catch (e) {
+ util.noop();
+ }
+
+ }
if (callback) { callback(result); }
resolve(result);
});
diff --git a/lib/system.js b/lib/system.js
index d946286..9650f72 100644
--- a/lib/system.js
+++ b/lib/system.js
@@ -100,6 +100,10 @@ function system(callback) {
if (result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2835' || result.model === 'BCM2837') {
// Pi 4
+ if (['c03112'].indexOf(result.version) >= 0) {
+ result.model = result.model + ' - Pi 4 Model B';
+ result.version = result.version + ' - Rev. 1.2';
+ }
if (['a03111', 'b03111', 'c03111'].indexOf(result.version) >= 0) {
result.model = result.model + ' - Pi 4 Model B';
result.version = result.version + ' - Rev. 1.1';