Rpi2 OSMC Alpha 4 and IR GPIO

hello,
my first post here ! yeah ! :sunglasses:
i just got my Rpi 2 and of course i switched from Raspbmc to OSMC. look really good ! i love the installer background…
and system seem to be fast !
Ok, i wanted to know if i can use my Rpi GPIO on the new Rpi2 with OSMC ? i don’t know if it use the same pins on GPIO and found no infos about that…
So if someone have some infos about that… and the pins i must use… it’ll be great.

Again, it’s a really good job SAM. i’m happy to follow and support (even if it’s just a little) you since some years now.

best regards
Chris

1 Like

I would love to know how to also.

I just migrated from raspbmc on my old raspberry pi B to OSMC on my new raspberry pi 2. I copied the lircd.conf file from my raspbmc installation to home/osmc on my new OSMC setup and hooked up the gpio pins as they were on the old pi. I enabled it in the settings app, but the remote doesn’t work.

GPIO should work just as it did on Raspbmc

I assume you’re talking about GPIO remote support. Still working on getting that to work properly

Sam

1 Like

Yes. talking about the remote. Do I have to teach it again, or can I use the lircd.conf from my raspbmc setup?

You should be able to use that configuration, but it seems there are some issues with LIRC at the moment that I need to resolve.

Cheers

Sam

Hello, @sam_nazarko if this information can help you.

I have a new Raspberry 2 with Hyperion ( LED ) and GPIO … they don’t works.

When i that the same led , same position and GPIO on my Raspberry 1 B or my Raspberry 1 B+ it’s works.

I have try too to use the GPIO on Openelec 5.0.1 on Raspberry 2 … Not works too.

I thinks the issues is on the raspberry 2.

thx Sam for replies, i’ll stay tunned.

OK. That’s great. Alpha 5? OSMC looks great but I guess I’ll stick with raspbmc for the moment.

Maybe the GPIO error is related to this?

This seem a good idea… I will try asap.

someone tried the fix ?

Hello Guys,
In the weekend I’ve managed to make the GPIO receiver work with the RPi 2.
Here’s how:
First, you do the steps described here until you manage to teach the remote control.

You don’t need to do the stuff at the beginning, lircd is able to load the kernel module, but if not, you can add it manually to /etc/modules, as described there.
Make sure you get the pulses and spaces (to assure the IR receiver HW is working) when you issue the
mode2 -d /dev/lirc0 command.
Then teach the remote as usual, and generate the config file lircd.conf.
Now, i’ve placed mine in /etc/lirc/lircd.conf. Make sure there are no other lircd.conf files hanging around in /home/osmc or /root/ homefolder, as the lircd script file searches for them.
Then open the /etc/lircd/hardware.conf file and make sure
LOAD_MODULES=true is set. This way, the script will try to load the appropriate kernel module.
Then, make sure the DRIVER=default is set, MODULES=“lirc_rpi” and DEVICE="/dev/lirc0".
Also, you can specify here the LIRCD_CONF file’s path (like LIRCD_CONF="/etc/lirc/lircd.conf"
If this is done, restart the lircd server (/etc/init.d/lirc restart) and if you made no mistakes, the LIRC part shall be done.
To verify, issue the irw command and start pressing the keys on the remote. It should display the ids of the keys you’ve pressed.

Next, it’s time to configure kodi to use the remote keycodes.
You will need to configure a Lircmap.xml file and place it in /home/osmc/.kodi/userdata folder.
If there is none avaialable there, take the default one from here
/usr/share/xbmc/system/
and modify it.
Keep only one entry and make sure that the LIRC button names are correct (keep onet hat has KEY_LEFT, KEY_RIGHT, etc. in it).
Make sure you use the same name for the remote device name with the one configured in /etc/lirc/lircd.conf (if it’s generated, the name is the path where it was created. Feel free to rename it to something more handy, like ‘myremote’)
More info here:
http://kodi.wiki/view/Userdata/lircmap.xml
Place the edited Lircmap.xml file in the /home/osmc/.kodi/userdata/Lircmap.xml and then restart kodi (or the RPi).
Your remote should work now.
If not, start debugging from the beginning. Make sure the spaces pulses are received, then make sure irw is displaying the keycode, then make sure the xml file is correct.
You can issue a ps -aux | grep lirc to check if the lirc daemon is running correctly and that the pid file is available.

EDIT: It looks like eventlircd is messing up somehow the config, as after starting / restarting eventlircd/pi , the lircd was not transmitting keys. Neither was ‘irw’ command working. I’ve tried digging the /etc/eventlirc.d files without success. In the end, i’ve disable enventlircd (service disable eventlircd.service) and then everything was working again. It seems kodi work well without eventlircd.
Maybe somebody know why it’s useful to have this process :).

1 Like

