Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Roku Employee
Roku Employee

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.
0 Kudos
Highlighted
Level 7

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()`
0 Kudos
Highlighted
Level 7

Re: ECP (port 8060) not working

Anyone have an example implementation of UpdateLastKeyPressTime()?

Thanks
My channels: Amiri King, Donnie Baker, Worldview Weekend - Twitter @rjdjohnston
0 Kudos
Highlighted
Level 7

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
0 Kudos
Highlighted
Level 9

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:

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

  2. 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)
0 Kudos
Highlighted
Roku Employee
Roku Employee

Re: ECP (port 8060) not working

"EnTerr" wrote:

  1. 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?
    0 Kudos
    Highlighted
    Level 9

    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:

    [list=B:33oryyvz]
  • 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?

    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.
    0 Kudos
    Highlighted
    Roku Employee
    Roku Employee

    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.
    0 Kudos