Author Topic: Sharp TV ethernet control  (Read 40445 times)

Offline lastmacuser

  • Full Member
  • ***
  • Posts: 100
  • Karma: +0/-1
Sharp TV ethernet control
« on: April 26, 2012, 12:31:55 pm »
I want to improve my system and control my Sharp with ethernet. I allowed the Sharp to controlled using the Network settings tab on the TV and also set up a static IP. All internet stuff on the TV works fine. I then went to Vera add Devices, uPnP and the Sharp does not show up. I also went to my desktop and it does not show on the Network tab there. What am I doing wrong?

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: Sharp TV ethernet control
« Reply #1 on: April 26, 2012, 12:48:45 pm »
Is your TV set UPnP/DLNA compliant? Is UPnP/DLNA enabled?

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #2 on: April 26, 2012, 01:46:23 pm »
If your Sharp TV is the same as mine, then it uses IP Control, which enables you to open a Raw TCP session with it and enter commands in the Command Line Interface. 

After enabling IP Control and setting a device name, user name, password, and control (TCP) port, I was able to connect to mine and issue commands using HyperTerminal.  The commands can be received either by RS-232 or IP.  The command format is in the user manual for the TV; just start reading at IP Control Setup.

I do not currently use Vera to control my set, because my A/V receiver has a built-in HDMI switch that allows me to switch it and only run a single HDMI cable to the TV.

On my set, the DLNA portion is only so you can play media on the TV from other computers on the network that are advertising their media libraries via UPnP; you cannot control the set itself via UPnP.  I hope this helps.

Offline lastmacuser

  • Full Member
  • ***
  • Posts: 100
  • Karma: +0/-1
Re: Sharp TV ethernet control
« Reply #3 on: April 26, 2012, 04:47:27 pm »
If your Sharp TV is the same as mine, then it uses IP Control, which enables you to open a Raw TCP session with it and enter commands in the Command Line Interface. 
After enabling IP Control and setting a device name, user name, password, and control (TCP) port, I was able to connect to mine and issue commands using HyperTerminal.  The commands can be received either by RS-232 or IP.


Thanks for the help. I will try that. How would I incorporate the commands into a Vera sceme? Is it possible?

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #4 on: April 26, 2012, 05:09:19 pm »
Thanks for the help. I will try that. How would I incorporate the commands into a Vera sceme? Is it possible?

I have never looked into doing this with Vera and frankly do not know what its capabilities are around communicating with a device in a Raw TCP session.  I would imagine that you would need to write your own plugin for it with the necessary commands in the Implementation File.  This would be a good place to start though: http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand

The first question to answer though is, "Is Vera capable of opening a Raw TCP session with a device and sending commands to it?".  Maybe someone else is able answer that.

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Sharp TV ethernet control
« Reply #5 on: April 26, 2012, 06:45:42 pm »
Thanks for the help. I will try that. How would I incorporate the commands into a Vera sceme? Is it possible?

I have never looked into doing this with Vera and frankly do not know what its capabilities are around communicating with a device in a Raw TCP session.  I would imagine that you would need to write your own plugin for it with the necessary commands in the Implementation File.  This would be a good place to start though: http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand

The first question to answer though is, "Is Vera capable of opening a Raw TCP session with a device and sending commands to it?".  Maybe someone else is able answer that.
Raw TCP, with AV Gear, is no problem.  See Onkyo, Denon, Panasonic TV Plugins over on code.mios.com work fully worked examples, with the AV-specific hooks in them

Offline lastmacuser

  • Full Member
  • ***
  • Posts: 100
  • Karma: +0/-1
Re: Sharp TV ethernet control
« Reply #6 on: April 30, 2012, 12:39:10 pm »
Is that stuff written in foreign language? I would just like to start with discrete on and off. I don't mind learning how to do this myself so not to bother the experts here. Is there somewhere that explains code writing for dummies?

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Sharp TV ethernet control
« Reply #7 on: April 30, 2012, 12:49:21 pm »
You can take these two files:
    http://code.mios.com/trac/mios_panasonic-tv/browser/trunk

change their names, change the tag at the top from "stxetx" to "raw", and then just enter the Raw commands to replace the Power On and Power Off codes.

In Panasonic, these are:

Power Off:
    sendCommand("POF")

Power On:
    sendCommand("PON")

But you'll need to substitute the strings for whatever "raw" commands the Sharp needs.


When you're comfortable with that, and it's working correctly, you could change the others.

Offline lastmacuser

  • Full Member
  • ***
  • Posts: 100
  • Karma: +0/-1
Re: Sharp TV ethernet control
« Reply #8 on: April 30, 2012, 01:40:01 pm »
You can take these two files:
    http://code.mios.com/trac/mios_panasonic-tv/browser/trunk

change their names, change the tag at the top from "stxetx" to "raw", and then just enter the Raw commands to replace the Power On and Power Off codes.

In Panasonic, these are:

Power Off:
    sendCommand("POF")

Power On:
    sendCommand("PON")

But you'll need to substitute the strings for whatever "raw" commands the Sharp needs.


When you're comfortable with that, and it's working correctly, you could change the others.

