LinuxMCE Forums

General => Users => Topic started by: Afkpuz on November 01, 2008, 08:27:46 am

Title: Need help with rs232 tv
Post by: Afkpuz on November 01, 2008, 08:27:46 am
So, I asked this question in another thread, but it didn't get me all the way, so here goes again.

I have an olevia 232t television.  It has an rs232 control port and I have a serial cable connected to the core.  Someone in the other post told me to update my cvsSQL or something similar and I did that and now there is a template for olevia floating around the web admin.  My problem is that I have no idea what to do with this.  Can someone walk me simply through how to go about this process?  Any help would be appreciated as the web admin is not making sense to me right now.  I don't understand the concepts or the means involved here at all.  thanks guys


Title: Re: Need help with rs232 tv
Post by: tschak909 on November 02, 2008, 10:17:49 am
We do not have the olevia template in the database. I just looked.

Does someone have the template so that I can put it into the database?

-Thom
Title: Re: Need help with rs232 tv
Post by: Afkpuz on November 02, 2008, 11:15:52 pm
It is definitely an rs232 plug.  Someone told me to update my sqlCVS and now the olevia manufacture shows up when I use the add device wizard.  However, I don't understand the wizards or how I should try to add this TV.
Title: Re: Need help with rs232 tv
Post by: colinjones on November 03, 2008, 01:01:31 am
DB9 is almost certainly a 232 port, however many displays do not have control functionality through this port, only the ability to update the firmware. In those cases the port is almost always called a "service port", as does this one. If that is the case, your options are limited to IR (or perhaps USB/ethernet if it has them).
Title: Re: Need help with rs232 tv
Post by: Afkpuz on November 22, 2008, 02:22:22 am
Ok, so I had some problems and haven't been able to think about controlling my TV.  But now, those problems are fixed and I'd like to chase this rabbit again.  So, Thom asked who has the template.  In another one of my posts, it was a user named PeteK.  He said that "I just checked in a template for the Olevia RS-232.   I'm still having issues getting pnp to run (I'm not sure what triggers PNP for serial ports (I've got USB to serial adapters on my MDs), but there is a pnp script that I've checked out before in the SVN tree.  In any case, if you update sqlCVS, there will be a template for the Olevia 2XXT TVs."

So, once again, I don't know what to do with this.  Where in the web admin do I add this?  I'm really in need of any kind of direction.
Title: Re: Need help with rs232 tv
Post by: colinjones on November 22, 2008, 10:32:03 am
afkpuz - read my last post. That display's specs says this is a service port only. No control. What makes you think it is a control port?
Title: Re: Need help with rs232 tv
Post by: Afkpuz on November 23, 2008, 01:19:02 am
Because several websites that I looked on when I purchased the TV said that this port allowed a computer to control the TV.  Furthermore, someone in another of my posts said that he was making a template to control the 200 series olevia tvs, which is what I have. 
Title: Re: Need help with rs232 tv
Post by: tschak909 on November 23, 2008, 01:31:21 am
The Olevia tv's referred to have a full RS-232 serial port. The protocol information can be gleaned from their website.

-Thom
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 02, 2008, 09:53:24 pm
Thom, I believe that I found the codes needed to control my tv.  Can you help me test them and make a template?
Title: Re: Need help with rs232 tv
Post by: tschak909 on December 02, 2008, 09:54:10 pm
Do you have the required cable?

-Thom
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 02, 2008, 10:00:02 pm
Yes.  Here is the page with the codes. 

Title: Re: Need help with rs232 tv
Post by: hari on December 02, 2008, 10:08:25 pm
Try to send a power on or off with the TestSerialPort utility. Look at the pnp scripts for usage hints.

br,Hari
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 02, 2008, 10:10:32 pm
You act like I know what you're talking about...can you dumb it down for me?
Title: Re: Need help with rs232 tv
Post by: darrenmason on December 03, 2008, 04:44:46 am
Hi Afkpuz,

Did you read through the wiki pages on devices/device templates?

