Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find my Chromecast #26

Closed
martin-langhoff opened this issue Nov 22, 2014 · 32 comments
Closed

Cannot find my Chromecast #26

martin-langhoff opened this issue Nov 22, 2014 · 32 comments

Comments

@martin-langhoff
Copy link

On Fedora 20, fully up to date. It installs correctly. It stalls forever "scanning". Passing --device 'the right name' did not help. Neither --verbose nor --debug flags shed any light.

Chrome web browser with the chrome cast extension finds the Chromecast immediately and can cast a tab without problem.

The machine has a single network interface active. Passing --myip did not help either.

The machine has a physical network (1Gbps) to the AP where the Chromecast is associated. Other machines also connect the Chromecast over the same network without problem.

What can I do to help debug this? I'm a fairly competent programmer, but not familiar with the node.js stack in the least.

thanks!

~martin

@xat
Copy link
Owner

xat commented Nov 22, 2014

Can you at first checkout if it works with turned out firewall?

@martin-langhoff
Copy link
Author

Ah, good point! Stopping firewalld allowed to find the chrome cast device. Here is some info on firewalld https://fedoraproject.org/wiki/FirewallD

As to what could be improved in castnow short term, I could say:

  • it did not time out scanning, fixing up the timeout is a good idea :-)
  • when it times out, it could suggest disabling the fw

thanks!

@martin-langhoff
Copy link
Author

This doc is more useful I think. What ports will castnow use?
http://docs.fedoraproject.org/en-US/Fedora/19/html/Security_Guide/sec-Open_Ports_in_the_firewall-CLI.html

@bblinder
Copy link

Turning off my firewall definitely did it. Which ports is castnow looking for?

@xat
Copy link
Owner

xat commented Nov 23, 2014

Hey guys, update castnow to v0.4.3 and checkout the just created wiki: https://github.com/xat/castnow/wiki

xat added a commit that referenced this issue Nov 23, 2014
@xat
Copy link
Owner

xat commented Nov 23, 2014

I fixed the timeout problem. So it now times out again after 10 seconds with a "device not found" message. I'll not change the error message to something firewall specific since the timeout could also happen because of other reasons (like there is no chromecast stick present for example).

@xat xat closed this as completed Nov 23, 2014
@sticilface
Copy link

I have this problem running castnow in a jail on freenas.

The scanning goes for 10seconds and then stops.
I do not have a firewall on the jail.
I can ping the chrome cast easily.

@xat
Copy link
Owner

xat commented Dec 3, 2014

Did you also check that the UDP Traffic generated by the MDNS scan isn't blocked in some way?

@sticilface
Copy link

Thanks for the reply.

How would I go about testing that?

This is a straightforward jail, running on freenas. raw sockets are enabled, and nmap works just fine so it should be able to scan?

There is no firewall or any packages like that installed, and nothing else is blocking. Is there a way for me test this that I'm not familiar with.

here is the output from nap

root@test:/ # nmap -PU -O 192.168.1.102

