StartAutomating / PowRoku

Script your Roku with PowerShell
MIT License
4 stars 0 forks source link

Find-Roku doesn't appear to locate my device. #4

Open dotnvo opened 2 years ago

dotnvo commented 2 years ago

Hey there!

I really enjoyed your summit talks and your work on some of the IOT stuff was really neat.

I Installed PowRoku and attempted to find my Roku TV ( a TCL 55S435, running Roku TV G103X). The Find-Roku function doesn't seem to locate my roku device. The host i'm running from is on the the same subnet.

I did manually pull my IP address, and it seems like the other commands work, such as: Stop-Roku -IPAddress $IPAddress

Also, not sure if helpful at all, but I was able to find it using UPNP, which I believe uses SSDP:

$UPNPFinder.FindByType('upnp:rootdevice', 0) | Where-Object {$_.ManufacturerName -like '*TCL*'}

I'm not familiar with SSDP or C# really but happy to provide any details I can.

StartAutomating commented 2 years ago

@dotnvo Thanks for reporting this, and reminding me that $UPNPFinder exists (you created that with New-Object -ComObject, right?)

Are you running on PowerShell Core or Windows PowerShell? I have noticed that results are not returned on Core on Windows.

I've also noticed that on Linux, Find-Roku fails with its own unique error.

I will likely change the underlying code of this function soon (as well as other SSDP related functions).

Can you confirm that your problem only reproduces on PowerShell Core, or are you having issues with Find-Roku on Windows PowerShell as well?

dotnvo commented 2 years ago

Correct on both accounts.

$UPNPFinder = New-Object -ComObject 'UPnP.UPnPDeviceFinder'
$upnpfinder.FindByType('upnp:rootdevice', 0) | Where-Object {$_.ManufacturerName -like '*TCL*'}

I just tested Windows PowerShell and I did successfully find devices via Find Roku