Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Control Sony BDV-T58

  1. #1
    Join Date
    Mar 2005
    Posts
    724

    Default Control Sony BDV-T58

    ok I am trying to control a new Sony bdv-T58 Bluray home theater using Girder and am not sure where to start it is a wifi connected device and if fully controllable via android and iphone remotes so I assume there is a way to send the data to it from girder.

    Thanks,
    Yonu

  2. #2
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    370

    Default

    Saw your post on the xPL forum. The Sony BDV-T58 has DLNA/UPnP capabilities if I'm correct. so you should be able to control it through UPnP.

    See this thread
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

  3. #3
    Join Date
    Mar 2005
    Posts
    724

    Default

    Thanks I had read some on the gateway but wasn't sure it was what I needed so I may be bothering you some but it seems to be what I need

    Thanks,
    Yonu

  4. #4
    Join Date
    Mar 2005
    Posts
    724

    Default

    Ok quick question I am getting the data from the Bluray. Now the big question can I transmit commands back to it?

    Thanks,
    Yonu

  5. #5
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    370

    Default

    Sure you can. Check the forum thread on UPnP, and this tutorial.
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

  6. #6
    Join Date
    Mar 2005
    Posts
    724

    Default

    hey thanks for the info the tutorial and all makes sense however I am hoping you can tell me where I have screwed up it says I have an error on line 2

    Here is the error
    [string "udp-server.gml:\test\Scripting"]:2: in main chunk

    and here is my code

    -- Setup persistent device adn service IDs
    local BVDT58 = UPnP.device["00000000-0000-1010-8000-f0bf97fcad4c"]
    local Mute = BVDT58.services["urn_upnp-org_serviceId_RenderingControl"]

    -- define global and methods to export
    BVDT58 = {

    Unmute = function (self)
    return Mute.methods.SetTarget:execute(true)
    end,

    mute = function (self)
    return Mute.methods.SetTarget:execute(false)
    end,

    Dim = function (self, level)
    return Mute.methods.SetLoadLevelTarget:execute(level)
    end,

    Status = function (self)
    local load = Mute.variables.Volume.value .. "%"
    if Mute.variables.Status.value == "False" then
    print("Light is currently off.")
    else
    print("Light is currently on at " .. load)
    end
    end,
    }

  7. #7
    Join Date
    Mar 2005
    Posts
    724

    Default

    I just realized I didn't have the whole error in the post the rest is

    [string "udp-server.gml:\test\Scripting"]:2: attempt to index field `device' (a nil value)

  8. #8
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    370

    Default

    In Lua a variable can hold any value. Lua tables are basically a key-value list, anything can be a key and anything can be a value.

    The UPnP code cretaes a global variable, UPnP, which is a table which holds several core elements. a.o. the 'devices' table. Now whenever you request a table from a table using a key that does not exist, Lua will return 'nil' (similar to NULL or Nothing in other languages).

    Code:
    -- Setup persistent device adn service IDs
    local BVDT58 = UPnP.device["00000000-0000-1010-8000-f0bf97fcad4c"]
    local Mute = BVDT58.services["urn_upnp-org_serviceId_RenderingControl"]
    You wrote 'UPnP.device' instead op 'UPnP.devices', so; 'UPnP.device' returns nil, because the key 'device' does not exist. Then Lua will try to lookup the key "00000000-0000-1010-8000-f0bf97fcad4c" in the value nil (which is not a table).
    This results in the valid error:
    Code:
    attempt to index field `device' (a nil value)
    So change;
    Code:
    -- Setup persistent device adn service IDs
    local BVDT58 = UPnP.device["00000000-0000-1010-8000-f0bf97fcad4c"]
    local Mute = BVDT58.services["urn_upnp-org_serviceId_RenderingControl"]
    into;

    Code:
     -- Setup persistent device and service IDs
    if not UPnP then
        print("UPnP global table not found")
        return
    end
    if not UPnP.devices then
        print("UPnP device list not found")
        return
    end
    local BVDT58 = UPnP.devices["00000000-0000-1010-8000-f0bf97fcad4c"]
    if not BVDT58 then
        print("UPnP device BVDT58 not found")
        return
    else
        print ("UPNP device BVDT58 found")
    end
    if not BVDT58.services then
        print("UPnP device BVDT58 has no services defined")
        return
    end
    local Mute = BVDT58.services["urn_upnp-org_serviceId_RenderingControl"]
    if not Mute then
        print("UPnP device BVDT58 RenderingControl not found")
        return
    else
        print ("UPNP device BVDT58 RenderingControl found")
    end
    (did this top of my head, had no way to test it here)
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

  9. #9
    Join Date
    Mar 2005
    Posts
    724

    Default

    ok that code solved that issue now I hate to ask I get this [string "Interactive"]:1: `=' expected near `mute'

    everytime I try to run any of the functions however I know I have very little LUA knowlegde but the syntax looks right but here is the code

    Status = function (self)
    local load = Mute.variables.Mute.event .. "%"
    if Mute.variables.Status.event == "False" then
    print("Light is currently off.")
    else
    print("Light is currently on at " .. load)
    end

  10. #10
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    370

    Default

    Have you finished the tutorial? The code posted abobe uses 'LoadLevelTarget' etc. these names are used for a dimmable light device, not for media renderers.
    Use the variable explorer to find the UPnP.devices list and explore your device, there you'll find the appropriate action/method names for your device
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •