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

Offline big517

  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-3
Re: Sharp TV ethernet control
« Reply #15 on: May 03, 2012, 08:21:52 am »
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...

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #16 on: May 03, 2012, 08:49:09 am »
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...

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:
  • Terminal: Implicit CR in every LF (checked)
  • Terminal>>Keyboard>>The Function keys and keypad: VT100+
  • Session>>Connection type: Raw
  • Session>>Host Name (or IP address): <tv_ip_address>
  • Session>>Port: 10002
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.
« Last Edit: May 03, 2012, 08:58:21 am by OtisPreslsy »

Offline big517

  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-3
Re: Sharp TV ethernet control
« Reply #17 on: May 03, 2012, 08:59:51 am »
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?

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #18 on: May 03, 2012, 09:24:21 am »
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:
  • Device Type: urn:schemas-micasaverde-com:device:tv:1
  • Upnp Device Filename: D_SharpIpcTV.xml
  • Upnp Implementation Filename: I_SharpIpcTV.xml
  • Ip Address: <tv_ip_address>
You may also want to SSH into your Vera unit and verify that you can PING your TV IP address from there as well.

Offline big517

  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-3
Re: Sharp TV ethernet control
« Reply #19 on: May 03, 2012, 10:27:33 am »
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.

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #20 on: May 03, 2012, 10:50:22 am »
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.

You can use the same PUTTY program to ssh to your Vera IP address.  The username is root and the password is printed on the bottom of your Vera unit.  Once at the command prompt, just type "ping <tv_ip_address>" the same as before.
« Last Edit: September 04, 2012, 01:53:02 pm by OtisPreslsy »

Offline big517

  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-3
Re: Sharp TV ethernet control
« Reply #21 on: May 03, 2012, 10:52:48 am »
Works!

I think if you change AV Mode to anything other than AUTO and then Disable Energy Saver, it will not shut off the RS232 control.  I was able to turn the TV on/off, and I think before I switched that I could only turn it off... 

Is there any way to operate the TV other than Advanced Scene tab? 

Now the next thing is to find the RS232 codes that do NOT show up in the manual.

EDIT:
Check this out...  Maybe "RSPW1   " will fix the disconnected issues and not require a manual power cycle. 
Code: [Select]
Section Command What it Does
POWER ON COMMAND SETTING RSPW0 Tells the TV not to respond to POWR1 commands when the TV is turned off.
POWER ON COMMAND SETTING RSPW1 Tells the TV to respond POWR1 commands when the TV is turned off.
POWER SETTING POWR0 Turns the TV off.
POWER SETTING POWR1 Turns the TV on if and only if the TV has received the RSPW1 command and has not received a RSPW0 command since.


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

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #22 on: May 03, 2012, 11:26:53 am »
EDIT:
Check this out...  Maybe "RSPW1   " will fix the disconnected issued and not require a manual power cycle. 

I'm glad it is working for you!  Yeah, I think I must have issued that command a long time ago on mine, because it responds to the POWR1 command when I turn it off.  I will add both of the RSPW commands to the Implementation so that it can be toggled from Vera.

The flash-based remote control builder has not been fixed yet, so you cannot really do anything with the commands outside of scenes yet.  If it were working, you could build a custom remote to be accessed from your phone or tablet.  That is found under the Devices>>AV Gear view in your Vera web page.  Right now, it just loads to a blank lavender screen in Chrome and a blank black screen in IE9.

Offline big517

  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-3
Re: Sharp TV ethernet control
« Reply #23 on: May 03, 2012, 12:54:22 pm »
Do you plan to make a plugin that shows the device state etc...?  That would pretty cool, only if it's using the ON/OFF state (that's all that is useful to me at this point it seems anyway).

Thanks,

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #24 on: May 03, 2012, 05:16:13 pm »
Do you plan to make a plugin that shows the device state etc...?  That would pretty cool, only if it's using the ON/OFF state (that's all that is useful to me at this point it seems anyway).

Thanks,

There is no reliable way to determine the state of the TV since it doesn't report anything to Vera other than command responses.  Being that it still responds to the power on command when off means that it keeps the network connection alive in order to receive commands.  This means that you cannot use PING to determine if the set is on or not and there are no status commands implemented for incremental polling.  You could say that if Vera turned it off, then that is the state, but what if someone turns it back on with the remote or on the TV itself?  This would mean that Vera has the wrong state.  I just don't think there is a lot more that can be done unless Sharp implements more functionality in IP Control.

Offline big517

  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-3
Re: Sharp TV ethernet control
« Reply #25 on: May 04, 2012, 08:03:34 am »
That is understandable.. So the main benefit would be the ability to control from the gui... Let us know if you plan to tackle the project.
Thanks.

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #26 on: May 04, 2012, 01:16:33 pm »
That is understandable.. So the main benefit would be the ability to control from the gui... Let us know if you plan to tackle the project.
Thanks.

About the only things left to do on this are the following:
  • Add support for the RSPW commands
  • Figure out how to incorporate username/password
  • Figure out how to take in a custom port number for <ioPort>
Once these items are done, I will post it as a downloadable app.  That is about all that can be done with it for now.
« Last Edit: May 04, 2012, 01:18:07 pm by OtisPreslsy »

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #27 on: May 04, 2012, 05:21:26 pm »
After doing some digging, I was able to use the Onkyo and Binary Light JSON files as examples, I was able to add buttons to the control pad for this.  Here is the latest with the following changes:
  • Added Remote Power (RSPW) commands
  • Added all the View Mode commands
  • Added special commands for 3D Televisions
  • Added On and Off buttons to the main control pad and in the Control tab
It looks like Sharp does a good job of avoiding overlap in commands for IP Control between different TV sets.  None of the new commands for 3D TV's overlap with the commands we already had.  While the buttons cannot determine status, they do function for turning the TV on and off.

Now, I still need to determine if there is the ability to send authentication when using the raw or crlf protocol.  I looked all over the place but could not find anyone actually doing this, and the documentation for Luup does not say whether this is or is not possible.

EDIT:  I used modified code from the DSC Alarm Panel plugin Implementation file to add the capability to specify a custom port in the IP address field in the format: <ip_address>:<port> (eg 10.0.0.1:10003).  If no port is specified, it defaults to 10002.  I also found in the documentation where you cannot specify a username and password using the built-in raw or crlf protocols.  The function luup.io.open only takes the device ID, IP address, and Port number.  Here is a list of the new features:
  • Added the ability to specify a custom port number in the IP address field (eg. 10.0.0.1:10003)
  • Added a check to see if there is a connection before attempting to execute a command.  The start up function is called before command execution if there is no connection
I feel like this is now complete enough to upload as a downloadable plugin and will work on doing that.
« Last Edit: May 04, 2012, 08:14:24 pm by OtisPreslsy »

Offline big517

  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-3
Re: Sharp TV ethernet control
« Reply #28 on: May 04, 2012, 09:07:20 pm »
You are the man...  Great work, nice to see something happen so fast!

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: Sharp TV ethernet control
« Reply #29 on: May 07, 2012, 11:29:36 am »
Thanks @big517!

This app has now been published to the App Market for download, and I have verified that it works!  Enjoy!