Closed avenantsoftware closed 8 years ago
It shouldn't matter as long as you are on the same LAN (ethernet or wifi).
I guess the reason you can't connect is either you haven't enabled zeroconf/bonjour/local network discovery in your TV, or, the TV advertises itself under a different name. This should be made dynamic, looking it up instead of a hardcoded name, but it works well for me and this project is borderline abandoned. PR's on this issue are appreciated.
Check the above and get back if it doesn't work. Will close the issue otherwise in a while.
I have no zeroconf/bonjour setting on my tv but can set the name for the tv in the network to lgsmarttv.lan, also if I use the lg remote android app it finds my tv as lgsmarttv.lan. so it must be configured correctly, why would the android app otherwise find it as lgsmarttv.lan? also: sudo nmap -sV -p 1-65535 192.168.2.6 works
The nmap command will just scan the TV for ports open and try to identify services behind open ports and doesn't indicate whether you have enabled the mDNS service. I'll have a look at exactly what the setting is called and update the readme and this thread soon.
Yeah, the only setting I have is to allow LG Connect apps. That should be it. Honestly, I don't remember where the lgsmarttv.lan
come from as I can't find any references to it in the TV now. You can set a name but mine isn't that, and it still works. Perhaps it got reset at some point but my router still has it cached? Don't know. Look at my answer to issue #1 , I will make it autodetecting instead.
With your new code I get an error:
node show-float.js /Users/htpc/node_modules/lgtv/index.js:296 if (hoststr.indexOf("ws://") !== 0) { ^
TypeError: hoststr.indexOf is not a function
at _check_host_string (/Users/htpc/node_modules/lgtv/index.js:296:15)
at Object.connect (/Users/htpc/node_modules/lgtv/index.js:314:10)
at run_test (/Users/htpc/Source/lgtv.js/examples/show-float.js:4:8)
at Object.
What's your input? If I provide the function with a plain string, eg "hejhopp", it works as it should and I don't get that error, but if I provide eg {hostname: "hejhopp"}, ie not a string, then it doesn't and I get the same error you get. So, doublecheck your input, it should be lgtv.connect("hostname.lan", callback);
On a sidenote, I would love to hear how you (intend to) use the module! :)
Since hostname/ipaddress is now able to be set as an parameter to connect() and you can now connect, I mark this issue as solved. Cheers!
I get an error:
Connect Error: Error: getaddrinfo ENOTFOUND lgsmarttv.lan lgsmarttv.lan:3000
Does it matter if the TV is connected through lan or wifi? because my tv is connected trough wifi to my local network