benlamonica/homebridge-rasppi-gpio-garagedoor

Error when initializing home bridge

Closed this issue · 2 comments

fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: ENOENT: no such file or directory, open '/sys/class/gpio/gpio22/value'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at RaspPiGPIOGarageDoorAccessory.readPin (/usr/local/lib/node_modules/homebridge-rasppi-gpio-garagedoor/index.js:149:26)
at RaspPiGPIOGarageDoorAccessory.isClosed (/usr/local/lib/node_modules/homebridge-rasppi-gpio-garagedoor/index.js:158:21)
at RaspPiGPIOGarageDoorAccessory.initService (/usr/local/lib/node_modules/homebridge-rasppi-gpio-garagedoor/index.js:124:25)
at new RaspPiGPIOGarageDoorAccessory (/usr/local/lib/node_modules/homebridge-rasppi-gpio-garagedoor/index.js:66:8)
at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:297:29)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:87:38)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:45:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)

Node v8.11.1
Linux garage 4.14.62+ #1134 Tue Aug 14 16:58:07 BST 2018 armv6l GNU/Linux
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch

Finally figured out I needed to export the pin. Ran this command as root echo 22 > /sys/class/gpio/export and the file is now available for the node app to use. I have to do the same for any pin I want to access through this node app.

And now I see you handle this in the garage-door-gpio script, though I'm not using the same pins so I need to customize that for my needs.