Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ProbCaboose
Visitor

Re: C# .NET External Control Library - Anyone interested?

Java
I have finished the Android Java port of Roku .NET, and have built a test app for Android, my fist EVER!, Yay Me.
Test App (Signed): http://adf.ly/1IQYj
RokuExternalControl JAR: http://adf.ly/1IQZE

After the Holidays, I will most likely continue developing the android app.

P.S. Any donations made at the SourceForge site would be much appreciated for the up and coming semester. 🙂

How to use the Android App:
0)***Connect to the same network as the roku you are trying to control, or have a way of connecting to it.***

1) Enter your Roku's IP Address. (This does NOT save, because this is my first android app ever, will fix later.)

2)Click load Images. This gets a list of installed apps on the roku and pulls the data and images from the device.

3)Clicking on the app images changes the selected app to launch when the launch button is pressed. The images loop.

4)You now have an Android Roku remote.

5 -> Optional) Donate!

Happy Holidays and Merry Christmas!
-John
"If I had a nickel for every time I was wrong, I'd be broke." Stephen Colbert
0 Kudos
ProbCaboose
Visitor

Re: C# .NET External Control Library - Anyone interested?

*Update*
Added SSDP Discovery to 'Roku .NET'.
Updated 'Roku Remote' to use new SSDP from 'Roku .NET'.
"If I had a nickel for every time I was wrong, I'd be broke." Stephen Colbert
0 Kudos
cola007
Visitor

Re: C# .NET and Java External Control Library

Downloaded the latest C# update and SSDP discovery doesn't seem to be working for me. Are there any logs that I can provide that would help out in figuring out why?
0 Kudos
ProbCaboose
Visitor

Re: C# .NET and Java External Control Library

"cola007" wrote:
Downloaded the latest C# update and SSDP discovery doesn't seem to be working for me. Are there any logs that I can provide that would help out in figuring out why?

Is your roku on WiFi?
Can you detect the roku using wireshark?
The only thing I can think of that would help would be if you could step through the Discover() process in debug mode using F11 and post what each Receive is giving. It should look something like these:
http/1.1 200 ok
cache-control: max-age=300
st: roku:ecp
usn: uuid:roku:ecp:############
ext:
server: roku upnp/1.0 miniupnpd/1.4
location: http://192.168.#.#:8060/

http/1.1 200 ok
cache-control: max-age=300
st: upnp:rootdevice
usn: uuid:########-####-####-####-############::upnp:rootdevice
ext:
server: roku upnp/1.0 miniupnpd/1.4
location: http://192.168.#.#:8060/


To do this:
1) Add a breakpoint, Right Click -> Breakpoint -> Insert Breakpoint, before Discover(); is called. In the sample I have provided it's around line 61 under 'IP Settings.cs'.



2) Then Debug -> Start Debugging.


3) Once the Remote starts up click the 'Settings' Button, unless it's the first time starting up and stops at the breakpoint.


4) Continue to press F11, Step Into, until you pass 443, 'string resp = Encoding.ASCII.GetString(buffer, 0, length).ToLower();'.

5) Hover your mouse over 'resp' and click on the little magnifying glass. This should open a 'Text Visualizer' window the the source of the 'resp' string.


6) Copy that into your Response to me, you can censor out your roku info for me as I just need what I posted.


7) Continue to do this until it times out.

Another thing to try would be to extend the send and receive timeouts found in the 'Roku .NET' source, lines 424 and 425. Right now there at 500ms each which handles fine on my wireless laptop to my wired roku. With this you would have to rebuild Roku .NET and use the new DLL when you rebuild the Remote.

Let me know if any of this helps.
You can PM me with a IM name if you need more help. Which I'm always happy to give.

EDIT: I've updated Roku .NET so you can define your own timeouts for the Discover() process, and the Roku Remote Example so you can choose a longer timeout when searching the network.
"If I had a nickel for every time I was wrong, I'd be broke." Stephen Colbert
0 Kudos
cola007
Visitor

Re: C# .NET and Java External Control Library

Thanks for the instructions, I'll let you know what I find when I get a chance (the Roku is currently in use by my better half).

As for your questions:
Yes, my device is using WiFi, wireless G.
I should be able to get a network capture, it might be a bit messy to filter since I've got a bunch of other WiFi devices, but I'll give it a go if adjusting the timeout doesn't help.
0 Kudos
ProbCaboose
Visitor

Re: C# .NET and Java External Control Library

"cola007" wrote:
Thanks for the instructions, I'll let you know what I find when I get a chance (the Roku is currently in use by my better half).

As for your questions:
Yes, my device is using WiFi, wireless G.
I should be able to get a network capture, it might be a bit messy to filter since I've got a bunch of other WiFi devices, but I'll give it a go if adjusting the timeout doesn't help.


WiFi might be your problem, I've read around this and other forums, where people have noticed SSDP does not work perfectly when the roku is connected to the network through WiFi, for what ever reason, a Roku employee might have more insight than I do. Extending the timeouts might give the roku more time to respond which might give you a better result. If you didn't see my edit on my previous post, I have updated 'Roku .NET' so you can define your own timeout or use a default of 500ms (Not sure if this is to fast of a timeout :? , if someone with more of a networking background knows let me know so I can lengthen the default timeout 🙂 ).

WiFi 'BUG' - Roku Forums
- In this post RokuKevin posted:
"RokuKevin" wrote:
The external control api 'WiFi Bug' is fixed in v2.8.

--Kevin

Not sure if this is the case for everyone. :?
"If I had a nickel for every time I was wrong, I'd be broke." Stephen Colbert
0 Kudos
cola007
Visitor

Re: C# .NET and Java External Control Library

Alright, I think I figured it out. 🙂

I've got Sun Virtual Box installed and because of that I've got a secondary virtual NIC enabled (192.168.56.0 subnet) as well as my normal wireless NIC (192.168.1.0). As soon as I disabled the Virtual Box NIC I was able to discover the Roku device on the network immediately using the default 500ms timeout.

Perhaps you could add a configuration option to select the network adapter(s) to send the discovery broadcast from?
0 Kudos
ProbCaboose
Visitor

Re: C# .NET and Java External Control Library

"cola007" wrote:
Alright, I think I figured it out. 🙂

I've got Sun Virtual Box installed and because of that I've got a secondary virtual NIC enabled (192.168.56.0 subnet) as well as my normal wireless NIC (192.168.1.0). As soon as I disabled the Virtual Box NIC I was able to discover the Roku device on the network immediately using the default 500ms timeout.

Perhaps you could add a configuration option to select the network adapter(s) to send the discovery broadcast from?

I'll add a NIC selection tonight. Thanks for letting me know that's what happened.
"If I had a nickel for every time I was wrong, I'd be broke." Stephen Colbert
0 Kudos
ProbCaboose
Visitor

Re: C# .NET and Java External Control Library

I've Updated 'Roku .NET' and updated the 'Sample Remote' to make use of it. Let me know if it works.
"If I had a nickel for every time I was wrong, I'd be broke." Stephen Colbert
0 Kudos
cola007
Visitor

Re: C# .NET and Java External Control Library

It's working pretty good now with the network selection. I can leave my virtual NIC enabled and still run a discover.

Thank you for adding the network selector! 😄

I do have one note, when I check the checkbox to specify the network adapter to use and then click refresh the drop down defaults to the original/incorrect network. The discover is performed on the network that was selected prior to clicking refresh and the device is properly discovered. If possible/not too difficult I would suggest having the drop down default to the last selected network.
0 Kudos