detect Pi updates for LEDborg, mcp3008 and neopixel

This commit is contained in:
Dave Conway-Jones
2016-11-02 10:02:07 +00:00
parent d9c551c026
commit d52f9dcd30
6 changed files with 18 additions and 10 deletions

View File

@@ -22,8 +22,10 @@ module.exports = function(RED) {
var piCommand = __dirname+'/neopix';
if (!fs.existsSync("/dev/ttyAMA0")) { // unlikely if not on a Pi
//RED.log.info(RED._("rpi-gpio.errors.ignorenode"));
try {
var cpuinfo = fs.readFileSync("/proc/cpuinfo").toString();
if (cpuinfo.indexOf(": BCM") === -1) { throw "Info : "+RED._("rpi-gpio.errors.ignorenode"); }
} catch(err) {
throw "Info : "+RED._("rpi-gpio.errors.ignorenode");
}