Thank you very much. I think I can handle that. Look forward to trying.

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Sharp TV ethernet control
« Reply #9 on: April 30, 2012, 01:51:13 pm »
If you have non-printables, you can use string.char(...) to generate them, per this example:
    http://forum.micasaverde.com/index.php?topic=9967.msg69254#msg69254

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #10 on: May 01, 2012, 07:24:26 pm »
Thank you very much. I think I can handle that. Look forward to trying.

If you haven't had a chance to look at this yet, I figured it out.  I just downloaded the Panasonic TV plugin to my Vera and let it create a device.  I then downloaded the Device Specification (D_) and Implementation (I_) files from Apps>>Develop Apps>>Luup files.

In the Device Specification file, I just changed the following:
Code: [Select]
    <friendlyName>Sharp Aquos TV(LC70LE734U)over IP</friendlyName>
    <manufacturer>Sharp</manufacturer>
    <manufacturerURL>http://www.sharpusa.com</manufacturerURL>
    <modelDescription>Aquos TV over IP Interface</modelDescription>
    <modelName>LC70LE734U</modelName>
    <modelNumber>1.0</modelNumber>
    <protocol>crlf</protocol>

    <implementationList>
        <implementationFile>I_SharpIpcTV.xml</implementationFile>
    </implementationList>

In the Implementation file, I changed the following so I could test:
Code: [Select]
    <settings>
        <protocol>crlf</protocol>
   <ioPort>10002</ioPort>
    </settings>

    ...

        function tvStartup(lul_device)
            luup.log("Running I_SharpIpcTV.xml")
        end

    ...

        <action>
            <serviceId>urn:micasaverde-com:serviceId:DiscretePower1</serviceId>
            <name>Off</name>
            <run>
                -- Power off
                sendCommand("POWR0   ")
            </run>
        </action>

        <action>
            <serviceId>urn:micasaverde-com:serviceId:DiscretePower1</serviceId>
            <name>On</name>
            <run>
                -- Power on
                sendCommand("POWR1   ")
            </run>
        </action>

You have to use crlf instead of raw as the protocol so that each command is sent with a carriage return and linefeed after it.  I also used the default IP Control port of 10002 in the Implementation file.

After editing and renaming the files, I uploaded them to my Vera unit from Apps>>Develop Apps>>Luup files and then edited the device that it created when I downloaded the Panasonic TV plugin and changed the name, device_file, impl_file, and added the ip.

On the TV, I enabled IP Control with all default parameters with a blank username and password.  I was then able to create scenes to turn the power to the TV on or off, and it works!  I hope this helps.
« Last Edit: May 01, 2012, 07:28:38 pm by OtisPreslsy »

Offline big517

  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-3
Re: Sharp TV ethernet control
« Reply #11 on: May 01, 2012, 08:18:40 pm »
That's awesome, thanks for the detailed notes!  Would you mind posting the files you ultimately uploaded for this?
Thanks

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #12 on: May 01, 2012, 09:09:10 pm »
That's awesome, thanks for the detailed notes!  Would you mind posting the files you ultimately uploaded for this?
Thanks

Here you go!  I will probably go ahead and implement some more codes in it later and maybe turn it into an actual plugin, if I can get it to work with the port number, a username, and a password as variables in the device control panel.

EDIT:  I have implemented all the functionality that can be easily implemented for this.  Please download the ZIP file and upload all the XML files in it to your Vera and use it as mentioned above.  Please note that I have not fully tested every function, and it still requires you to use port 10002 and no username or password for IP Control on your TV.
« Last Edit: May 02, 2012, 12:47:46 am by OtisPreslsy »

Offline big517

  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-3
Re: Sharp TV ethernet control
« Reply #13 on: May 03, 2012, 06:52:26 am »
I'm going to give this a shot now...  Is there a way to launch a favorite app?  Is there documentation on the possible commands?  I would really like to have a button to launch the VUDU app, or go right to Pandora on the TV and start playing...

« Last Edit: May 03, 2012, 07:40:46 am by big517 »

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #14 on: May 03, 2012, 08:00:57 am »
I'm going to give this a shot now...  Is there a way to launch a favorite app?  Is there documentation on the possible commands?  I would really like to have a button to launch the VUDU app, or go right to Pandora on the TV and start playing...

Unfortunately, there is nothing in there for launching favorite apps.  Some things are not so useful too, like the volume control.  The only way they give you to control volume is by entering a specific value.  There is no method for simply increasing or decreasing the volume.  I used the user manual for my TV (LC-70LE734U) that listed all of the available commands and the codes for them.  There have been some updates since I got my TV, so I will look on the Sharp website to see if there might have been any updates to the IP Control command set.  The manual for my TV is here: http://files.sharpusa.com/Downloads/ForHome/HomeEntertainment/LCDTVs/Manuals/tel_man_LC70LE734U.pdf.  The commands are on page 58.

EDIT: It looks like Sharp does not have any online documentation of IP Control commands.  It seems to only appear in the user manual for each TV.
« Last Edit: May 03, 2012, 08:11:39 am by OtisPreslsy »