PDA

View Full Version : Help with serial control for a noob



bgc779pc
February 15th, 2007, 04:45 PM
I recently purchased an Olevia lcd, which unfortunately for me does not have, discrete ir codes. Luckily it has serial port
Im still using Girder 3.32 and it's connected to com 1 on my motherboard.
Any help would be greatly appreciated.

Data will be transferred serially according to RS232 protocol using the following settings.

Baud rates 115200
Data bits 8
Stop bit 1
Parity No

3 Data structure
3.1 From PC to TV

Bytes from PC will be processed by RS232 hardware first. To send a command to TV, a preamble indicating the target device is attached before each byte. Then the RS232 hardware will dispatch byte to the target device according the preamble(0x50). Besides, to avoid unread data being overwritten by new data, a 10 ms delay is required when sending a command to TV. For example, to send a byte sequence 0x10, 0x20, 0x30 to TV, we actually send 0x50, 0x10, 0x50, 0x20, 0x50, 0x30 from PC. The following figure gives an illustration.

0x50 0x10 10ms delay 0x50 0x20 10ms delay 0x50 0x30

The data will be sent from PC to TV in the following data structure:

Byte 1 Byte 2 Byte 3 Byte 4
0x50 0x4B 0x50 Input

Where the definition of the “Key” byte is shown as the following table:

Command  Input  Remark 
Input-TV 00
Input-AV1 01
Input-AV2 02
Input-SV1 03
Input-SV2 04
Input-YPbPr1 05
Input-YPbPr2 06
Input-DVI/HDMA1 07
Input-VGA 08
Input-DTV 09
Input-HDMA2 0A


Note that, the PC will not return any byte after receiving the command.
I have been trying to send a command to switch to tuner via the serial message plugin by dividing the command at the preamble
and puting a 10ms wait command between the second and third byte.


Byte 1 Byte 2 10ms Byte 3 Byte 4
0x50 0x4B delay 0x50 Input=TV or 00

Is it possible to send this command using serial plugin and a wait command between the first and second preamble?
If not then how else can I send this?

Is there someone I can pay to help me?

Here are the document they sent to me.

jakematic
September 9th, 2007, 07:25 AM
I'm having the same problem. Have cobbled together some Perl, even tried sending direct to the serial port. The dang thing just won't respond to the PC. Am not 100% sure my cable is right, but can't find a pinout anywhere....

jakematic
September 9th, 2007, 02:54 PM
Well I used this script and I can get the TV to power on. That's a start, but other functions would be nice.

#!/usr/bin/perl
use Device::SerialPort;
use Time::HiRes qw(usleep ualarm gettimeofday);

# Set up the serial port
my $port = Device::SerialPort->new("/dev/ttyUSB0");
$port->databits(8) || die "Failed to set data bits";
$port->baudrate(115200) || die "Failed to set speed";
$port->parity("none") || die "Failed to set parity";
$port->stopbits(1) || die "Failed to set stop bits";
$port->handshake("none") || die "Failed to set handshake";
$port->write_settings || die "Failed to write settings!";

$waiter=.1;

#Power ON TV
$port->write ("\xF0\xF9\xFE\x01\x00\x00\x00\x00\x00\x00\x08\xFF") || die "Couldnt write data to TV";

undef $port;

When I read the input from the serial port I get all kinds of stuff like this:

Syntax## XPM App Cookie: event[1] paramSize[8] params[0]

XpmNativeRemote.doCallback: received a Key[0] Source[0]

Invalid key:0

MainAppXpm.doCallback: received a 1 at1189377764004





yacu.7a.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. 7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. 7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. 7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. 7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. 7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. 7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. 7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. 7.7.7.7.7.7.7.7.7................................. .................................................. .................................................. .................................................. ....................................Syntax## XPM App Cookie: event[1] paramSize[8] params[0]

XpmNativeRemote.doCallback: received a Key[0] Source[0]

Invalid key:0

MainAppXpm.doCallback: received a 1 at1189377768473

Syntax## XPM App Cookie: event[1] paramSize[8] params[0]

XpmNativeRemote.doCallback: received a Key[0] Source[0]

Invalid key:0

MainAppXpm.doCallback: received a 1 at1189377778772

Syntax## XPM App Cookie: event[1] paramSize[8] params[7]

XpmNativeRemote.doCallback: received a Key[7] Source[0]

MainAppXpm.doCallback: received a 1 at1189377784194

pinIsShowForChannelLock state = false

action = Source.HotKey.XpmBanner:1

########### Apply Source Setting ##########



Orig. Color = 50.000000

Mapping Color = 60.000000



Orig. Tint = 0.000000

Mapping Tint = 3.000000

[3] 0 = CurrentAVprops.SourceVideoProps[SourceID].HPos;

Location of LB Buffers: 03808000

# XPM:Channel: Major = -2 Minor = -2 #

length =0

Syntax## setSource: PresWindow[0x0] SourceId[0x3] result[0x0]



HotKey propName = Source.HotKey.XpmBanner

language = eng value = 0

language = eng value = 0

language = eng value = 0

language = eng value = 0

HotKey.Source

language = eng value = 0

Syntax## XPM App Cookie: event[5] paramSize[12] params[0]

HotKey.Resolution

MainAppXpm.doCallback: received a 5 at1189377784954

XpmNotAcquiredEvent: type=5, reason=3

language = eng value = 0

Syntax## XPM App Cookie: event[1] paramSize[8] params[7]

XpmNativeRemote.doCallback: received a Key[7] Source[0]

MainAppXpm.doCallback: received a 1 at1189377786411

pinIsShowForChannelLock state = false

action = Source.HotKey.XpmBanner:1

****************AtiCore_GpioOPen : handle :67585 *******************

****************AtiCore_GpioSetDir : rval :0 *******************

****************AtiCore_GpioWrite : rval :0 *******************

****************AtiCore_GpioWrite : rval :0 *******************

****************AtiCore_GpioClose : rval :0 *******************

****************AtiCore_GpioOPen : handle :67585 *******************

****************AtiCore_GpioSetDir : rval :0 *******************

****************AtiCore_GpioWrite : rval :0 *******************

****************AtiCore_GpioWrite : rval :0 *******************

****************AtiCore_GpioClose : rval :0 *******************

########### Apply Source Setting ##########



Orig. Color = 50.000000

Mapping Color = 60.000000



Orig. Tint = 0.000000

Mapping Tint = 3.000000

Location of LB Buffers: 03808000

# XPM:Channel: Major = -2 Minor = -2 #

length =0

Syntax## setSource: PresWindow[0x0] SourceId[0x4] result[0x0]



language = eng value = 0

HotKey.Source

language = eng value = 0

************* Vesa Timing Index: 2, Distance: 44 **************

************* DVI Timing Index: 4, Distance: 94**************

HotKey.Resolution

************* Vesa Timing Index: 3, Distance: 44 **************

************* DVI Timing Index: 4, Distance: 94**************

[3] 0 = CurrentAVprops.SourceVideoProps[SourceID].HPos;

########### Apply Source Setting ##########



Orig. Color = 50.000000

Mapping Color = 60.000000



Orig. Tint = 0.000000

Mapping Tint = 3.000000

BCM_ApplyScalingRules : src 0 0 1280 720 - ar 16x9

BCM_ApplyScalingRules : dst 0 0 1366 768 - ar 16x9

adjusted : src 16 8 1248 704 - ar 16x9

adjusted : dst 0 0 1366 768 - ar 16x9

Syntax## XPM App Cookie: event[5] paramSize[12] params[0]

MainAppXpm.doCallback: received a 5 at1189377788009

XpmNotAcquiredEvent: type=5, reason=4

language = eng value = 0

************* Vesa Timing Index: 65, Distance: 1 **************

************* DVI Timing Index: 1, Distance: 1**************

************* Vesa Timing Index: 65, Distance: 1 **************

************* DVI Timing Index: 1, Distance: 1**************

Rob H
September 9th, 2007, 11:31 PM
Sorry, but we can't help you, this has nothing to do with Girder

jakematic
September 10th, 2007, 05:46 AM
Sorry, but we can't help you, this has nothing to do with Girder

Thanks Rob, I do realise that. No other forum or software had referenced what we are trying to do, and I was looking for input.

Based on your response Girder is no longer a product I will suggest for my customers.

Regards-Jake

Rob H
September 10th, 2007, 07:50 AM
If I knew any Perl I might have responded on my own time.

If you'd care to try it in Girder then I can certainly try to help.

Would you honestly expect support from e.g. Microsoft for a Linux problem?

jakematic
September 10th, 2007, 08:18 AM
Thanks Rob, I will look into it. I'm no Perl expert either, just saw another person with similar a similar issue and was attempting another tack on the problem.

At this point I'm not terribly excited about investing in a copy of windows for a single purpose machine. I may give it a go in a VM under Linux to help with the decision.

If Girder will work out of the box, or with some modification, then I am all over it as opposed to re-inventing the wheel. Unfortunately I'm unable to locate the supported platforms list for Girder and have no intention of using XP, Vista or their follow-ons.

Thanks-Jake

Rob H
September 10th, 2007, 08:56 AM
Girder is Windows only - I think Win2K is supported, but we'd generally recommend XP or Vista I'm afraid.

jakematic
September 10th, 2007, 09:02 AM
Right. I knew it was windows based, just haven't used it personally in some time. If it will run on W2K, then it could be the answer.

ZaCkOX
October 31st, 2007, 01:31 AM
http://www.xtremevbtalk.com/showthread.php?t=287795

Sorry it's not same code, but at least it's something, I'm using vb. I can turn on the tv but not off or anything else.

Pinout for RS232C can be found on that page too!

-Good luck and the hope for us too.

zacko900@hotmail.com (I'm on msn too)

jakematic
October 31st, 2007, 05:03 AM
Thanks!

I spent about 2 days on it and basically came up with the same results. It can be turned on, but thats it.

Seems to spit mountains of data out the port, and not listen as I would expect once it is on. The snippet of output above happened in a matter of a couple seconds... In fact the TV is blabbing continuously - I can see the USB/RS232 data light blink whenever it is on.

Haven't followed up with it lately, but hopefully we all can figure it out. Like you said, the worst part was the cable.