different test for Pi (rather than use serial port name)

This commit is contained in:
Dave Conway-Jones 2016-11-03 08:56:18 +00:00
parent a235745be7
commit f66c91e18e
1 changed files with 2 additions and 2 deletions

View File

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