1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

View File

@ -23,9 +23,9 @@ module.exports = function(RED) {
var gpioCommand = __dirname+'/nrgpio'; var gpioCommand = __dirname+'/nrgpio';
try { 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) { } catch(err) {
//RED.log.info(RED._("rpi-gpio.errors.ignorenode"));
throw "Info : "+RED._("rpi-gpio.errors.ignorenode"); throw "Info : "+RED._("rpi-gpio.errors.ignorenode");
} }