diff --git a/lib/rpio.js b/lib/rpio.js index 1fed35e..2a20c70 100755 --- a/lib/rpio.js +++ b/lib/rpio.js @@ -94,7 +94,8 @@ var rpio_options = { gpiomem: true, mapping: 'physical', mock: false, - close_on_exit: true + close_on_exit: true, + device_tree_path: '/proc/device-tree/model', }; /* Default mock mode if hardware is unsupported. */ @@ -539,7 +540,7 @@ function detect_pinmap() var model; try { - model = fs.readFileSync('/proc/device-tree/model', 'ascii'); + model = fs.readFileSync(rpio_options.device_tree_path, 'ascii'); model = model.replace(/\0+$/, ''); } catch (err) { return false;