NOTE! This site uses cookies and similar technologies.

If you not change browser settings, you agree to it.

I understand

Welcome, Guest
Username: Password: Remember me

TOPIC: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #61

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
Katch wrote:
FIXED IT!

Ok as I suggested above;

add
(rm /var/run/lirc/*.pid; \

don't forget to remove the ( from the kill all line below so it reads
#!/bin/sh
(rm /var/run/lirc/*.pid; \
killall lircd; \
/usr/sbin/lircd --driver=default ......... long command make sure its all on one line
)&

works every single time now

finally some progress with this.. :P .. good job!
I assume there is a lircd running when the autostart.sh script is loaded
and killing it creates the stale pid file ...

I'll rewrite the script to prevent this from happening..

btw you should also try to use the latest version I compile a build almost every day or two
Raspberry Pi Rev2 512MB
CuBox-i4Pro
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #62

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
Step by Step to Using roadkill's pre-built images

You WILL NEED a working Linux environment! You'll also need some way of accessing your Pi via ssh (I'll be using Putty on Windows)
you can use Ubuntu in Live mode (try without installing from the boot options) - I'll be using it in this guide, you may need to alter the commands slightly if you use a different flavour.

Pop your RPi SD card into your Linux machine and boot up.

Make sure you have a working network connection.

Visit openelec.tv/forum/124-raspberry-pi/51887-raspberry-pi-gpio-ir-receiver-with-openelec-compilation-patches-and-snapshot

and download roadkill's latest binary build - at the time of writing it is r12383

www.dropbox.com/s/127bdmdg53c70l3/OpenELEC-RPi.arm-devel-20121106191907-r12383.tar.bz2

While that downloads press ctrl+alt+t and bring up a terminal window.

May as well go into superuser now.
sudo -s
gparted

Run gparted - pops up in a new window - click the drop down on the top left and work out what your RPi SD Card is called (/dev/sdb /dev/sdc etc etc) - mine is /dev/sdb - write this down!

Close gparted and go back to the terminal
cd /home/ubuntu/Downloads
- Downloads is case sensitive - if you are using a different flavour of Linux or downloaded somewhere else change as necessary.
tar -xvf OpenELEC*
you can type the full filename if you want but this will catch it. You should see the list of files as they extract.
cd OpenELEC*
./create_sdcard /dev/sdb
- MAKE SURE YOU GET THE DRIVE RIGHT!!!

That's the end of the SD Card setup -

You will need a working Network Connection on your Pi for this part. I also recommend you conenct a mouse for first boot (to configure network settings and install nano)

First boot is a bit laggy while XBMC updates pluggins so just wait and let it settle. Go to system info - network and note down the IP address. Then go to programs - addons - get more - scroll down and find nano - click it and install.

Once nano is installed reboot your Pi.

After it boots ssh in from putty - username = root / password = openelec

First we create the autostart.sh script to get lirc running with the correct settings at boot.
touch /storage/.config/autostart.sh
chmod +x /storage/.config/autostart.sh
nano /storage/.config/autostart.sh

Type out these lines. The file should be 3 lines long ONLY. If the /usr/sbin... line splits (because you didn't listen and copy pasted from the forum) delete the line break so it sits in one long string.
#!/bin/sh
(kill -9 $(pidof lircd); \
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd --pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf
)&
ctrl+x

Exit answering yes and hit return to save.

Now we need a lircd.conf file for your remote. I had issues when manually creating this file so I found the best choice is to wget it from the lirc sourceforge page. I'm using a RC6 MCE remote so this guide will work for that - if your remote is differnt find a different lircd.conf on that site and alter the next bit accordingly.
wget http://lirc.sourceforge.net/remotes/mceusb/lircd.conf.mceusb

then we need to rename the file we just downloaded and move it to the right place.
cp lircd.conf.mceusb /storage/.config/lircd.conf

Ok now we're ready to
reboot

and.... wait for it.... ta da! Working GPIO IR

As a little last extra step for MCE RC6 remote users I like to add a remote.xml and Lircmap.xml to change the mapping slightly. It changes the power button so that it pops up the power menu instead of suspending the Pi and it adds the ability to zoom in and out using the channel +/- during fullscreen video (useful for getting rid of black bars).

download docs.google.com/open?id=0B3BHPL5gbUMeY1BOUm5ULWRHRms

and extract the 2 files.

Transfer them to the Pi (I use WinSCP)

then log in via ssh and copy them to the correct locations.
cp Lircmap.xml /storage/.xbmc/userdata/Lircmap.xml
cp remote.xml /storage/.xbmc/userdata/keymaps/remote.xml

reboot and enjoy the extra functions.

Hope this guide helps some of you - all credit for the hard work and build goes to roadkill.

Enjoy.
Last Edit: 5 years 1 week ago by Katch.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #63

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
try this autostart.sh
#!/bin/sh
(kill -9 $(pidof lircd); \
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd --pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf; \
)&

it should also do the trick without forcefully removing the file...
Raspberry Pi Rev2 512MB
CuBox-i4Pro
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #64

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
Seems to be working - I'll let you know if I encounter any problems. I'll go ahead and change the guide above to use the new script.

Have you considered releasing your builds as *.img files taken straight from the sd card? You can build them on a 4gb card and then they tar down real small - a simple script can be included to then resize the build to fill different size cards.

just a thought
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #65

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
Katch wrote:
Seems to be working - I'll let you know if I encounter any problems. I'll go ahead and change the guide above to use the new script.

Have you considered releasing your builds as *.img files taken straight from the sd card? You can build them on a 4gb card and then they tar down real small - a simple script can be included to then resize the build to fill different size cards.

just a thought

seems an overkill for such a small feature ... but I'm just getting started
Raspberry Pi Rev2 512MB
CuBox-i4Pro
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #66

  • active89
  • active89's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
Hi guys,

i just tried to compile myself from above git.

After some hours i get following error:
CC     strpool.o
gcc: Fehler: nicht erkanntes Kommandozeilenargument in Option »-mabi=aapcs-linux«
gcc: Anmerkung: gültige Argumente für »-mabi=« sind: ms sysv
gcc: Fehler: nicht erkannte Kommandozeilenoption »-mfloat-abi=hard«
gcc: Fehler: nicht erkannte Kommandozeilenoption »-mfpu=vfp«
make: *** [strpool.o] Fehler 1
Sry, it's german =)

What i found already found out, that i have a newer abi installer installed.
I use lates Ubuntu 12.10

What can i do??
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #67

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
active89 wrote:
Hi guys,

i just tried to compile myself from above git.

After some hours i get following error:
CC     strpool.o
gcc: Fehler: nicht erkanntes Kommandozeilenargument in Option »-mabi=aapcs-linux«
gcc: Anmerkung: gültige Argumente für »-mabi=« sind: ms sysv
gcc: Fehler: nicht erkannte Kommandozeilenoption »-mfloat-abi=hard«
gcc: Fehler: nicht erkannte Kommandozeilenoption »-mfpu=vfp«
make: *** [strpool.o] Fehler 1
Sry, it's german =)

What i found already found out, that i have a newer abi installer installed.
I use lates Ubuntu 12.10

What can i do??
Update git I already pushed the fix from upstream :P
github.com/oferchen/OpenELEC.tv/commit/7ca6d6f50bf1b0f74e05a533d8d14045187baa2f
Raspberry Pi Rev2 512MB
CuBox-i4Pro
Last Edit: 5 years 1 week ago by roadkill.
The administrator has disabled public write access.
The following user(s) said Thank You: active89

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #68

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
Since this:
These patches have been integrated into upstream kernel and were
also updated to use libgpio which is much better than settings pins directly
I will cease compiling once integrated into official OpenELEC.tv

github.com/OpenELEC/OpenELEC.tv/issues/1295

What will be the guide to use IR with GPIO? We don't need load driver and use autostart.sh?
Where is fresh official builds with GPIO IR support located?
Last Edit: 5 years 1 week ago by DmitrySh.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #69

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
I'm waiting for the source to be integrated to get an answer to those questions too
but generally speaking usually xbox,xbox360,mce,rc6 remote variants are supported OOTB
so it will be better than now hopefully

please keep in mind that this is a hack I patched together to satisfy my own needs and it is not yet finished
also I do not know the OpenELEC platform very well (I'm mostly familiar with linux routers
www.linksysinfo.org/forums/showthread.php?t=53233)
Raspberry Pi Rev2 512MB
CuBox-i4Pro
Last Edit: 5 years 1 week ago by roadkill.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #70

  • vicbitter
  • vicbitter's Avatar
  • Offline
  • Gold Boarder
  • Posts: 966
  • Thank you received: 175
  • Karma: 64
DmitrySh wrote:
Since this:
These patches have been integrated into upstream kernel and were
also updated to use libgpio which is much better than settings pins directly
I will cease compiling once integrated into official OpenELEC.tv

github.com/OpenELEC/OpenELEC.tv/issues/1295

What will be the guide to use IR with GPIO? We don't need load driver and use autostart.sh?
Where is fresh official builds with GPIO IR support located?

The patch may have been merged upstream in the RPi kernel but as OpenELEC builds against the official linux kernel (ie. www.kernel.org) the patch still needs to be applied.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #71

  • vicbitter
  • vicbitter's Avatar
  • Offline
  • Gold Boarder
  • Posts: 966
  • Thank you received: 175
  • Karma: 64
Updated kernel patch is available here...
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #72

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
vicbitter wrote:
Updated kernel patch is available here...
thank you, I'm monitoring the conversation at github and already compiling ;) will push after testing
Raspberry Pi Rev2 512MB
CuBox-i4Pro
Last Edit: 5 years 1 week ago by roadkill.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #73

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
What about pins of GPIO? Is connections specifications still actual or we need to reconnect them somehow in another way?
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #74

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
DmitrySh wrote:
What about pins of GPIO? Is connections specifications still actual or we need to reconnect them somehow in another way?
there is no changes in that aspect... just make sure you change the autostart.sh to include modprobe
#!/bin/sh
(kill -9 $(pidof lircd); \
modprobe lirc_rpi; \
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd --pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf; \
)&
hopefully once integrated the next version will be using eventlircd and udev rules to load the module
automatically so no autostart.sh will be needed just turning the device on will be sufficient
Raspberry Pi Rev2 512MB
CuBox-i4Pro
Last Edit: 5 years 1 week ago by roadkill.
The administrator has disabled public write access.
The following user(s) said Thank You: DmitrySh

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #75

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
Great job!!! Thank you once again!!! :woohoo:
The administrator has disabled public write access.