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).

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

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

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)

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.

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.

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

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

This is happening to me suddenly starting today.

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.

A simple curl example:

curl -v -d '' "http://your-ip:8060/keypress/home"

Output

*   Trying n.n.n.n:8060...
* Connected to n.n.n.n (n.n.n.n) port 8060
> POST /keypress/home HTTP/1.1
> Host: n.n.n.n:8060
> User-Agent: curl/8.4.0
> Accept: */*
> Content-Length: 2
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 401 Unauthorized
< Server: Roku/12.5.5 UPnP/1.0 Roku/12.5.5
< Content-Length: 0
<
* Connection #0 to host n.n.n.n left intact

Same problem here.  any post commands respond with 401 unauthorized.  Same experience where it worked just find until March 27th.

I rely on this functionality and the ability to control via API is essential to me and one of the reasons why i purchased this product.

Here are the system details in case it helps

redacted
redacted
redacted
redacted
TCL
65S4
7134X
US
true
false
65
35
true
1080p
ATSC
true
redacted
realtek
true
redacted
ethernet
Great Room TV
TCL•Roku TV
TCL•Roku TV - YN00T5984076
Great Room TV
Great Room
30D.55E04174A
12.5.5
4174
xxD.50E04182A
30D.55E04174A
12.5.5
4174
true
en
US
en_US
false
US/Eastern
United States/Eastern
America/New_York
-240
12-hour
3005
PowerOn
true
false
true
true
false
false

true
true
true
true
true
true
false
false
1.0
true
true
true
true
true
false
TCL Support
11.1.25
true
3.0
9.3.10
3.0

Is it possible the certificate expired on the server on the Roku?

I have the same problem but it is only on one of my rokus, a roku tv that I have set up for my mom with dementia. All of the launch+deep_links work but 401 on the normal keypress commands.

curl -d ‘’ --write-out “%{http_code}\n” -X POST http://n.n.n.n:8060/launch/tvinput.dtv?ch=632
200

curl -d ‘’ --write-out “%{http_code}\n” -X POST http://n.n.n.n:8060/keypress/VolumeUp
401

Model 65R6ASR

Software Version 12.5.0 Build 5101

Just FYI, we have had reports of our customers having a similar issue with their Roku players using our driver that issues ECP commands.

Our tech support has found that issuing a factory reset of the player seems to fix the issue.

Something you all could try.

12 different sites that we reset yesterday, yes on Easter, have all now succumbed to this issue. Waste your time if you must, but the reset devices only work ~24 hours from our experience. Thats a lot of typing in passwords for only a day of proper operation.

Forgot to mention we also recommend disabling automatic updates after factory reset. Don’t know if that is why it’s reoccurring…

Turning off auto-updates isn’t something supported by the existing menu structure on a Roku Ultra. I can get into the secret menus obviously but dont see it in there either. If someone has a approved way to accomplish this and it fixes the issue I am all ears to prevent mass customer removal of Rokus.

Wonder if this is related to an issue I’m facing with 3rd party hub remote

https://community.roku.com/t5/Remotes/Sofabaton-X1-with-Stick-and-Poor-Support-from-Roku/m-p/958861#M48191

Timelines seem to match, but I also got no support there.

They likely use the API that stopped working. Can you launch Disney+, Hulu or other channels, but not navigate?