Solved

How to tweak the serial port settings to make Linux recognize my IR receiver

Posted on 2008-10-23
12
1,174 Views
Last Modified: 2013-12-16
I'm trying to make my custom make infrared receiver /for remote control/  work under Linux with Lirc.
I've searched the inet quite a bit and my worries are that although Linux sees that there's "something" attached to the serial port I can't make it recognize the incoming data sent from the IR receiver. In other words people report the command
cat /dev/ttyS0
causing garbage characters to be dumped on the console whereas I don't seem to be getting anything at all.
The only good news is that after issuing the above command my IR receiver becomes alive - the LED responds to my remote control, alas without any data coming in. The receiver works fine under WinXP - I'm using girder with the Igor SFH-56 driver
Any comments, suggestions, recommendations greatly appreciated!
0
Comment
Question by:tlatev
  • 6
  • 6
12 Comments
 
LVL 20

Expert Comment

by:edster9999
Comment Utility
I have not seen this one.  I don't know if a driver exists for it under Lirc
It is not listed under the supported receivers :
http://www.lirc.org/receivers.html

You could try the generic serial setup but your one will probably need something sent to it to start the ball rolling (thats why you get no data when you cat the com port)
0
 
LVL 20

Expert Comment

by:edster9999
Comment Utility
from :
https://bugs.launchpad.net/ubuntu/+source/lirc/+bug/138247

The current snapshot of lirc doesn't support Home-brew serial-port driver Igor Cesko's variation. During lirc installation user can only select "Home-brew serial-port driver", which does not work with Igor Cesko's variation.

Why we should have support for this dongle? Because is very, very cheap and very easy to build, see link http://www.cesko.host.sk/girderplugin.htm. I've been using this kind of dongles for years.

Proposed solution:
New configuration based on "Home-brew serial-port" should be added, the only difference between normal "Home-brew serial-port" and Igor Cesko's variation is in config file lirc-modules-source.conf. It should contain this options:
LIRC_SERIAL_CFLAGS=" -DLIRC_SERIAL_SOFTCARRIER -DLIRC_SERIAL_IGOR"

Please see also https://help.ubuntu.com/community/Install_Lirc_Feisty how to build Home-brew serial-port driver Igor Cesko's variation on Feisty.
0
 

Author Comment

by:tlatev
Comment Utility
Thanks for the replies!

The link
https://help.ubuntu.com/community/Install_Lirc_Feisty
Produces: "This page does not exist yet. You can create a new empty page, or use one of the page templates."

In the meantime I managed to do some progress
I did a fresh install of Ubuntu 8.04 x64 and it seems that the lirc package has been updated as it now comes with the lirc_serial_igor module precompiled. Following the instructions I disabled the serial port
setserial /dev/ttyS0 uart none
and then issued the command
sudo modprobe lirc_serial_igor
which produced the following lines in dmesg
[ 2633.014157] lirc_dev: IR Remote Control driver registered, major 61
[ 2633.512141] lirc_serial_igor: auto-detected active high receiver
[ 2633.512146] lirc_dev: lirc_register_plugin: sample_rate: 0
I forgot to mention that after disabling the serial port my IR receiver stops responding to my remote, however after I loaded the driver it seems to be getting the signals
At this point according to the instructions I found I'm supposed to cat the /dev/lirc0 char device which should dump the input from my remote on the console
This however is not happening  - I'm still getting no input whatsoever despite the LED activity on the IR receiver

Any suggestions on how to proceed ?
I'd really like to debug whats going on with this driver but I don't know how to do that

edster9999,
I noticed in my lirc-modules-source.conf file the relevant line reads
LIRC_SERIAL_CFLAGS=" -DLIRC_SERIAL_TRANSMITTER"
instead of what you suggested
I was wondering whether I should try recompiling the lirc package after changing that line - do you think that may hold the key to solving the issue?
0
 

Author Comment

by:tlatev
Comment Utility
MAJOR UPDATE:
I decided to try the other /non Igor/ module with lirc to see how it's handling my remote and I think I had a breakthrough - I managed to get some input from the remote after cat-ing the lirc0 device, however the lirc daemon now refuses to start with the message
[ 8797.600983] lirc_serial: no version for "lirc_unregister_plugin" found: kernel tainted.
0
 
LVL 20

Expert Comment

by:edster9999
Comment Utility
That sounds like you have got modules from two different versions installed.
Try removing both versions and any files you can find and recompiling again.
0
 

Author Comment