nice @trex_daemon !! i’ll try as soon as possible. i have an harmony one, will config it as an MCE remote like on raspbmc. it’ll be a good idea to share our conf file between users, as people will pick the ones they want. whta do you think about this ? @sam_nazarko do you think it’s a good idea ? it’ll help ya in some way ?

In the last 24 hours we have replaced lircd with a different version and overhauled the whole remote subsystem, so what you describe above is no longer necessary and is probably not valid now. There is still a bit more work to be done but in short:

  1. Make sure you check for and install updates so the latest lirc and eventlircd packages are installed.
  2. Save your lircd.conf at /home/osmc/lircd.conf
  3. If you have a Pi 1 enable GPIO IR remote support in hardware in the OSMC Settings addon, then reboot.

Your remote should now work, but be aware that your lircd.conf key names should adhere to linux-input-layer naming conventions - such as KEY_OK, KEY_UP and so on. (For an example look at /etc/lirc/osmc-remote-lircd.conf)

Currently loading the GPIO module from the hardware support option in the Settings addon is not working on the Pi 2 - but should be working for Alpha 5.

For a quick and dirty hack to load the lirc_rpi module on boot for a Pi 2 you can add the following to /etc/rc.local just before the exit 0 line:

modprobe lirc_rpi

@DBMandrake, The above steps are not working for me on the RPi 1.

I checked for and installed the updates.
I copied the rc6-mce-lircd.conf file to /home/osmc and renamed it lircd.conf
I enabled GPIO IR remote support.

I’m using a Harmony and I programmed it to match the rc6-mce. It worked perfectly in RaspBMC on the same Pi.

Have you rebooted since setting it up?
Can you post the contents of /boot/config.txt

Yes we need more information.

Please post:

/boot/config.txt

Your lircd.conf file.

The output of the following commands:

dpkg -l | grep lirc

and

sudo systemctl status lircd_helper@lirc0

Also please try running the following then pressing buttons on your remote to see if anything is logged:

irw /var/run/lirc/lircd-lirc0

Paste a small sample of what you see (if anything)

Then try:

irw /var/run/lircd

And do the same.

Also please confirm whether you are using a GPIO IR receiver or some other USB based receiver. Thanks.

Yes, I did reboot, sorry, forgot that.

osmc@osmc:~$ cat /boot/config.txt
sdram_freq=400
core_freq=375
over_voltage=0
force_turbo=0
over_voltage_sdram=0
arm_freq=850
initial_turbo=0
start_x=1
dtoverlay=lirc-rpi-overlay
disable_overscan=1
gpu_mem_256=112
gpu_mem_512=144
hdmi_ignore_cec_init=1

The lircd.conf file is a copy of /etc/lircd/rc6-mce-lircd.conf. I’m pretty sure that’s what I did with RaspBMC, but can’t go back and check because I overwrote that SD card.

osmc@osmc:~$ sudo systemctl status lircd_helper@lirc0
* lircd_helper@lirc0.service - lircd remote support
   Loaded: loaded (/lib/systemd/system/lircd_helper@.service; static)
   Active: active (running) since Thu 1970-01-01 00:00:12 UTC; 45 years 1 months ago
  Process: 191 ExecStart=/bin/sh -c /var/run/lirc/lircd-%I.sh (code=exited, status=0/SUCCESS)
 Main PID: 275 (lircd)
   CGroup: /system.slice/system-lircd_helper.slice/lircd_helper@lirc0.service
           `-275 /usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinpu...

Jan 01 00:00:12 osmc sh[191]: lircd: could not open config file '/etc/lirc/...f'
Jan 01 00:00:12 osmc sh[191]: lircd: No such device
Hint: Some lines were ellipsized, use -l to show in full.

dpgk:

osmc@osmc:~$ dpkg -l | grep lirc
rc  liblircclient0                       0.9.0~pre1-1.2            armhf        infra-red remote control support - client library
rc  lirc                                 0.9.0~pre1-1.2            armhf        infra-red remote control support
ii  rbp-eventlircd-osmc                  1.0.13                    armhf        eventlircd for OSMC
ii  rbp-lirc-osmc                        0.9.0-4                   armhf        lirc for osmc
ii  rbp-remote-osmc                      1.0.7                     armhf        Remote support for OSMC, achieved with lirc and eventlircd

Nothing is returned while pressing buttons with:

irw /var/run/lircd/lircd-lirc0

This is what I get with:

osmc@osmc:~$ irw /var/run/lircd
connect: No such file or directory

And yes, I’m using a GPIO IR receiver.

sudo systemctl status lircd_helper@lirc0

That was the clue I needed! I’m using an NFS mount (in /etc/fstab) for /home/osmc (to try and keep read/writes on the SD card to a minimum) and I’m wondering if lircd was trying to start before the mount. I could read the conf file via /etc/lirc/lircd.conf after the boot, but I guess it couldn’t read it when starting?

I removed the sym link for /etc/lirc/lircd.conf and replaced it with my real conf file and now the remote works!

Thanks for the help!

Cool