Starting Nmap 6.47 ( http://nmap.org ) at 2014-12-03 14:11 GMT
Nmap scan report for 192.168.1.102
Host is up (0.0095s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
79/tcp filtered finger
8008/tcp open http
8009/tcp open ajp13
MAC Address: 6C:AD:F8:81:87:AF (Azurewave Technologies)
Device type: general purpose
Running: Linux 2.6.X|3.X
OS CPE: cpe:/o:linux:linux_kernel:2.6 cpe:/o:linux:linux_kernel:3
OS details: Linux 2.6.32 - 3.10
Network Distance: 1 hop

@xat
Copy link
Owner

xat commented Dec 3, 2014

can you try running castnow with the option --address <chromecast ip> ?
This will bypass the MDNS scan.

@sticilface
Copy link

ah that works. It finds it.. but it doesn't play. Here is the debug output

root@test:/mnt/multimedia/01 TV/the wire/Series 1 # castnow --address 192.168.1.102 '[09] the.wire.s01e09.dvdrip.xvid-med.avi'
castnow launching... +0ms
castnow player status: loading plugins +4ms
castnow player status: scanning +0ms
castnow player status: connecting +1ms
castnow player status: launching +97ms
castnow player status: loading +1s
castnow player error: [Error: Load failed] +2s
Error: Load failed

@xat
Copy link
Owner

xat commented Dec 3, 2014

Nice TV Show taste :D

avi files will only work with the --tomp4 option which requires ffmpeg.

@sticilface
Copy link

I've tried that. still no joy. I have ffmpeg installed.. here is the output

ffmpeg version 2.3.5 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 26 2014 19:39:13 with gcc 4.2.1 (GCC) 20070831 patched [FreeBSD]
configuration: --disable-libaacplus --disable-indev=alsa --disable-outdev=alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libass --disable-libcdio --disable-libcelt --disable-libfaac --disable-libfdk-aac --enable-ffserver --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-gnutls --disable-libgsm --enable-iconv --disable-indev=jack --disable-libmp3lame --disable-libbluray --disable-libv4l2 --disable-indev=v4l2 --disable-outdev=v4l2 --disable-libmodplug --disable-openal --disable-indev=openal --enable-libopencv --disable-libopenjpeg --disable-openssl --disable-libopus --disable-libpulse --disable-indev=pulse --disable-outdev=pulse --disable-librtmp --enable-libschroedinger --disable-libspeex --enable-libtheora --disable-vaapi --disable-vdpau --enable-libvorbis --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libvpx --enable-libx264 --disable-libx265 --enable-libxvid --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --enable-shared --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-memalign-hack --disable-libstagefright-h264 --disable-libutvideo --disable-libsoxr --cc=cc --extra-cflags='-msse -I/usr/local/include/vorbis -I/usr/local/include' --extra-ldflags='-L/usr/local/lib ' --extra-libs=-pthread --disable-debug --disable-ffplay --disable-outdev=sdl
libavutil 52. 92.100 / 52. 92.100
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 48.100 / 55. 48.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.100 / 4. 11.100
libavresample 1. 3. 0 / 1. 3. 0
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Here is the output from castnow:

root@test:/home # castnow --address 192.168.1.102 '[13] the.wire.s01e13.dvdrip.xvid-med.avi' --tomp4
castnow launching... +0ms
castnow player status: loading plugins +4ms
castnow player status: scanning +1ms
castnow player status: connecting +0ms
castnow player status: launching +102ms
castnow player status: loading +1s
castnow player error: [Error: Load failed] +2s
Error: Load failed

@sticilface
Copy link

The wire is the best show I know.. maybe beaten by True Detectives though:)

@sticilface
Copy link

I downloaded an mp4 test file to check that it doesn't play either

castnow launching... +0ms
castnow player status: loading plugins +3ms
castnow player status: scanning +1ms
castnow player status: connecting +1ms
castnow player status: launching +136ms
castnow player status: loading +2s
castnow player error: [Error: Load failed] +2s
Error: Load failed

@sticilface
Copy link

and playing a youtube video WORKS. which is great.

Not sure why local files are not? but this is not really relevant to this ticket

@xat xat reopened this Dec 4, 2014
@xat
Copy link
Owner

xat commented Dec 4, 2014

We will figure out what the problem is :)

Can you clone the repo and run npm install inside the folder? So that you have a working copy in which we can modify the code and add some individual debug messages?

@sticilface
Copy link

done

On 4 Dec 2014, at 17:18, Simon Kusterer notifications@github.com wrote:

We will figure out what the problem is :)

Can you clone the repo and run npm install inside the folder? So that you have a working copy in which we can modify the code and add some individual debug messages?


Reply to this email directly or view it on GitHub #26 (comment).

@xat
Copy link
Owner

xat commented Dec 4, 2014

replace the content of plugins/localfile.js with the code in this gist: https://gist.github.com/xat/a24eac920c590eced912

afterwards show the debug messages that appear when you run DEBUG=castnow* ./index.js ./yourvideo.mp4

@xat
Copy link
Owner

xat commented Dec 4, 2014

I'm away for a few hours, will inspect the DEBUG messages you'll paste later

@sticilface
Copy link

not sure if i’ve done this correctly. Your DEBUG= never worked on my freebsd based system.

I had to run

setenv DEBUG castnow

which then is picked up and runs castnow in the debug setting.

if i interpreted things correctly I then run

root@test:~/castnow # ./index.js ~/small.mp4

/root/castnow/plugins/localfile.js:1
(function (exports, require, module, __filename, __dirname) {
^
SyntaxError: Unexpected token <
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/root/castnow/index.js:15:17)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

On 4 Dec 2014, at 17:30, Simon Kusterer notifications@github.com wrote:

I'm away for a few hours, will inspect the DEBUG messages you'll paste later


Reply to this email directly or view it on GitHub #26 (comment).

@xat
Copy link
Owner

xat commented Dec 4, 2014

I think you also copied HTML source.

try this:

wget https://gist.githubusercontent.com/xat/a24eac920c590eced912/raw/eb470af3bec24b2acba14ab393094505350dcf84/localfile.js

@sticilface
Copy link

seamed to happen with that link too, so i resorted to good old cut and paste.

here is the output

root@test:~ # ./castnow/index.js --address 192.168.1.102 ./small.mp4
castnow launching... +0ms
castnow player status: loading plugins +4ms
castnow player status: scanning +0ms
castnow player status: connecting +1ms
castnow player status: launching +99ms
castnow player status: loading +1s
castnow player error: [Error: Load failed] +2s
Error: Load failed

On 4 Dec 2014, at 21:09, Simon Kusterer notifications@github.com wrote:

I think you also copied HTML source.

try this:

wget https://gist.githubusercontent.com/xat/a24eac920c590eced912/raw/eb470af3bec24b2acba14ab393094505350dcf84/localfile.js

Reply to this email directly or view it on GitHub #26 (comment).

@xat
Copy link
Owner

xat commented Dec 5, 2014

Oh, just noticed, the DEBUG env must be set to castnow* not just castnow. Otherwise debug messages of the plugins won't be displayed.

@sticilface
Copy link

ah, i tried to set that a few times but needed to enclose it in ‘ ‘

here you go

root@test:~ # ./castnow/index.js --address 192.168.1.102 ./small.mp4
castnow launching... +0ms
castnow:localfile fs.existsSync ./small.mp4 +1ms true
castnow:localfile fs.statSync +0ms true
castnow:localfile contains files +0ms true
castnow:localfile fs.existsSync ./small.mp4 +0ms true
castnow:localfile fs.statSync +0ms true
castnow:localfile fs.existsSync ./small.mp4 +1ms true
castnow:localfile fs.statSync +0ms true
castnow:localfile started webserver on address 127.0.0.1 using port 4100 +1ms
castnow player status: loading plugins +1ms
castnow player status: scanning +0ms
castnow player status: connecting +1ms
castnow player status: launching +203ms
castnow player status: loading +1s
castnow player error: [Error: Load failed] +2s
Error: Load failed

On 5 Dec 2014, at 08:55, Simon Kusterer notifications@github.com wrote:

Oh, just noticed, the DEBUG env must be set to castnow* not just castnow. Otherwise debug messages of the plugins won't be displayed.


Reply to this email directly or view it on GitHub #26 (comment).

@xat
Copy link
Owner

xat commented Dec 5, 2014

can you try:

./castnow/index.js --myip <yourip>  --address 192.168.1.102 ./small.mp4

@sticilface
Copy link

problem solved:
so there is something funny with the IP situation as I have to specify both IPs. interesting.

root@test:~ # ./castnow/index.js --myip 192.168.1.24 --address 192.168.1.102 ./small.mp4
castnow launching... +0ms
castnow:localfile fs.existsSync ./small.mp4 +1ms true
castnow:localfile fs.statSync +1ms true
castnow:localfile contains files +0ms true
castnow:localfile fs.existsSync ./small.mp4 +0ms true
castnow:localfile fs.statSync +0ms true
castnow:localfile fs.existsSync ./small.mp4 +0ms true
castnow:localfile fs.statSync +0ms true
castnow:localfile started webserver on address 192.168.1.24 using port 4100 +2ms
castnow player status: loading plugins +0ms
castnow player status: scanning +1ms
castnow player status: connecting +1ms
castnow player status: launching +98ms
castnow player status: loading +1s
castnow:localfile incoming request serving ./small.mp4 +203ms
castnow player status: ready +738ms
castnow player status: paused +120ms
castnow player status: playing +4s
castnow player status: idle +5s

On 5 Dec 2014, at 10:44, Simon Kusterer notifications@github.com wrote:

./castnow/index.js --myip --address 192.168.1.102 ./small.mp4

@xat
Copy link
Owner

xat commented Dec 5, 2014

castnow tries to figure out your main IP. In most cases it figures out the correct IP, but not in all cases.

@xat xat closed this as completed Dec 5, 2014
@sticilface
Copy link

Thanks for your help.

Now the multi million dollar question, do you think there is anyway of integrating this into plex! i posted on a forum, but got told no way. But to have this on a plex server page, would mean that I didn’t have to keep using chrome to bloody play stuff. Which I hate!

On 5 Dec 2014, at 11:21, Simon Kusterer notifications@github.com wrote:

castnow tries to figure out your main IP. In most cases it figures out the correct IP, but not in all cases.


Reply to this email directly or view it on GitHub #26 (comment).

@xat
Copy link
Owner

xat commented Dec 5, 2014

Hmm, I never used Plex, so I can't tell :)

@pglomski
Copy link

Is it possible to document the --address option in the --help output? It's quite useful and saves searching for a solution when mDNS is blocked.

@xat
Copy link
Owner

xat commented Dec 31, 2014

Yes, done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants