klattimer / LGWebOSRemote

Command line webOS remote for LGTVs
MIT License
498 stars 97 forks source link

trying with webOS 3.0 on lg 60sj8500, can't scan #7

Closed hariedo closed 6 years ago

hariedo commented 6 years ago

Trying to figure out how the 'scan' works, and whether I have to edit lgtv.py or the .json file.

My LAN is 192.168.1.* and the TV is .118. I know its MAC by asking my router for it. What's the next step to having it scan? Should I just try nmap on the TV to figure out how different webOS is?

karlinnolabs commented 6 years ago

Line 92 - https://github.com/klattimer/LGWebOSRemote/blob/master/lgtv.py#L92

Here we send an "SSDP discover request" - this is a DLNA method for discovering devices, we then filter the devices down to LG TV's using a slightly inefficient try/except here

https://github.com/klattimer/LGWebOSRemote/blob/master/lgtv.py#L109

I'd say if anything your SSDP request is lost on your network, or the filter is broken.

Put response, address = sock.recvfrom(512) on line 108 and comment out the try/except block, then dump the response you get, paste that here and we'll go from there.

karlinnolabs commented 6 years ago

Please note that the IP range of the device isn't important, the SSDP discover will be received as a broadcast packet and responded to by any device that knows how. Also make sure that you're running WebOS 3+ (4 is fairly standard with everyone else now)

klattimer commented 6 years ago

no response from OP, closing works for me.