hobbyquaker / node-red-contrib-lgtv

Node-RED Nodes to control LG webOS Smart TVs :tv:
http://flows.nodered.org/node/node-red-contrib-lgtv
MIT License
59 stars 22 forks source link

Fail to connect in docker #2

Closed tomtom30 closed 6 years ago

tomtom30 commented 6 years ago

Hi, I tried to use your node in docker installation. I have tried to install it in palette manager but it fail because of root permission. I installed it with root rpm command and it is done. But when I try to connect TV nothing appen. I think it is about websocket but I am not sure. Do you know any issue with docker? Thanks Thomas

hobbyquaker commented 6 years ago

hmm, should be no problem to use it from inside a container, it only opens an outgoing websocket connection to the tv. Have you specified the TVs IP or do you rely on Hostname? Perhaps a name resolution problem? Can you check if you can ping the TV from inside your container?

michaelkoetter commented 6 years ago

Same issue here. Doesn't work from inside node-red-docker, although the TV is reachable. This is inside the container:

node-red@f8279d3c607c:~$ curl -v http://lgwebostv.home.m-koetter.de:3000
* Rebuilt URL to: http://lgwebostv.home.m-koetter.de:3000/
* Hostname was NOT found in DNS cache
*   Trying 10.10.1.72...
* Connected to lgwebostv.home.m-koetter.de (10.10.1.72) port 3000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.38.0
> Host: lgwebostv.home.m-koetter.de:3000
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sun, 10 Dec 2017 12:59:33 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
<
Hello world
* Connection #0 to host lgwebostv.home.m-koetter.de left intact

I installed a local instance on Windows as well and that just works as expected.

tomtom30 commented 6 years ago

Ok for me, I have found the solution for me. This node needs to be installed with root. For docker, it needs to be install in "/usr/src/node-red" manually with root.

michaelkoetter commented 6 years ago

Did a pcap capture and it looks like it is trying to resolve the default "lgwebostv", even when I enter an FQDN or an IP address. lgtv

(the svc-michael. ... is the default search domain of the docker container)

As a workaround, I changed the containers search domain, and now it connects.

tomtom30 commented 6 years ago

For information I worked with IP address directly

hobbyquaker commented 6 years ago

closing this issue, pls open a new one if support is needed.