

Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2016
10:05 AM
Re: ECP (port 8060) not working
"EnTerr" wrote:"RokuKC" wrote:
https://sdkdocs.roku.com/display/sdkdoc ... PressTime()asVoid
That function was just added to docs 29 April but does not mention firmware version. What fw is it applicable to?
roAppManager UpdateLastKeyPressTime is present on all active (non-legacy) firmware versions.
ljunkie
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2016
11:56 AM
Re: ECP (port 8060) not working
"RokuKC" wrote:"ljunkie" wrote:
1. The roVideoPlayer/roVideoScreen used to reset the idle time every 10 seconds. This no longer happens in 7.1. Can this be corrected?
I can file a report, but it might help to have more information, as I haven't heard of this issue being reported by anyone else.
We use `roDeviceInfo.TimeSinceLastKeypress()` to fire off various events, and it caused a nasty bug when this wasn't reset during video playback. The probably for us is fixable on our side, now that you have mentioned we can reset this on all current gen devices with `roAppManager.UpdateLastKeyPressTime()`.
"RokuKC" wrote:"ljunkie" wrote:
2. Is there a valid way to tell the Roku it's not idle from within a channel. The ECP method was the only way, and as I take it will never work again going forward unless the Roku uses an RFC 1918 IP address. One example to clarify why this is important: A custom slide show written in an roScreen, or even roImageCanvas. Without a way to reset the idle time during playback, the Roku will initialize the the (black) screensaver rendering it useless.
We've documented a function in roAppManager which is UpdateLastKeyPressTime() that can be used to defer the screensaver activation.
Calling this should be preferred over the ECP fake keypress technique.
https://sdkdocs.roku.com/display/sdkdoc ... PressTime()asVoid
Thank you! That fixes our issue. Appreciate the info. I really am curious how many other undocumented features there? e.g. `roAppManager.GetScreensaverTimeout()`
rjdjohnston
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2016
05:01 PM
Re: ECP (port 8060) not working
Anyone have an example implementation of UpdateLastKeyPressTime()?
Thanks
Thanks
My channels: Amiri King, Donnie Baker, Worldview Weekend - Twitter @rjdjohnston
ljunkie
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2016
12:41 AM
Re: ECP (port 8060) not working
"rjdjohnston" wrote:
Anyone have an example implementation of UpdateLastKeyPressTime()?
Thanks
Here is a really basic example of it working, showing you that the Roku was idle for 71 seconds and was reset back to 0 by calling UpdateLastKeyPressTime().
BrightScript Debugger> am = CreateObject("roAppManager")
BrightScript Debugger> di = CreateObject("roDeviceInfo")
BrightScript Debugger> ?di.TimeSinceLastkeyPress()
71
BrightScript Debugger> am.UpdateLastKeyPressTime()
BrightScript Debugger> ?di.TimeSinceLastkeyPress()
0
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2016
11:40 AM
Re: ECP (port 8060) not working
@RokuKC -
there are 2 issues though, one with UpdateLastKeyPressTime() and one with disabling ECP when not on private IP:
It is because of DMZ that i made a very specific suggestion (#1) in viewtopic.php?f=34&t=88160 - and that is to use IP firewall rules to protect 8060 from connections from outside the local network mask - not selectively shutting down ECP server. And if so, ECP could always be relied to be accessible via loopback interface (localhost or 127.0.0.1).
I guess weighing the options here depends on the statistics of "indecently exposed" Rokus: what's the % with external IP (with no firewall!) vs % with internal IP (due to DMZ or port forwarding in firewall). I advocate that my approach will cover both cases, where Roku's covers only one of them (see recent Variety article based on leaks)
there are 2 issues though, one with UpdateLastKeyPressTime() and one with disabling ECP when not on private IP:
- How is a non-BrightScript (say Marmalade) app to delay screensaver, given that - well, it has no access to UpdateLastKeyPressTime()? I thought i "invented" a way by defining a private SS in B/S - but that is a no-go because "black screen" is invoked instead of SS for such apps. Using ECP to tickle the player seems like the only workaround.
- Shutting down ECP server when non-private IP - it does "jack squat" for DMZ Rokus. If a Roku is behind a NAT and the owner has placed it in router's DMZ (in attempt to improve streaming - which i bet is the prevailing majority of this case) - then said Roku will have IP=192.168.x.x and yet ECP will still be exposed to the Internet at large.
It is because of DMZ that i made a very specific suggestion (#1) in viewtopic.php?f=34&t=88160 - and that is to use IP firewall rules to protect 8060 from connections from outside the local network mask - not selectively shutting down ECP server. And if so, ECP could always be relied to be accessible via loopback interface (localhost or 127.0.0.1).
I guess weighing the options here depends on the statistics of "indecently exposed" Rokus: what's the % with external IP (with no firewall!) vs % with internal IP (due to DMZ or port forwarding in firewall). I advocate that my approach will cover both cases, where Roku's covers only one of them (see recent Variety article based on leaks)


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2016
09:45 AM
Re: ECP (port 8060) not working
"EnTerr" wrote:
- How is a non-BrightScript (say Marmalade) app to delay screensaver, given that - well, it has no access to UpdateLastKeyPressTime()?
I haven't tried it myself, but it appears to me that roAppManager UpdateLastKeyPressTime() should be callable by NDK apps. Does Marmalade not allow full access?
"EnTerr" wrote:
[list=B:1v4ol5wd]Shutting down ECP server when non-private IP - it does "jack squat" for DMZ Rokus.
ECP rejects requests from non-private request IPs... does that not apply in this situation, even if the Roku itself has a private IP?
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2016
01:53 PM
Re: ECP (port 8060) not working
"RokuKC" wrote:
I haven't tried it myself, but it appears to me that roAppManager UpdateLastKeyPressTime() should be callable by NDK apps. Does Marmalade not allow full access?
Not that i know of - http://docs.madewithmarmalade.com/displ ... ctionality says "No" for Roku platform on "Extension Development Kit (EDK)" and "Native toolchain access". And the NDK i have laid my eyes on was something truly vintage - circa 2012-2013. That won't cover these new-fangled features, would it?
"RokuKC" wrote:
"EnTerr" wrote:ECP rejects requests from non-private request IPs... does that not apply in this situation, even if the Roku itself has a private IP?
[list=B:33oryyvz]Shutting down ECP server when non-private IP - it does "jack squat" for DMZ Rokus.
Hmmm, if by source IP - it "shoulda" blocked :?:. But if that were indeed the case for years, how come certain someone is able through scanning to identify and interrogate thousands of Roku's on the Net? Current data apparently.


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2016
02:07 PM
Re: ECP (port 8060) not working
"EnTerr" wrote:
Not that i know of - http://docs.madewithmarmalade.com/displ ... ctionality says "No" for Roku platform on "Extension Development Kit (EDK)" and "Native toolchain access". And the NDK i have laid my eyes on was something truly vintage - circa 2012-2013. That won't cover these new-fangled features, would it?
That sounds like something to ask the Marmalade support about. I don't have any visibility into that.
"EnTerr" wrote:
Hmmm, if by source IP - it "shoulda" blocked :?:. But if that were indeed the case for years, how come certain someone is able through scanning to identify and interrogate thousands of Roku's on the Net? Current data apparently.
I don't see much there. Without researching it specifically, I would guess those are legacy devices.
Luchin
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023
03:57 PM
Re: ECP (port 8060) not working
Hi everyone,
Since update to OS 12.0, the ECP commands are not working within the dev app (in-app testing). Response code is now 403 whereas in OS 11.5 and before it was always 200.
'cmd = [ECP command]
'RokuIP = [local IP of Roku device, RFC1918 address]
request = CreateObject("roUrlTransfer")
m.port = createObject("roMessagePort")
request.setMessagePort(m.port)
urlString = "http://" + RokuIP + ":8060/" + cmd
request.SetUrl(urlString)
if request.AsyncGetToString() then
'if request.AsyncPostFromString("") then
msg = m.port.waitMessage(0)
print msg.GetResponseCode()
end if
If instead an ECP command is sent from a local pc, the same Roku device on OS 12.0 executes it and the response code is 200. So definitely this new blocking is affecting the dev app.
>~ curl -w "%{http_code}" -d '' "http://"$RokuIP":8060/"$cmd
200
ramoneariel
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023
11:34 AM
Re: ECP (port 8060) not working
I have the same problem trying to restart my app so that it takes some configuration changes.