LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-06-2011, 12:42 AM   #1
hack_tick
LQ Newbie
 
Registered: Oct 2011
Location: India
Distribution: Ubuntu
Posts: 2

Rep: Reputation: Disabled
Question Reading TV remote signal using custom IR module connected on serial port.


Hi,
This is my first post at LQ so please pardon me if I am posting the wrong question in this group and point me to the correct location.

I have build a custom IR module which connects on Serial port, using off-the-shelf components and tested the same via terminal client and various receivers, the module seems to be working absolutely fine when I am transmitting the data between two computers, but when I try to record the TV-remote signal and transmit it back to the TV nothing works and I am not sure how to debug it.

I have tried to record data at various baud rate including B50 - B9600 - B38400 - B115200 and every thing else in between over /dev/ttyS0, and manage to capture the exact same data (data changes with baud rate) every time from remote (LG AKB72915207) I dump the data along with timing information into a file, and then I use the same data and transmit back to the TV which does not seem to be producing any effect, I have tried sending data from different distance and again it never seems to work, also I can see the LED lights glowing when I see through camera.

I capture the data by fopen - /dev/ttyS0 and set the baud rate, before I start read/write.
(my code is based on http://en.wikibooks.org/wiki/Serial_...g/Serial_Linux)

I have configured the LIRC on my system, I could not get the recording to work, but it is able to send the data from its remote database properly and TV seems to be reacting properly with my module+LIRC combination.

So the question.
- Is this a valid asumption that I can read TV remote data over serial port?
- Should I do the way LIRC does, replace the standard drivers and do the low level IO myself?
- How would you capture the TV IR remote data and transmit without using LIRC? (I am not looking for a C-program, though it would be great if I get one; just some hint from top of your mind).

Thanks all, even for reading.

Last edited by hack_tick; 10-06-2011 at 12:46 AM. Reason: Bad subject line
 
Old 10-06-2011, 12:01 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Quote:
Originally Posted by hack_tick View Post
So the question.
- Is this a valid asumption that I can read TV remote data over serial port?
- Should I do the way LIRC does, replace the standard drivers and do the low level IO myself?
- How would you capture the TV IR remote data and transmit without using LIRC? (I am not looking for a C-program, though it would be great if I get one; just some hint from top of your mind).

Thanks all, even for reading.
Serial ports usually send and receive 8-bit data with start, stop and parity bits around it. But IR data is some 14-bit format or totally proprietary. How are you dealing with that?

http://en.wikipedia.org/wiki/RC-5

You might have better luck using the parallel port. Bring the data in on one bit and send data out on another. By clocking at 8X the bit rate or so and watching for the start bit, then sample in the middle of each subsequent bit and shift to get the received word.
 
1 members found this post helpful.
Old 10-07-2011, 06:09 AM   #3
hack_tick
LQ Newbie
 
Registered: Oct 2011
Location: India
Distribution: Ubuntu
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you for your reply!

Quote:
You might have better luck using the parallel port. Bring the data in on one bit and send data out on another. By clocking at 8X the bit rate or so and watching for the start bit, then sample in the middle of each subsequent bit and shift to get the received word.
This is what I am trying to achieve, typically baud rate for TV remote is B9600 or lower, and when I capture the data at B115200 and play the same back at B115200, the output signal should be "in theory" same as the one send by remote and TV should react, it is possible there are some TV out there which might require additional dynamic information, but I have tested that the TV remote I am using is sending same "dumb" data every time.

I hope I was able to relate with your comments properly, please point if I am missing any thing.

Thanks.
 
Old 10-07-2011, 02:33 PM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Quote:
Originally Posted by hack_tick View Post
Thank you for your reply!



This is what I am trying to achieve, typically baud rate for TV remote is B9600 or lower, and when I capture the data at B115200 and play the same back at B115200, the output signal should be "in theory" same as the one send by remote and TV should react, it is possible there are some TV out there which might require additional dynamic information, but I have tested that the TV remote I am using is sending same "dumb" data every time.

I hope I was able to relate with your comments properly, please point if I am missing any thing.

Thanks.
Sounds good to me. If you know you are sampling at a much higher rate than the signal, you can also apply some digital filtering to square up the data. Removing 1- or 2-bit noise elements for example.
Sounds like a neat project!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble reading from serial port. rkjnsn Programming 13 12-04-2009 11:57 PM
Serial port reading jayadhanesh Linux - Newbie 3 05-19-2009 06:54 PM
Reading and Writing to a Serial Port without SU Steef223 Programming 2 06-16-2008 09:16 AM
reading from serial port IC009562 Linux - Software 2 11-08-2007 11:25 PM
Need help to read a signal from the CTS pin of a serial port juan_de_margo Linux - Hardware 0 02-24-2005 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration