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

Roku TV is not discovered with SSDP #17

Closed
Glavin001 opened this issue Oct 7, 2017 · 9 comments
Closed

Roku TV is not discovered with SSDP #17

Glavin001 opened this issue Oct 7, 2017 · 9 comments

Comments

@Glavin001
Copy link
Contributor

Glavin001 commented Oct 7, 2017

Running the following always times out

const Nodeku = require('nodeku')

console.log('Looking for devices...');
Nodeku()
  .then(device => {
    console.log(`Device found at: ${ device.ip() }`)
    // 'xxx.xxx.xxx.xxx:8060'
    return device.apps()
  })
  .then(apps => {
    apps.forEach(app => console.log(app))
    // [{ id, name, type, version }, ...]
  })
  .catch(err => {
    console.error(err.stack)
  })

Logs

Error: Could not find any Roku devices. Time spent: 10 seconds

Info

Roku TV
Roku version: 7.7.0

Related to #7

@sgnl
Copy link
Owner

sgnl commented Oct 8, 2017

Are you able to successfully ping your device from your computer (by getting it's IP from the device menus and using port 8060)?

@Glavin001
Copy link
Contributor Author

Ping works:

❯ ping 192.168.1.28
PING 192.168.1.28 (192.168.1.28): 56 data bytes
64 bytes from 192.168.1.28: icmp_seq=0 ttl=64 time=1.960 ms
64 bytes from 192.168.1.28: icmp_seq=1 ttl=64 time=1.923 ms
64 bytes from 192.168.1.28: icmp_seq=2 ttl=64 time=1.735 ms
^C
--- 192.168.1.28 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.735/1.873/1.960/0.099 ms

And if I create a device manually -- without using SSDP discovery -- using my Roku's IP -- 192.168.1.28 -- I am able to send commands and it works.

@Glavin001 Glavin001 changed the title Roku is not discovered with SSDP Roku TV is not discovered with SSDP Oct 9, 2017
@sgnl
Copy link
Owner

sgnl commented Oct 9, 2017

I wonder there should be a feature to set the IP manually for cases like this.

regardless, I would love to be able to investigate the issue further. LMK if you come up with any more information or a solution @Glavin001.

Thanks for the report

@Glavin001
Copy link
Contributor Author

I wonder there should be a feature to set the IP manually for cases like this.

I think the Device should definitely be exposed. If it is not already done by next weekend maybe you'll see a Pull Request coming your way 😉.


I've been trying to get SSDP to detect my Roku for a few days without success. At this point, I am giving up on SSDP and assuming the IP will need to be manually configured.

I had hoped I was missing something obvious about enabling SSDP support on Roku, however I did not find any articles to support this.

@sgnl
Copy link
Owner

sgnl commented Oct 10, 2017

SSDP should be enabled by default. I've read that it could be a router setting, I was reading the thread this morning...

https://forums.roku.com/viewtopic.php?t=60236

You could use network diagnostic tools with Wire Shark to further debug but if it's quicker to expose the Device and get you up and running faster, that should be the route to take.

Thanks for the help, a PR would be 👌

@barnabycourt
Copy link
Contributor

barnabycourt commented Nov 5, 2017

@sgnl Do you have any guidelines for how you would like Device exposed directly? I can put together a PR but would rather not invest time in a method you are not interested in pursuing.

@barnabycourt
Copy link
Contributor

@sgnl specifically, would you consider breaking apart the module to export two functions Discover and Device as well as keys? This would unfortunately be a backwards-incompatible change as the module export is no longer directly a method that can be used to initiate discovery.

This would change the discovery to
var nodeku = require('nodeku');
nodeku.discover().then.(...);

Creating a new device by IP address would be:
let device = nodeku.Device('192.18.1.50');
device.keypress(nodeku.keys.HOME);

@sgnl
Copy link
Owner

sgnl commented Apr 25, 2018

@barnabycourt @Glavin001

See the mentioned PR. Hopefully it's useful!

very "beta" because I haven't written any tests for it nor actually tested against my Roku device. With that caveat... SHOULD WORK 🐸

const Nodeku = require('nodeku');

const device = Nodeku.Device('127.0.0.1')
device.ip();

// or …
Nodeku.Discovery(timeoutNumberValueHere).then(device => device.ip())

// still valid cause it's essentially `.Discover()`
Nodeku().then(device => device.ip())

@sgnl
Copy link
Owner

sgnl commented Apr 25, 2018

Just realized I didn't expose the "keys", I will have an update for that asap

@sgnl sgnl closed this as completed Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants