alessiodionisi / homebridge-lgtv2

LG webOS plugin for homebridge: https://github.com/nfarina/homebridge
MIT License
29 stars 7 forks source link

CallBack warning #3

Closed amitgandhinz closed 7 years ago

amitgandhinz commented 7 years ago

Hi

Thanks for writing this plugin. I just started using it with my new LGTV running WebOS3.

I am seeing this error when I attempt to turn off the TV (running latest homebridge and node). It then results in homebridge app itself restarting.

Nov 21 12:02:04 raspberrypi homebridge[25380]: [11/21/2016, 12:02:04 PM] [TV] LGTv2 connect Nov 21 12:02:04 raspberrypi homebridge[25380]: (node:25380) DeprecationWarning: Calling an asynchronous function without callback is deprecated. Nov 21 12:02:04 raspberrypi homebridge[25380]: fs.js:89 Nov 21 12:02:04 raspberrypi homebridge[25380]: throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs Nov 21 12:02:04 raspberrypi homebridge[25380]: ^ Nov 21 12:02:04 raspberrypi homebridge[25380]: Error: EACCES: permission denied, open './lgtv-192.168.1.181'

alessiodionisi commented 7 years ago

Hello, in my home I'm using a raspberry with latest node version installed with nvm.

lgtv2 package needs to create a file named lgtv-{tv ip or hostname} in its directory, check if you have the permission to write in the folder. However if you use nvm you should not have any permission problems.

amitgandhinz commented 7 years ago

hmm...i don't see that file in the lgtv2 folder. There is one named "lgtv-lgwebostv" but thats not the one the app is looking to open.

I installed the plugin with sudo npm install -g homebridge-lgtv2 so it should have relevant permissions.

I also run homebridge using the homebridge user with systemd per the instructions - https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi

Any thoughts on what I should do to get this working? Do i need to create that file myself?

Thanks.

alessiodionisi commented 7 years ago

With nvm you don't need to use sudo for global packages and try to run form your pi user

amitgandhinz commented 7 years ago

thanks. Is there any way to get this working outside of nvm that you know of? Switching to nvm right now for me will require me resetting up my entire home bridge set up.

alessiodionisi commented 7 years ago

Try to run homebridge with sudo

amitgandhinz commented 7 years ago

is the file path for this file that it attempts to create supposed to be in here: /usr/local/lib/node_modules/homebridge-lgtv2/node_modules/lgtv2/ ?

I tried to chown the folder to 777 to open it up so I could test it, but still get the error, so wonder if its trying to create the file in a different location?

I also tried to chown 777 the /usr/local/lib/node_modules/homebridge-lgtv2 folder - also didn't solve it.

alessiodionisi commented 7 years ago

Yes, lgtv2 write the file in his folder.

Please try to open an issue on lgtv2 repo :)