http://wiki.linuxmce.com/index.php/Devices
http://wiki.linuxmce.com/index.php/AV_Devices
http://wiki.linuxmce.com/index.php/Device_Templates

See if they answer some of your questions.

regards
Darren
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 03, 2008, 06:51:27 am
Ok, I'm getting close, but am stuck on the ruby code syntax.  On the A/V page, I have my television listed.  COM Port on PC is /dev/ttyS0, but I cannot get the ruby code correct.

The information I got from Olevia says that the power off Hex Command is BE 05 27 00 EA   

I click A/V properties and assume that here is where I should enter my magic ruby codes.  But I actually don't know any ruby programming, so I got stuck.  I tried to use some syntax I found in other templates, but no dice.  Any help? 
Title: Re: Need help with rs232 tv
Post by: darrenmason on December 04, 2008, 12:18:34 am
If you are just trying to send serial commands then you might be better with the short form.
This allows you to simply enter the serial commands to send without all the ruby syntax.

Described here....
http://wiki.linuxmce.com/index.php/Generic_Serial_Device
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 05, 2008, 05:43:44 am
Ok, well then how exactly do I do that?  I've tried putting the code straight in.  I've also tried

<$"BE 05 27 00 EA"$>
Title: Re: Need help with rs232 tv
Post by: hari on December 05, 2008, 10:19:48 am
you better not send the hex values as ascii strings :-)
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 05, 2008, 10:06:32 pm
Arg!  Can someone just tell me what to type in there?  I have no idea what I'm doing with that hex code!
Title: Re: Need help with rs232 tv
Post by: tschak909 on December 05, 2008, 10:12:22 pm
http://www.rubycentral.com/pickaxe/language.html

Start at the "Strings" section.

The needed info is in there.

-Thom
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 06, 2008, 06:04:33 am
Ok, here are the things that I've tried.  I read you link Thom, but I don't know which criteria I should use.

I tried these entries.
<$"BE 05 27 00 EA"$>  <$"BE052700EA"$>
"BE 05 27 00 EA"     "BE052700EA"
"\xBE \x05 \x27 \x00 \xEA"   <$"\xBE \x05 \x27 \x00 \xEA"$>


Does anyone have a straight answer for me?  Thom's link is great, but I still didn't know what I was looking for under "strings".
Title: Re: Need help with rs232 tv
Post by: tschak909 on December 06, 2008, 06:44:10 am
try, <$"\xBE\x05\x27\x00\xEA"$> .. keep in mind that spaces are literal bytes as well, so they will be parsed by the tv..so you need to remove them. The spaces in the protocol specification are simply for visual purposes.

-Thom
Title: Re: Need help with rs232 tv
Post by: PeteK on December 06, 2008, 07:15:43 pm
Ok, here are the things that I've tried.  I read you link Thom, but I don't know which criteria I should use.

I tried these entries.
<$"BE 05 27 00 EA"$>  <$"BE052700EA"$>
"BE 05 27 00 EA"     "BE052700EA"
"\xBE \x05 \x27 \x00 \xEA"   <$"\xBE \x05 \x27 \x00 \xEA"$>


Does anyone have a straight answer for me?  Thom's link is great, but I still didn't know what I was looking for under "strings".

I sent you my Olevia 232T template screen shots which work in 0710.  Can you please add the information to a wiki page, like this one?

http://wiki.linuxmce.org/index.php/LG_42LB5D

Thanks,
-Pete
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 06, 2008, 08:27:32 pm
Hmm.  I'm not sure that anything is even being sent to the TV.  Anyone know of a utility outside of LMCE (like a kubuntu app) that I could use to test my serial port?  <$"\xBE\x05\x27\x00\xEA"$> does not work.


And PeteK, I can add it to the wiki, but I don't have it working, so I don't have all the information you have.  Do you have the on/off functions working?  If so, what exactly do you use for those ruby codes?
Title: Re: Need help with rs232 tv
Post by: tschak909 on December 06, 2008, 08:30:40 pm
We provide a utility called TestSerialPort for this very purpose. You can see it being used in the scripts in the /usr/pluto/pnp directory.

-Thom
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 07, 2008, 04:43:56 am
PeteK, sorry, I was having email prgram difficulties and didn't notice that you sent more than 1 picture, so I will put that information into the wiki.  You should talk with Thom about getting your script/template implemented in the next release.
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 07, 2008, 07:49:40 am
PeteK, I've made a preliminary page on the wiki with your information.  However, I'm still having trouble getting any response from my tv.  I mimicked every single setting in those pictures you sent and still cannot get anything.  I'm starting to wonder if I have a bad cable or a bad jack on the TV. 

I tried using your script via the terminal and it claimed that I didn't have an olevia TV.  I got the message "unknown N81".  When I looked at the code of the script, I noticed that port is set to "$3".  I don't know much about how the pnp scripts work, but is this correct?  shouldn't this be something like /dev/ttyS0? 
Title: Re: Need help with rs232 tv
Post by: Afkpuz on December 12, 2008, 03:42:59 am
bump
Title: Re: Need help with rs232 tv
Post by: PeteK on February 27, 2009, 05:45:23 am
I checked in my Olevia template a few days ago.  Try doing a sqlCVS update and let me know if that template works for you.

Title: Re: Need help with rs232 tv
Post by: tschak909 on February 27, 2009, 06:12:02 am
nuh uh. that was to schema. do NOT use schema on 0710!

-Thom
Title: Re: Need help with rs232 tv
Post by: PeteK on February 27, 2009, 06:58:16 am
tschak--

got ya. 

Afkpuz, for the script, it's set up to support operation in LMCE.  $3 is the third argument when the script is run.

To run it by hand, run

Code: [Select]
20_Olevia2XX_5XXT_TV.sh 1 1 /dev/ttyS0
replacing /devttyS0 with your serial port.

If you still can't get it to work, I can post a windows executable that I wrote to test the interface.

Title: Re: Need help with rs232 tv
Post by: Afkpuz on February 27, 2009, 04:50:36 pm
Sorry, I haven't been messing with this problem in a long time.  My parents ended up moving to a new house and I lost my serial cable in the process.  I've just been content to stand up and turn the TV on analog style.
Title: Re: Need help with rs232 tv
Post by: colinjones on February 27, 2009, 09:42:40 pm
If all you need is the TV to power on/off, and you are using a computer connection (eg VGA) you can use DPMS signalling to do that very easily... just a thought
Title: Re: Need help with rs232 tv
Post by: Afkpuz on March 01, 2009, 04:32:37 am
I am only looking to turn the tv on and off, but this is a tv first, then a monitor.  How would one go about doing this?
Title: Re: Need help with rs232 tv
Post by: colinjones on March 01, 2009, 05:41:43 am
I am only looking to turn the tv on and off, but this is a tv first, then a monitor.  How would one go about doing this?

You can't use DPMS signalling for a normal TV connection (eg composite, component) only for computer connections like VGA, DVI, HDMI, etc...
Title: Re: Need help with rs232 tv
Post by: Afkpuz on March 01, 2009, 06:13:58 am
No, I am using the vga plug, I just meant that this is not a monitor:  it's a TV with a vga input. 
Title: Re: Need help with rs232 tv
Post by: colinjones on March 01, 2009, 06:22:00 am
Well then that's probably fine then as long as the TV supports DPMS (probably). You may have to enable DPMS support in your xorg.conf fill first. You can then create a new device template based on GSD as a child of the MD. Set up a video pipe to it. Then implement the On and Off commands with some ruby script. You can execute general shell commands by using the Ruby system command. There is a shell command called xset that allows you to control the DPMS signalling to the monitor. Thus the Ruby snippet for the GSD On command (#192 I think) is:

Code: [Select]
system "xset dpms force on"
and for the GSD Off command (#193 I think) is:

Code: [Select]
system "xset dpms force off"