kkapitan / homebridge-homesung

A Homebridge plugin for Samsung SmartTV H and J models with the pairing protocol
MIT License
30 stars 5 forks source link

homesung-pair command #4

Closed markstamnl closed 6 years ago

markstamnl commented 6 years ago

Hi!

How do i execute the homesung-pair command within homebridge. I'm running it on a rpi with docker-compose....

kkapitan commented 6 years ago

Hi!

If you go to the terminal and type homesung-pair <ip of the device> what is the output? Can you also paste me what echo ${PATH} in terminal is showing?

The thing is, this command is not supposed to be executed within homebridge. It's more of a tool to help you setup the config.json properly for the plugin to work.

markstamnl commented 6 years ago

Thanks for the quick response!!

Output of echo ${PATH} is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

And the output of the original homesung-pair command is: /bin/sh: homesung-pair: not found

EDIT: BTW i'm using the terminal within the homebridge config UI...

kkapitan commented 6 years ago

I'm not sure how the homebridge config UI affects this, but as a workaround I would try to go to the homebridge-homesung plugin location (should be /usr/local/lib/node_modules/homebridge-homesung) and then run ./bin/pair <ip>.

Maybe the symlink was not created or is somehow outside of the $PATH (which is strange). Hopefully invoking this the longer way as described above will solve things.

markstamnl commented 6 years ago

Found the plugin location but now it says /usr/bin/env: ‘node’: No such file or directory

markstamnl commented 6 years ago

And if i try to run it with sudo python ./bin/pair 192.168.2.1 it says:

File "./bin/pair", line 3 'use strict'; ^ IndentationError: unexpected indent

markstamnl commented 6 years ago

Nevermind found it! Had to do this all in the homebridge config ui terminal, i think because i'm running homebridge within a docker-compose container

kkapitan commented 6 years ago

Yeah the python fails because this is javascript code which needs to be run by node.js. Glad that you solved it :)

Is it working now, can you connect to the TV?

markstamnl commented 6 years ago

Yup all fixed! Just setup the connection with my TV and everything is working great! Now playing around with al the different config options. Thanks for the help!