mba
Posts: 110
Joined: Fri Jun 08, 2012 7:05 pm
Location: Denmark

Re: LIRC GPIO driver for homebrew adapter

Mon Aug 13, 2012 3:28 pm

No problem, glad that I could help.
I can't seem to edit my previous post and correct the missing sudo, but ok if thats the only problem I guess you'll figure it out.

But anyway this is not the most elegant solution, maybe a debian package or if the patch from aron could get accepted into the main tree, it would be a bit more user-friendly.

@Aron are you still looking at updating the driver getting it accepted?
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.

klims
Posts: 7
Joined: Wed Jul 25, 2012 4:46 am

Re: LIRC GPIO driver for homebrew adapter

Mon Aug 13, 2012 10:38 pm

@MBA - are you able to send commands with irsend using the instructions you posted?
I'm having some trouble with this. I get the error:
Irsend: could not connect to socket
Irsend: no such file or directory

Cheers

klims
Posts: 7
Joined: Wed Jul 25, 2012 4:46 am

Re: LIRC GPIO driver for homebrew adapter

Tue Aug 14, 2012 11:14 am

It seems like my problem was lircd not being started.

The directory /var/run/lirc is never created as expected in the /etc/init.d/lirc file and so lircd cannot start.
I'm not sure if the lirc script is not running or the mkdir command is not working.

If I run the mkdir command manually and start lircd I can use the irsend command.
Any ideas?

mba
Posts: 110
Joined: Fri Jun 08, 2012 7:05 pm
Location: Denmark

Re: LIRC GPIO driver for homebrew adapter

Tue Aug 14, 2012 7:01 pm

hmm, the mkdir in the init script was actually just a quick work-around because the /var/run gets emptied on each reboot. Are there symbolic links to /etc/init.d/lirc in the right rcX.d folders? If so the lircd should be started on reboot, then its a matter of the folder not being created for some reason.
Try removing the mkdir lines in the script and replace them with
sudo mkdir -p /var/run/lirc
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.

klims
Posts: 7
Joined: Wed Jul 25, 2012 4:46 am

Re: LIRC GPIO driver for homebrew adapter

Wed Aug 15, 2012 11:56 am

I don't think I have the symbolic links right :-(

When I try to run the command "update-rc.d lirc defaults 20" as suggested in the lirc file I get the error:
insserv: script lirc is not an executable regular file, skipped!

Can anyone tell me what rcX.d folder/file should have a symbolic link in?

mba
Posts: 110
Joined: Fri Jun 08, 2012 7:05 pm
Location: Denmark

Re: LIRC GPIO driver for homebrew adapter

Wed Aug 15, 2012 12:41 pm

maybe it has lost its executable flag somehow? Try running
sudo chmod +x /etc/init.d/lirc
and then call
sudo update-rc.d lirc defaults

update-rc.d should place a symbolic link in the default rcX.d folders, so you don't have to do it manually.

Note: its actually wrong in my installation steps when I say to call insserv, I have learned afterwards that you should not call this directly, instead (as you have found in the lirc script) you should call update-rc.d.
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.

klims
Posts: 7
Joined: Wed Jul 25, 2012 4:46 am

Re: LIRC GPIO driver for homebrew adapter

Thu Aug 16, 2012 11:15 am

Spot on mba!
chmod +x allowed me to run update-rc.d and got lircd running on startup.

While lirc seems to be running OK, I see a message on startup complaining about the fact that kernel expects /dev/lirc0 while is configured is /dev/lirc/0

Thanks again for the help mba

mba
Posts: 110
Joined: Fri Jun 08, 2012 7:05 pm
Location: Denmark

Re: LIRC GPIO driver for homebrew adapter

Thu Aug 16, 2012 1:55 pm

Thats odd, does it complain about not finding /dev/lirc0 when you start lircd?

the contrib/lirc.rules should create the /dev/lirc/0 and when lird is started from /etc/init.d/lirc it should use /dev/lirc/0

does your /etc/init.d/lirc script contain --device=/dev/lirc/0 both in and start and restart cases?
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.

Dilligaf
Posts: 283
Joined: Wed May 23, 2012 6:48 pm

Re: LIRC GPIO driver for homebrew adapter

Tue Aug 21, 2012 4:16 am

Don't know it aaron is still monitoring this thread but only one small thing that stops this from being perfect. I really miss the flashing led feedback I get from my normal IR receiver, is there a possibility to code in an optional LED feedback pin? A gpio pin that momentarily grounds when the IR receiver receives a signal could be wired to an LED providing visual feedback when a signal is received. If not, I'm sure I'll survive :) Thank you for this awesome piece of code.

Mike

cleverca22
Posts: 2345
Joined: Sat Aug 18, 2012 2:33 pm

Re: LIRC GPIO driver for homebrew adapter

Tue Aug 21, 2012 4:15 pm

simplest answer, wire an led directly on the same pin as the reciever module

