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: 
erinmausfd
Newbie

Roku /keypress ECP command returning HTTP status code 401

Hi,

I'm having a weird issue where one of the Roku Ultra devices I have is returning a 401 status code when trying to perform any keypress/keydown/keyup ECP commands. Any other ECP commands I tested, like the device info and apps queries, seem to work just fine. The device is on the same subnet as all other devices where these ECP commands work and the machine that is sending the ECP commands is also on the same subnet.

This is the command:

curl -d '' -w "%{http_code}" '192.168.241.45:8060/keypress/home'

CURL returns a 401 with an empty body. Using "Home" or "home" does not matter. The device is up to date and does not return an error when accessing it via HTTP with developer mode enabled (like it would it it were out of date / could not check for updates).

51 REPLIES 51
JohnnyIV
Channel Surfer

Re: Roku /keypress ECP command returning HTTP status code 401

This started happening to me too today. Get commands work like query/apps, but Post commands are returning 401.

0 Kudos
JohnnyIV
Channel Surfer

Re: Roku /keypress ECP command returning HTTP status code 401

I'll add that this has been working perfectly for over 3 years until today.

0 Kudos
Profezzorn
Reel Rookie

Re: Roku /keypress ECP command returning HTTP status code 401

I too have this problem. It was working fine for a very long time, and then stopped.

Other SDK commands like going to a particular channel still work.

(Roku Ultra)

 

Profezzorn
Reel Rookie

Re: Roku /keypress ECP command returning HTTP status code 401

Seems like the Roku app is still able to send button presses to the roku.

It seems to be using a different protocol, but on the same port.

 

0 Kudos
JRod85
Reel Rookie

Re: Roku /keypress ECP command returning HTTP status code 401

This started happening to me a couple of days ago on TCL Roku TV. I reset and it worked again for a day and started happening again yesterday. Hope there is a fix for this. 

0 Kudos
RokuNicole-S
Community Moderator
Community Moderator

Re: Roku /keypress ECP command returning HTTP status code 401

I've sent you each messages to collect some info about this issue, please check your DMs. Thank you!

tonyli7
Newbie

Re: Roku /keypress ECP command returning HTTP status code 401

Hi. I've been having issues as well. It started on March 27th. Any next steps?

cyborg_helpplea
Binge Watcher

Re: Roku /keypress ECP command returning HTTP status code 401

This is happening to me suddenly starting today.

cyborg_helpplea
Binge Watcher

Re: Roku /keypress ECP command returning HTTP status code 401

 
Repro (use your own IP and port number):

    const response = fetch("http://192.168.x.x:port_number/keypress/home", {
        method: "POST"
    }).then(response => {
        console.log("Response code:", response.status);
        if (!response.ok) {
            throw new Error('Network response was not ok');
          }
         
        console.log("Response code:", response.status);
        return response.text();
    }).then(data => {
        if (data) {
            return JSON.parse(data);
          } else {
            console.log('No data to parse');
          }
    }).catch(error => { console.error('Error:', error); }); 
        console.log("Roku Home button pressed");
        return response;
 
Output:
Roku Home button pressed
roku.js:21
Response code: 401
roku.js:6
Error: Error: Network response was not ok
 
 
I was able to reproduce the same with curl, and it affected all computers in my environment on the same day today.