Results 1 to 6 of 6
  1.    #1  
    I want to get MAC address of My WEBOS smart-tv pragmatically to pass that address on API request but i cant find how to do it . please help ....
  2. #2  
    The short answer is: you can't. Sharing MAC addresses is generally considered a security risk; and is (therefore (and for other reasons)) not available from within Javascript.
    The longer answer is: you could write a NodeJS service that might be able to call a native executable like ifconfig (if calling native executables from the App's jail is allowed on the WebOS TV's...which I doubt), then read its output and interpret it accordingly. There are a lot of if's for this solution; and I doubt it's viable. But it's basically the only semi-realistic thing you could try in my opinion.

    To be honest, I would stick to the short answer...if only because I don't trust API's that require MAC addresses.
    If you really do need the MAC address I think users should enter it manually; if only to make sure they opt-in in sharing this information with a third-party.


    Ps. I'm not addressing PHP solutions where you make a call to a server, because that can only (theoretically) work if said server is on the same local network as the TV...so that would not be a viable solution either is just about every case.
    Pps. I am curious which API you're using that requires a MAC address.
  3. #3  
    Quote Originally Posted by Misj' View Post
    The short answer is: you can't. Sharing MAC addresses is generally considered a security risk; and is (therefore (and for other reasons)) not available from within Javascript.
    The longer answer is: you could write a NodeJS service that might be able to call a native executable like ifconfig (if calling native executables from the App's jail is allowed on the WebOS TV's...which I doubt), then read its output and interpret it accordingly. There are a lot of if's for this solution; and I doubt it's viable. But it's basically the only semi-realistic thing you could try in my opinion.

    To be honest, I would stick to the short answer...if only because I don't trust API's that require MAC addresses.
    If you really do need the MAC address I think users should enter it manually; if only to make sure they opt-in in sharing this information with a third-party.


    Ps. I'm not addressing PHP solutions where you make a call to a server, because that can only (theoretically) work if said server is on the same local network as the TV...so that would not be a viable solution either is just about every case.
    Pps. I am curious which API you're using that requires a MAC address.
    I tend to disagree here

    It seems that webos-connman-adapter can give you the MAC address. At least in LuneOS/webOS OSE it does

    Code:
    luna-send -n 1 luna://com.palm.connectionmanager/getinfo '{}'
    gives
    Code:
    {"wiredInfo":{"macAddress":"08:00:27:D0:55:22"},"returnValue":true}
    At least that's on LuneOS VirtualBox emulator. On webOS OSE/webOS TV you might need to do:
    Code:
    luna://com.webos.connectionmanager/getinfo '{}'
    as per https://github.com/webosose/webos-co...ervice.c#L1831
    HP Veer (daily driver), HP Pre 3, HP Touchpad Proper 4G/LTE (Sierra MC7710), HP Touchpad 32GB WiFi, Palm Pre 2
  4. #4  
    Quote Originally Posted by Herrie View Post
    I tend to disagree here
    It seems that webos-connman-adapter can give you the MAC address. At least in LuneOS/webOS OSE it does
    You might be correct...I cannot test this, as the /getinfo path did not yet exist on the service for the Touchpad (as far as I know/see). The device-info app also uses a different service. But then again, if it's in webOS OSE, it's likely that it's also on the TV.

    The source-code indicates that this service/path 'Lists information about the wifi and wired network interfaces.', so we can assume it's indeed the MAC address of the (connected) network adapter of the TV, and not e.g. the MAC address of the modem/router it's connected to (which the connectionmanager/getstatus returns).

    The only question remaining is, whether this service-path is public or private. As far as I know, most path's of the connectionmanager have always been public, but one will have to check/test.

    @nitin: so it's not standard javascript, but you might be able to call a webos-specific service from your Javascript application to get the information you need. With regards to calling webos-services from Javascript see: ::: LG | webOS TV Developer :: Calling JS Service
  5. #5  
    Quote Originally Posted by Misj' View Post
    You might be correct...I cannot test this, as the /getinfo path did not yet exist on the service for the Touchpad (as far as I know/see).
    Seems it was in
    Code:
    palm://com.palm.wifi/getinfo '{}'
    on legacy webOS. From Open webOS it has been moved to com.palm.connectionmanager, so I'm pretty sure that on TV's it will be there too
    HP Veer (daily driver), HP Pre 3, HP Touchpad Proper 4G/LTE (Sierra MC7710), HP Touchpad 32GB WiFi, Palm Pre 2
  6. #6  
    You don't need a windows based server because the code is executing on the clients machine (via javascript). The client needs to be using windows, the MAC code can be sent back to any server via ajax.

Similar Threads

  1. So Windows is dead - back to webOS?
    By Shihatsu in forum LuneOS
    Replies: 13
    Last Post: 07/19/2019, 04:32 PM
  2. What is going on when I connect a USB hard drive to my WebOS TV?
    By mimphiskhan in forum webOS Apps & Games
    Replies: 0
    Last Post: 07/09/2019, 01:48 AM
  3. Replies: 2
    Last Post: 06/18/2019, 09:49 AM
  4. Do I need to upgrade my webOS?
    By marcus3217 in forum webOS Discussion Lounge
    Replies: 2
    Last Post: 06/06/2019, 04:21 PM
  5. Replies: 3
    Last Post: 05/31/2019, 01:19 PM

Tags for this Thread

Posting Permissions