hensm / fx_cast

Chromecast Web Sender SDK implementation for Firefox
https://hensm.github.io/fx_cast/
MIT License
1.87k stars 63 forks source link

[compat] Unable to cast from fx_cast (any website; on Ubuntu) to LG webOS TV #169

Closed vitorpy closed 3 years ago

vitorpy commented 3 years ago

I can't get fx_cast to locate my TV. It does however works under Chrome on MacOS.

fx_cast seems to be configured correctly. However, I cannot see my LG as a device to cast to. I believe the problem is related to avahi.

avahi-browse does not locate the TV.

Running avahi-bowse -ta:

vitor@vitor-Inspiron-5379:~$ avahi-browse -ta
+ wlp1s0 IPv6 WIFE_NAME _companion-link._tcp local
+ wlp1s0 IPv6 iPad _companion-link._tcp local
+ wlp1s0 IPv4 WIFE_NAME _companion-link._tcp local
+ wlp1s0 IPv4 iPad _companion-link._tcp local
+ wlp1s0 IPv4 googlerpc _googlerpc._tcp local
+ wlp1s0 IPv4 Google-Nest-Mini-72425af30279be458f4bafe93af399fb _googlecast._tcp local
+ wlp1s0 IPv4 72425af3-0279-be45-8f4b-afe93af399fb _googlezone._tcp local
+ wlp1s0 IPv6 HP DeskJet 2600 series [2C33E6] PDL Printer local
+ wlp1s0 IPv4 HP DeskJet 2600 series [2C33E6] PDL Printer local
+ wlp1s0 IPv6 HP DeskJet 2600 series [2C33E6] Internet Printer local
+ wlp1s0 IPv4 HP DeskJet 2600 series [2C33E6] Internet Printer local
+ wlp1s0 IPv6 HP DeskJet 2600 series [2C33E6] _scanner._tcp local
+ wlp1s0 IPv4 HP DeskJet 2600 series [2C33E6] _scanner._tcp local
+ wlp1s0 IPv6 HP DeskJet 2600 series [2C33E6] _uscan._tcp local
+ wlp1s0 IPv4 HP DeskJet 2600 series [2C33E6] _uscan._tcp local
+ wlp1s0 IPv6 HP DeskJet 2600 series [2C33E6] Secure Internet Printer local
+ wlp1s0 IPv4 HP DeskJet 2600 series [2C33E6] Secure Internet Printer local
+ wlp1s0 IPv6 HP DeskJet 2600 series [2C33E6] _uscans._tcp local
+ wlp1s0 IPv4 HP DeskJet 2600 series [2C33E6] _uscans._tcp local
+ wlp1s0 IPv4 HP DeskJet 2600 series [2C33E6] Web Site local
+ wlp1s0 IPv4 HP DeskJet 2600 series [2C33E6] _http-alt._tcp local
+ wlp1s0 IPv4 HP DeskJet 2600 series [2C33E6] _privet._tcp local
+ wlp1s0 IPv6 HP DeskJet 2600 series [2C33E6] Web Site local
+ wlp1s0 IPv6 HP DeskJet 2600 series [2C33E6] _http-alt._tcp local
+ wlp1s0 IPv6 HP DeskJet 2600 series [2C33E6] _privet._tcp local

The devices shown are my wife's iPad, a Google Nest Mini and my HP wifi printer. The TV is nowhere to be shown.

Running nmap -sV -p 1-65535 TV_IP:

vitor@vitor-Inspiron-5379:~/tmp/miraclecast/res$ sudo nmap -sV -p 1-65535 192.168.1.25
Starting Nmap 7.80 ( https://nmap.org ) at 2021-03-10 22:47 GMT
Nmap scan report for 192.168.1.25
Host is up (0.062s latency).
Not shown: 65524 closed ports
PORT STATE SERVICE VERSION
1291/tcp open upnp LG WebOS TV upnpd (model: UJ634V; WebOS 0.9; UPnP 1.0; DLNADOC 1.50)
1529/tcp open upnp LG WebOS upnpd (WebOS 1.5; UPnP 1.0)
1535/tcp open upnp LG WebOS upnpd (WebOS 4.1.0; UPnP 1.0)
1848/tcp open upnp Platinum unpnd 1.0.4.9 (arch: i686; UPnP 1.0; DLNADOC 1.50)
1918/tcp open upnp Platinum unpnd 1.0.4.9 (arch: i686; UPnP 1.0; DLNADOC 1.50)
3000/tcp open http LG smart TV http service
3001/tcp open ssl/http LG smart TV http service
9080/tcp open http Mongoose httpd
9998/tcp open http Google Chromecast httpd
18181/tcp open opsec-cvp?
36866/tcp open unknown
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port36866-TCP:V=7.80%I=7%D=3/10%Time=60494C8E%P=x86_64-pc-linux-gnu%r(G
SF:etRequest,52,"HTTP/1\.1\x20404\x20Not\x20Found\r\nDate:\x20Wed,\x2010\x
SF:20Mar\x202021\x2022:47:42\x20GMT\r\nConnection:\x20close\r\n\r\n")%r(Fo
SF:urOhFourRequest,52,"HTTP/1\.1\x20404\x20Not\x20Found\r\nDate:\x20Wed,\x
SF:2010\x20Mar\x202021\x2022:47:47\x20GMT\r\nConnection:\x20close\r\n\r\n"
SF:);
MAC Address: 04:4E:AF:66:85:7E (LG Innotek)
Service Info: OS: Linux; Device: media device; CPE: cpe:/h:lg:uj634v, cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 115.13 seconds

I'm not sure on how to debug from here. Any guidance on how to proceed would be appreciated.

Cross posted to launchpad.

hensm commented 3 years ago

Are you sure your TV supports Chromecast? I wasn't aware LG made TVs with built-in Chromecast support, and there doesn't appear to be a Chromecast service running. The "Google Chromecast httpd" entry is a little weird, though.

This is the output from one of my Chromecast devices:

> nmap -sV -p 1-65535 192.168.1.227
Starting Nmap 7.91 ( https://nmap.org ) at 2021-03-11 00:38 GMT Standard Time
Nmap scan report for Chromecast.router.local (192.168.1.227)
Host is up (0.011s latency).
Not shown: 65528 closed ports
PORT      STATE SERVICE          VERSION
8008/tcp  open  http?
8009/tcp  open  ssl/ajp13?
8012/tcp  open  unknown
8443/tcp  open  ssl/https-alt?
9000/tcp  open  ssl/cslistener?
10001/tcp open  ssl/scp-config?
10101/tcp open  ssl/ezmeeting-2?
MAC Address: 14:C1:4E:5C:DB:73 (Google)

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 156.52 seconds

You could try testing service discovery from macOS to compare:

> dns-sd -B _googlecast._tcp
Browsing for _googlecast._tcp
Timestamp     A/R Flags if Domain                    Service Type              Instance Name
 0:42:10.287  Add     2 10 local.                    _googlecast._tcp.         Chromecast-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
vitorpy commented 3 years ago

Am I sure? No. I assumed it did because I can stream to it from the YouTube app:

image

Or from Chrome on MacOS.

Maybe it's just DLNA and Chrome/YouTube can cast do a DLNA device as well? I'll check the MacOS output in the morning.

vitorpy commented 3 years ago

By the way, it also works from Chrome on the same machine (w/ Ubuntu):

image

I'll dig a bit and see if the device is only discoverable through UPnP. If it is, I'll see if I can try to extend your code to look for UPnP devices as well.

hensm commented 3 years ago

Oh yeah, that's a DIAL app. Chrome/YouTube supports that, but I haven't really looked at implementing it yet.