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:
parent
a235745be7
commit
f66c91e18e
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user