rsg98 / homebridge-gpio-wpi2

Homebridge Raspberry Pi GPIO Platform (API 2) Plugin - using WiringPi as a backend
48 stars 16 forks source link

Error while executing: sudo npm install -g --unsafe-perm homebridge-gpio-wpi2 #58

Closed StefanMeGit closed 5 years ago

StefanMeGit commented 5 years ago

Hey guys I really need your help. I have installed the home bridge ect. and try to install the wpi2 plugin but got this error:

pi@hassbian:~ $ sudo npm install -g --unsafe-perm homebridge-gpio-wpi2
(node:9248) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
\
> sleep@5.2.4 install /usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/sleep
> node-gyp rebuild

make: Entering directory '/usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/sleep/build'
  CXX(target) Release/obj.target/node_sleep/sleep.o
  SOLINK_MODULE(target) Release/obj.target/node_sleep.node
  COPY Release/node_sleep.node
make: Leaving directory '/usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/sleep/build'

> epoll@0.1.22 install /usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/epoll
> node-gyp rebuild

make: Entering directory '/usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/epoll/build'
  CXX(target) Release/obj.target/epoll/src/epoll.o
  SOLINK_MODULE(target) Release/obj.target/epoll.node
  COPY Release/epoll.node
make: Leaving directory '/usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/epoll/build'

> node-wiring-pi@0.0.3 install /usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/node-wiring-pi
> /bin/bash ./install.sh

Checking for wiringpi: install ok installed
Building node-wiring-pi ... 
make: Entering directory '/usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/node-wiring-pi/build'
  CXX(target) Release/obj.target/nodeWiringPi/src/addon.o
  CXX(target) Release/obj.target/nodeWiringPi/src/wiringPi.o
In file included from ../node_modules/nan/nan.h:53:0,
                 from ../src/addon.h:10,
                 from ../src/wiringPi.h:5,
                 from ../src/wiringPi.cc:1:
../src/wiringPi.cc: In function 'void nodewpi::init_wiringPi(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)':
../src/wiringPi.cc:689:32: error: 'PI_MODEL_3' was not declared in this scope
   NODE_DEFINE_CONSTANT(target, PI_MODEL_3);
                                ^
/usr/include/nodejs/src/node.h:246:54: note: in definition of macro 'NODE_DEFINE_CONSTANT'
         v8::Number::New(isolate, static_cast<double>(constant));              \
                                                      ^~~~~~~~
nodeWiringPi.target.mk:109: recipe for target 'Release/obj.target/nodeWiringPi/src/wiringPi.o' failed
make: *** [Release/obj.target/nodeWiringPi/src/wiringPi.o] Error 1
make: Leaving directory '/usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/node-wiring-pi/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.14.71-v7+
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure" "build"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge-gpio-wpi2/node_modules/node-wiring-pi
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
homebridge-gpio-wpi2@0.2.0 /usr/local/lib/node_modules/homebridge-gpio-wpi2
├── sleep@5.2.4 (nan@2.13.2)
├── epoll@0.1.22 (bindings@1.2.1, nan@2.6.2)
└── node-wiring-pi@0.0.3 (bindings@1.2.1, nan@2.13.2)
toshibochan commented 5 years ago

Try this https://github.com/dubocr/homebridge-gpio-device Maybe have what you need

rsg98 commented 5 years ago

Fixed in upstream node-wiring-pi https://github.com/rsg98/node-wiring-pi/commit/1bb7963e7b615e4a9be27d0a64013dd49d998e7f