vectronic / homebridge-jvc-projector

A Homebridge plugin providing standby control for JVC projectors over IP
MIT License
2 stars 2 forks source link

Install error on Synology NAS #8

Closed AviatorBimmer closed 1 year ago

AviatorBimmer commented 1 year ago

I have Homebridge running on a Synology NAS docker container and as soon as I install this plugin, this error is thrown in the terminal window:

[12/26/2022, 2:36:21 PM] [JVC NX7 Projector] stateTimeout error: Error: Command failed: /usr/bin/python /homebridge/node_modules/homebridge-jvc-projector/dist/get_power_state.py 192.168.183.6 Traceback (most recent call last): File "/homebridge/node_modules/homebridge-jvc-projector/dist/get_power_state.py", line 1, in <module> from jvc_projector import JVCProjector ImportError: No module named jvc_projector

When looking at the Homebridge Dashboard, this is what's shown:

Storage Path /var/lib/homebridge Config Path /var/lib/homebridge/config.json Plugin Path /var/lib/homebridge/node_modules

Can anyone help?

vectronic commented 1 year ago

Have you followed the installation instructions provided in the readme? You need to install the required python module.

AviatorBimmer commented 1 year ago

Have you followed the installation instructions provided in the readme? You need to install the required python module.

Yea I have. Step by step. I even deleted everything manually to make sure there were no old files and folders.

I even CD directly to the node_modules/homebridge-jvc-projector/dist/ folder, ran the LS command and verified there is a file named get_power_state.py file in this folder. It did list it with a couple other files.

I tried to run:

get_power_state.py 192.168.183.6

And it said file not found.

piejanssens commented 1 year ago

Same issue here:

$ root@homebridge:/var/lib/homebridge $ pip3 list
Package              Version    
-------------------- -----------
dbus-python          1.2.16     
jvc-projector-remote 0.2.2.post1
pip                  20.0.2     
PyGObject            3.36.0     
setuptools           66.1.1     
tzupdate             2.1.0      
wheel                0.34.2     

Another way:

$ root@homebridge:/var/lib/homebridge $ python3
Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> installed_packages = pkg_resources.working_set
>>> installed_packages_list = sorted(["%s==%s" % (i.key, i.version)
...    for i in installed_packages])
>>> print(installed_packages_list)
['dbus-python==1.2.16', 'jvc-projector-remote==0.2.2.post1', 'pip==20.0.2', 'pygobject==3.36.0', 'setuptools==66.1.1', 'tzupdate==2.1.0', 'wheel==0.34.2']
>>> 
piejanssens commented 1 year ago

@vectronic I think there is a mistake in your implementation?

According to the jvc-projector-remote python module, you need to import this way:

from jvc_projector_remote import JVCProjector

In your script, you are importing it this way:

from jvc_projector import JVCProjector
vectronic commented 1 year ago

Hmm interesting. Looks like you’re correct. I wonder why it worked for me as it is currently (at least in the past when I first installed it.)

I’ll check it out this week and update as needed.

Thanks for the info.

vectronic commented 1 year ago

This should be fixed in v1.3.1