Sharp TV ethernet control

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?

Is your TV set UPnP/DLNA compliant? Is UPnP/DLNA enabled?

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.

[quote=“OtisPreslsy, post:3, topic:171325”]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.[/quote]

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: [url=http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand]http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand[/url]

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.

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: [url=http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand]http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand[/url]

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.[/quote]
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

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?

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 “[tt]stxetx[/tt]” to “[tt]raw[/tt]”, and then just enter the Raw commands to replace the Power On and Power Off codes.

In Panasonic, these are:

Power Off:
[tt] sendCommand(“POF”)[/tt]

Power On:
[tt] sendCommand(“PON”)[/tt]

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.

[quote=“guessed, post:8, topic:171325”]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 “[tt]stxetx[/tt]” to “[tt]raw[/tt]”, and then just enter the Raw commands to replace the Power On and Power Off codes.

In Panasonic, these are:

Power Off:
[tt] sendCommand(“POF”)[/tt]

Power On:
[tt] sendCommand(“PON”)[/tt]

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.[/quote]

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

If you have non-printables, you can use [tt]string.char(…)[/tt] to generate them, per this example:
http://forum.micasaverde.com/index.php?topic=9967.msg69254#msg69254

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] Sharp Aquos TV(LC70LE734U)over IP
Sharp
http://www.sharpusa.com
Aquos TV over IP Interface
LC70LE734U
1.0
crlf

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

[/code]

In the Implementation file, I changed the following so I could test:

[code]
crlf
10002

...

    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>

[/code]

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.

That’s awesome, thanks for the detailed notes! Would you mind posting the files you ultimately uploaded for this?
Thanks

[quote=“big517, post:12, topic:171325”]That’s awesome, thanks for the detailed notes! Would you mind posting the files you ultimately uploaded for this?
Thanks[/quote]

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.

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: [url=http://files.sharpusa.com/Downloads/ForHome/HomeEntertainment/LCDTVs/Manuals/tel_man_LC70LE734U.pdf]http://files.sharpusa.com/Downloads/ForHome/HomeEntertainment/LCDTVs/Manuals/tel_man_LC70LE734U.pdf[/url]. 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.

I’m getting this error… I have the tv setup wireless, Static IP, port 10002 blank user/pass and it’s enabled
Sharp Aquos TV[152] : Failed to open IO Port

Any suggestions?
I downloaded the Panasonic TV Plugin, changed the Device and Impl. filenames, and added the IP. It automatically updated with the MAC address…

[quote=“big517, post:16, topic:171325”]I’m getting this error… I have the tv setup wireless, Static IP, port 10002 blank user/pass and it’s enabled
Sharp Aquos TV[152] : Failed to open IO Port

Any suggestions?
I downloaded the Panasonic TV Plugin, changed the Device and Impl. filenames, and added the IP. It automatically updated with the MAC address…[/quote]

I get this if Vera has lost communication with the TV, like overnight when I turn off the power to everything. You can try to hit the Reload button in the upper right corner of the Vera webpage. You can verify that the TV is reachable by opening a command prompt on a PC (Start>>type cmd in the search) and type “ping <tv_ip_address>”, minus the quotes. You should get “Reply from …”. If you get “Request timed out” or anything else, then there is a problem with networking or with the TV IP Control settings. You can test it with PUTTY by entering the following settings:

[ul][li]Terminal: Implicit CR in every LF (checked)[/li]
[li]Terminal>>Keyboard>>The Function keys and keypad: VT100+ [/li]
[li]Session>>Connection type: Raw[/li]
[li]Session>>Host Name (or IP address): <tv_ip_address>[/li]
[li]Session>>Port: 10002[/li][/ul]

Once you get a window open, just enter "POWR0 ", minus the quotes; notice the 3 spaces at the end. They must be there as all commands must be 8 characters in length. This should turn power on the TV off. If you cannot connect, then something is either wrong with the TV settings or your network. I have mine over a wired connection. If you get ERR when entering the command and the TV does not turn off, then there is something else wrong and you should check that you entered the command correctly. You should get an OK response.

I received “OKR” and it seemed to work… Vera after refresh and TV being on still gives me the same error… Anything in the panasonic plugin that was created needed to be changed besides the xml file names, and IP?

That is interesting. If you uploaded all the files from my zip file to your Vera, then everything is changed that needs to be. These are the same files I am running on my Vera. The port number is hard coded in the Implementation file, so make sure you just enter the IP address (eg 10.0.0.1) in the ip field under Advanced for the device and not the IP adress and port (eg 10.0.0.1:10002). You don’t even have to download the Panasonic plugin and use the device created by the Panasonic plugin if you don’t want to. You can just create a new one from Apps>>Develop Apps>>Create device with the following information:

[ul][li]Device Type: urn:schemas-micasaverde-com:device:tv:1[/li]
[li]Upnp Device Filename: D_SharpIpcTV.xml[/li]
[li]Upnp Implementation Filename: I_SharpIpcTV.xml[/li]
[li]Ip Address: <tv_ip_address>[/li][/ul]

You may also want to SSH into your Vera unit and verify that you can PING your TV IP address from there as well.

Ok, started from scratch so we’ll see. I’m not sure how to SSH into the VERA to ping this so hopefully it works.

Thanks again.