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: 
skajake
Visitor

ECP Flaky?

Hey folks,

Is the Roku ECP protocol flaky or am I just doing something wrong? Half the time my commands are never processed by the Roku. This leads to key presses on my remote doing nothing and other times my keyup command is never received the Roku to scroll forever. The keyboard functionality is horrendous, over half the keys are never processed by the roku. I get no indication that the commands were not processed, there are no exceptions being thrown.

My code looks something like this, any thoughts? the message string is obviously altered for the specific command that i am trying to invoke.


try {
String message = "POST /keydown/" + keyCode + " HTTP/1.1\r\n\r\n";
Socket socket = new Socket(activeIP, 8060);
DataOutputStream dataout = new DataOutputStream(socket.getOutputStream());
dataout.flush();

byte bdata[] = message.getBytes();

dataout.write(bdata, 0, bdata.length);

dataout.flush();
} catch (IOException e) {
Log.e(tag, "Failed to send command", e);
} catch (Exception e) {
Log.e(tag, "Failed to send command", e);
}


Thanks!
0 Kudos
1 REPLY 1
EnTerr
Roku Guru

Re: ECP Flaky?

You are probably shoving in commands too fast. Yes, overflows get dropped silently. Try using /keyPress; put some delay between sending /keydown and /keyup
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.