diff --git a/agents/modules_meshcore/computer-identifiers.js b/agents/modules_meshcore/computer-identifiers.js index 1811f043..68b2ef19 100644 --- a/agents/modules_meshcore/computer-identifiers.js +++ b/agents/modules_meshcore/computer-identifiers.js @@ -75,6 +75,19 @@ function linux_identifiers() identifiers['board_vendor'] = 'Raspberry Pi'; identifiers['board_name'] = require('fs').readFileSync('/sys/firmware/devicetree/base/model').toString().trim(); identifiers['board_serial'] = require('fs').readFileSync('/sys/firmware/devicetree/base/serial-number').toString().trim(); + const memorySlots = []; + var child = require('child_process').execFile('/bin/sh', ['sh']); + child.stdout.str = ''; child.stdout.on('data', dataHandler); + child.stdin.write('vcgencmd get_mem arm && vcgencmd get_mem gpu\nexit\n'); + child.waitExit(); + try { + const lines = child.stdout.str.trim().split('\n'); + if (lines.length == 2) { + memorySlots.push({ Locator: "ARM Memory", Size: lines[0].split('=')[1].trim() }) + memorySlots.push({ Locator: "GPU Memory", Size: lines[1].split('=')[1].trim() }) + ret.memory = { Memory_Device: memorySlots }; + } + } catch (xx) { } } else { throw('Unknown board'); }