if that doesnt work, it can easily be patched to eat another pin

mba
Posts: 110
Joined: Fri Jun 08, 2012 7:05 pm
Location: Denmark

Re: LIRC GPIO driver for homebrew adapter

Tue Aug 21, 2012 7:41 pm

I hate to be cross-posting but maybe this could interest some of you reading on this LIRC gpio driver thread.

My personal goal with having a LIRC server and IR blaster connected to the Raspberry Pi was to develop an universal remote for my Android phone. This way I can control my amplifier, tv and other IR based hifi components in my livingroom. See my project details here http://www.raspberrypi.org/phpBB3/viewt ... 35&t=15258
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.

mba
Posts: 110
Joined: Fri Jun 08, 2012 7:05 pm
Location: Denmark

Re: LIRC GPIO driver for homebrew adapter

Wed Aug 22, 2012 7:08 pm

Is it just me or is the IRs left 'on' all the time. I think the fix with GPIO_CLEAR_PIN is actually setting the pin high all the time after a transmission. If I replace it with GPIO_SET_PIN the IRs are turned off independent of the last bit of the transmitted code.
Maybe the ouput has pull-up enabled? Or it is inverted?
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.

klims
Posts: 7
Joined: Wed Jul 25, 2012 4:46 am

Re: LIRC GPIO driver for homebrew adapter

Wed Aug 22, 2012 9:48 pm

mba wrote:Is it just me or is the IRs left 'on' all the time. I think the fix with GPIO_CLEAR_PIN is actually setting the pin high all the time after a transmission.
Nope not just you. I see the same behaviour, although I figured it was probably just because I hand't implemented your fix correctly.

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Aug 23, 2012 1:13 pm

Is this code in the 3.2 kernel now or do I have to patch it?

mba
Posts: 110
Joined: Fri Jun 08, 2012 7:05 pm
Location: Denmark

Re: LIRC GPIO driver for homebrew adapter

Fri Aug 24, 2012 8:07 pm

klims wrote:
mba wrote:Is it just me or is the IRs left 'on' all the time. I think the fix with GPIO_CLEAR_PIN is actually setting the pin high all the time after a transmission.
Nope not just you. I see the same behaviour, although I figured it was probably just because I hand't implemented your fix correctly.
hmm, I will take a look at things with a oscilloscope when I get some time, the curcuit I built shouldn't invert the signal, and as far as I can measure with a multimeter the gpio pin 0 I am using is somewhat high when the driver has finished transmitting. Also when insmodding the driver at first the leds are driven high, which is not good as I am heavily overdriving the leds.
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.

psypi
Posts: 3
Joined: Tue Jul 31, 2012 11:45 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Sep 06, 2012 10:26 pm

I've just run an update on wheezy and I now think I'm on 3.2.27.
This seems to have broken lirc
I have followed the 33 step guide in this post to rebuild lirc but have got into trouble.
step 30 did not work; it could not find lirc_dev.ko to copy, the file location now is..
/lib/modules/3.2.27+/kernel/drivers/media/rc/lirc_dev.ko - so I have chaged the command accordingly
There is also a 3.2.27-cutdown+ folder in /lib/modules/ so I have copied it to a similar location within this branch, and completed the remaining steps.
I still can't get lirc working again, is the method above valid or will it need a slightly different patch.
dmesg - reports - lirc_dev: disagrees about version of symbol module_layout

PS - I didn't uninstall lirc before attempting to rebuild it, but I did delete the ~/lirc build directory

psypi
Posts: 3
Joined: Tue Jul 31, 2012 11:45 pm

Re: LIRC GPIO driver for homebrew adapter

Thu Sep 06, 2012 10:42 pm

Ah, just spotted in step 4 I should have got the 3.2.27 version of the tar.gz
I'll give that a go
feeling a bit twp.

bobguk
Posts: 1
Joined: Fri Sep 07, 2012 6:33 pm

Re: LIRC GPIO driver for homebrew adapter

Fri Sep 07, 2012 6:46 pm

great set of instructions. I am having trouble in getting the transmit side to work.

Code: Select all

pi@raspberrypi ~ $ sudo irsend SEND_ONCE TECHNISAT_ST3004S ARROW_LEFT
returns :-

irsend: command failed: SEND_ONCE TECHNISAT_ST3004S ARROW_LEFT
irsend: hardware does not support sending

I have tried compiling with the --with-transmitter switch but have no idea what to try next. All ideas welcome

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: LIRC GPIO driver for homebrew adapter

Mon Sep 24, 2012 9:09 pm

Hey guys, I know you've done some nice work getting a GPIO version together, but since I'm not using my USB ports I wonder if anyone has tried something like: http://www.huitsing.nl/irftdi/
?

Will still probably need some LIRC patching, so seems worth keeping the threads together? Thanks!

the.hcd
Posts: 6
Joined: Thu Aug 09, 2012 9:55 am

Re: LIRC GPIO driver for homebrew adapter

Thu Sep 27, 2012 9:30 pm

Hi all,

I've followed the instructions on the latest raspbian

Code: Select all

root@raspberrypi:/lib/modules/3.2.27+/misc# uname -a
Linux raspberrypi 3.2.27+ #160 PREEMPT Mon Sep 17 23:18:42 BST 2012 armv6l GNU/Linux
and have ended up getting something built,
however, I get

Code: Select all

Sep 27 23:16:54 raspberrypi kernel: [ 5516.526943] lirc_rpi: disagrees about version of symbol module_layout
when I try to insmod.

I guess there is something wrong in the early stage:
I've tried changing the refernce to the 3.1.9 to 3.2.27

Code: Select all

sudo wget -O raspberrypi-linux-3.2.27.tar.gz https://github.com/raspberrypi/linux/tarball/rpi-patches
sudo tar xzf raspberrypi-linux-3.2.27.tar.gz
sudo ln -s /usr/src/raspberrypi-linux-775d4ce /lib/modules/`uname -r`/build
cd /usr/src/raspberrypi-linux-775d4ce

I'm not sure what version /usr/src/raspberrypi-linux-775d4ce is....
but the makefile seems to think its 3.1.9

ie:
https://github.com/raspberrypi/linux/bl ... s/Makefile

Code: Select all

VERSION = 3
PATCHLEVEL = 1
SUBLEVEL = 9
EXTRAVERSION = +
NAME = "Divemaster Edition"
Has anyone confirmed this? Or am I doing something stupid :)

selectnone
Posts: 55
Joined: Fri Jun 22, 2012 10:16 pm

Re: LIRC GPIO driver for homebrew adapter

Mon Oct 01, 2012 10:56 pm

I'm a bit puzzled myself - I'm trying to get Lirc working on the latest Raspbian but haven't had any luck building it - with aron or mba's instructions...

Does anyone know if any of this stuff is going to be included in Raspbian or Lirc by default? That'd make this all a whole lot easier!

bitbitbit
Posts: 30
Joined: Thu Aug 30, 2012 3:18 am

Re: LIRC GPIO driver for homebrew adapter

Wed Oct 03, 2012 5:51 am

Hi there....

I'm getting error messages when running ./autogen.sh

./autogen.sh: 4: ./autogen.sh: autoreconf: not found
./autogen.sh: 7: ./autogen.sh: automake: not found
cat: configure: No such file or directory
Creating setup-driver.sh ...
rpi: There is no param type, but default parameter is none, should be OK

How should I fix it??

By the way, I have a remote control, how do I know what frequency it gives out and how can I configure Pi to "read" each remote button?..

Thanks!!

the.hcd
Posts: 6
Joined: Thu Aug 09, 2012 9:55 am

Re: LIRC GPIO driver for homebrew adapter

Wed Oct 03, 2012 8:53 am

Hi bitbitbit, you need to apt-get the dependencies before you can build. (check the 33 steps instructions)
sudo apt-get install libtool
sudo apt-get install autoconf
sudo apt-get install git

after compiling, you install and configure with irrecord.
Although you probably don't need to compile the lirc_gpio module as you are not using a IR receiver via GPIO input. In the latest release the lirc module should work. jsut configure it as described in http://www.lirc.org/

naicheben
Posts: 344
Joined: Sat Jan 28, 2012 12:28 pm
Contact: Website

Re: LIRC GPIO driver for homebrew adapter

Wed Oct 03, 2012 6:47 pm

I have problems getting lirc_rpi to work on raspian.
In Raspian (kernel 3.2.27) the drivers for lirc are located in drivers/staging/media/lirc
The patch looks for the files in drivers/staging/lirc
I changed the patch to match the new location. But was it really nessesary? :?:

To activate the module in the Kernel I run make menuconfig and opened:
Device Drivers -> Staging Drivers -> Media staging drivers -> Linux Infrared Remote Control IR ...->
and marked Homebrew GPIO as a module (m)

Now I did make modules and this will take some time ....

selectnone
Posts: 55
Joined: Fri Jun 22, 2012 10:16 pm

Re: LIRC GPIO driver for homebrew adapter

Wed Oct 03, 2012 10:26 pm

naicheben wrote:I have problems getting lirc_rpi to work on raspian.
In Raspian (kernel 3.2.27) the drivers for lirc are located in drivers/staging/media/lirc
The patch looks for the files in drivers/staging/lirc
I changed the patch to match the new location. But was it really nessesary? :?:

To activate the module in the Kernel I run make menuconfig and opened:
Device Drivers -> Staging Drivers -> Media staging drivers -> Linux Infrared Remote Control IR ...->
and marked Homebrew GPIO as a module (m)

Now I did make modules and this will take some time ....
Ahah, that sounds promising! I'll see if I can get that going myself

Return to “HATs and other add-ons”