by:tlatev
Comment Utility
No, I got it working now - turned out I had an instance of lircd running, I haven't compiled anything I used the debs from the repos
So far so good, I'm struggling with the irrecord now - won't recoginze my remote
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 20

Expert Comment

by:edster9999
Comment Utility
Two things spring to mind.  I can not test (obviously) so you'll have to play or wait for someone to give better guidance on this :

1. You might need a link to the com port for irrecord
try
ln -s /dev/ttyS0 /dev/lirc
and remove it after the recording is made before you retest

2. irrecord can be fickle with non standard remotes.
I had one called an IR-MAN and irrecord didn't work.  i think I had to use another program (ircat ?) and write down all the values and type them back into the file
0
 

Author Comment

by:tlatev
Comment Utility
Here's what I do

1) Disable the com1 port, so the kernel and lirc stop fighting over who gets control of it
2) load the lirc_serial module - sudo modprobe lirc_serial, which produces the following messages in dmesg
[ 5160.828128] lirc_dev: IR Remote Control driver registered, major 61
[ 5161.326682] lirc_serial: auto-detected active high receiver
[ 5161.326688] lirc_dev: lirc_register_plugin: sample_rate: 0
3) test that things are going alright so far with
tl@AMD64:~$ sudo cat /dev/lirc0
C.H/ý3ý>::ý       6cý<ý>ý=ýFý=ý>ý+ý@ýkývý>ý=ýtý>ý+ý3oý&.ýG7Qe?ýfIý;

the garbage you see after the command is the input from the remote control

Then I try to configure my JVC remote control with irrecord
tl@AMD64:~$ sudo irrecord -d /dev/lirc0 jvc
irrecord -  application for recording IR-codes for usage with lirc

Copyright (C) 1998,1999 Christoph Bartelmus(lirc@bartelmus.de)

This program will record the signals from your remote control
and create a config file for lircd.


A proper config file for lircd is maybe the most vital part of this
package, so you should invest some time to create a working config
file. Although I put a good deal of effort in this program it is often
not possible to automatically recognize all features of a remote
control. Often short-comings of the receiver hardware make it nearly
impossible. If you have problems to create a config file READ THE
DOCUMENTATION of this package, especially section "Adding new remote
controls" for how to get help.

If there already is a remote control of the same brand available at
http://www.lirc.org/remotes/ you might also want to try using such a
remote as a template. The config files already contain all
parameters of the protocol used by remotes of a certain brand and
knowing these parameters makes the job of this program much
easier. There are also template files for the most common protocols
available in the remotes/generic/ directory of the source
distribution of this package. You can use a template files by
providing the path of the file as command line parameter.

Please send the finished config files to <lirc@bartelmus.de> so that I
can make them available to others. Don't forget to put all information
that you can get about the remote control in the header of the file.

Press RETURN to continue.


Now start pressing buttons on your remote control.

It is very important that you press many different buttons and hold them
down for approximately one second. Each button should generate at least one
dot but in no case more than ten dots of output.
Don't stop pressing buttons until two lines of dots (2x80) have been
generated.

Press RETURN now to start recording.
................................................................................
Found const length: 45886
Please keep on pressing buttons like described above.
................................................................................
RC-6 remote control found.
No header found.
No repeat code found.
Signals are biphase encoded.
Signal length is 33
Checking for toggle bit mask.
Please press an arbitrary button repeatedly as fast as possible.
Make sure you keep pressing the SAME button and that you DON'T HOLD
the button down!.
If you can't see any dots appear, then wait a bit between button presses.

Press RETURN to continue.

No toggle bit mask found.
But I know for sure that RC6 has a toggle bit!

And I can't get past this stage :(
0
 
LVL 20

Expert Comment

by:edster9999
Comment Utility
The random digits might suggest the wrong frequency on the serial port.
You might need to set it before you run lirc.
does the instruction for the device have any set frequency ?
0
 

Author Comment

by:tlatev
Comment Utility
No, I don't have any instructions at all for that device.
Also I haven't looked at it closely but the numbers might not be as random as they appear on this post - it's because of the encoding. That's a good idea actually - I'll dump the remote input in hex and post it here again
0
 
LVL 20

Accepted Solution

by:
edster9999 earned 250 total points
Comment Utility
repeat the same button a few times and see if it gives the same.  Then swap to other buttons - hopefully different values but that they stay the same for each button if that makes sense.
0
 

Author Closing Comment

by:tlatev
Comment Utility
Thanks for all the replies man, I finally got it working - turns out my IR is supported and contrary to my expectations it is NOT an Igor device - go figure
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now