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: 

Determining mac address and connection type (wired/wireless)

I've found GetDeviceEsn(), but I'm hoping I to get some more information out of my app. I'd like to pull out connection type (wired vs wireless), and also the mac address of the ethernet port. Is there any corollation between the Esn and the MAC Address? Another vendor I dealt with tied their serial numbers to the mac address like so: mac_address = hex(serial_number * 2). Is there any way I can determine the ethernet mac address inside my app?
0 Kudos
8 REPLIES 8
TheEndless
Channel Surfer

Re: Determining mac address and connection type (wired/wirel

You can get the connection type via roDeviceInfo.GetIPAddrs(). If eth0 has an IP address, it's wired. If eth1 has an IP address, it's wireless. I don't know of any way to get the MAC address.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos

Re: Determining mac address and connection type (wired/wirel

I can't believe I'm the only one whose ever wanted to get the mac address! Why isn't there a way to grab it?
0 Kudos
RokuMarkn
Visitor

Re: Determining mac address and connection type (wired/wirel

What do you want to use the MAC address for?

--Mark
0 Kudos

Re: Determining mac address and connection type (wired/wirel

Mac addresses are guaranteed to be globally unique. All the rest of our infrastructure is based on MAC addresses: STBs, Modems, Routers, etc. Roku will be the exception. Now I have to have different code to handle Roku than my existing code.

Ultimately I want to use it for STB authentication.
0 Kudos
RokuMarkn
Visitor

Re: Determining mac address and connection type (wired/wirel

The DeviceUniqueId is also globally unique, actually with more guarantee of uniqueness than MAC addresses.

--Mark
0 Kudos
RokuMarkn
Visitor

Re: Determining mac address and connection type (wired/wirel

However, I should add, neither the MAC nor the DeviceUniqueId should be used to associate the device with an account, if that's what you meant by STB authentication. The SDK warns against this, so that a factory reset is guaranteed to remove any association between the device and any accounts. See section 4.2 of the Developer Guide.


It is important not to keep any permanent device association stored on your server. Roku wants to give users the ability to do a "Factory Reset" and have any personally identifiable information wiped from the device. This includes removing any association with server side accounts.
0 Kudos
scyber
Visitor

Re: Determining mac address and connection type (wired/wirel

I'd also point out that MAC addresses aren't guaranteed to be unique b/c it is very easy to change the mac address of an ethernet adaptor on a variety of platforms (not the Roku, but almost any platform with root access). Using mac address for authentication seems like a risky proposition.
0 Kudos
Anonymous
Visitor

Re: Determining mac address and connection type (wired/wirel

"RokuMarkn" wrote:
However, I should add, neither the MAC nor the DeviceUniqueId should be used to associate the device with an account, if that's what you meant by STB authentication. The SDK warns against this, so that a factory reset is guaranteed to remove any association between the device and any accounts. See section 4.2 of the Developer Guide.


It is important not to keep any permanent device association stored on your server. Roku wants to give users the ability to do a "Factory Reset" and have any personally identifiable information wiped from the device. This includes removing any association with server side accounts.



Indeed. The service should be generating a unique token for each Roku client. The Roku can then pass that token whenever authentication is needed (perhaps even on every API call). Should the subscription expire to the client otherwise need to be disconnected, just invalidate the token. With this, when the user removed the channel or resets their Roku, they will need to relink the Roku player to their account with the service, which is the desired behavior.
0 Kudos