IR remote problems

Raspberry Pi related support

IR remote problems

Postby Frost_dk » 26 Jan 2017, 20:09

Hi all.
Does some you have a GPIO IR remote up and running with the latest build?
I have tried almost anything, and have also searched the web after guides. I have tried the guides I could find, but none of them with success.
i am not getting anything returned at all, when I use the IRW command.
I am trying to use a Apple A1294 remote, and have build a lirc.conf file by installing volumio by using the guides.. The remote is working in volumio..

If anyone has a guide that actually works, then please let me know :)

Regards,

Rune Frost
Frost_dk
 
Posts: 44
Joined: 23 Nov 2015, 20:39
Location: Horsens, Denmark

Re: IR remote problems

Postby s.k. » 27 Jan 2017, 06:20

My skills are limited but after a lot of tries and errors I ended up with the following.
It works ok with the latest version.


1) Edit /boot/config.txt file
Find these three lines in the file:

#dtoverlay=lirc-rpi
#dtparam=gpio_out_pin=7
#dtparam=gpio_in_pin=17

Uncomment ONLY THEM

(My remote uses gpio_in_pin=17 & gpio_out_pin=7 by default – modify yours accordantly)

2) Create /etc/conf.d/lircd.conf
And paste this into the file:

LIRCD_ARGS="--uinput"
DRIVER="default"
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

3) Reboot your Pi

4) Create the lircd.conf File to /etc/lirc/lircd.conf.d/lircd.conf

it depends from your remote, for my remote looks like :

begin remote
name remote-lircd.conf
bits 16
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9029 4446
one 607 1630
zero 607 497
ptrail 607
repeat 9034 2182
pre_data_bits 16
pre_data 0xFF
gap 107947
toggle_bit_mask 0x0
begin codes
KEY_HOME 0x609F
KEY_BACK 0x18E7
KEY_UP 0x629D
KEY_DOWN 0x6897
KEY_LEFT 0xE21D
KEY_RIGHT 0xA857
KEY_OK 0xAA55
KEY_PLAY 0x02FD
KEY_STOP 0x20DF
KEY_FASTFORWARD 0x0AF5
KEY_REWIND 0x2AD5
KEY_VOLUMEUP 0x28D7
KEY_VOLUMEDOWN 0x08F7
end codes
end remote

5) Test your LIRC setup
Type in the following command to start LIRC:

systemctl start lircd

And then type in this command:

irw

Now press buttons on your remote, you should see these presses in the console, if everything is right.

6) Enable LIRC on startup

Type in the following command:

systemctl enable lircd

7) Now you have to match the above remote keys with actions.

Create the lircrc file to /etc/conf.d/lircrc

it depends from your remote, for my remote looks like :
...
...
begin
prog = irexec
button = KEY_REWIND
delay=75
delay_start=0
config = sudo reboot;blink 27
end
begin
prog = irexec
button = KEY_UP
config = AlbumCmd next;blink 27
end
begin
prog = irexec
button = KEY_DOWN
config = AlbumCmd prev;blink 27
end
begin
prog = irexec
button = KEY_LEFT
config = mpc prev;mpc play;blink 27
end
begin
prog = irexec
button = KEY_RIGHT
config = mpc next;mpc play;blink 27
end
begin
prog = irexec
button = KEY_OK
config = mpc toggle;blink 27
end
begin
prog = irexec
button = KEY_STOP
config = mpc stop;blink 27
end
...
...

8) Create a Start irexec daemon
/usr/lib/systemd/system/irexec.service

And paste the following :

[Unit]
Description=Start irexec daemon
Wants=lircd.service
After=mpd.service

[Service]
Type=simple
ExecStart=/usr/bin/irexec /etc/conf.d/lircrc
TimeoutSec=0
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

9) Enable IREXEC on startup

systemctl enable irexec.service

10) Reboot

i hope it works for you too
regards
Stavros
s.k.
 
Posts: 113
Joined: 04 Jan 2017, 08:38

Re: IR remote problems

Postby Frost_dk » 27 Jan 2017, 09:09

Frost_dk
 
Posts: 44
Joined: 23 Nov 2015, 20:39
Location: Horsens, Denmark

Re: IR remote problems

Postby s.k. » 27 Jan 2017, 10:19

Hi Rune Frost,
Please follow exactly the instractions and try again.

For Apple remote (A1294) the correct lircd.conf (/etc/lirc/lircd.conf.d/lircd.conf)
is this :

###########################################
begin remote

name apple
bits 8
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100

header 9047 4465
one 570 1654
zero 570 553
ptrail 569
pre_data_bits 16
pre_data 0x77E1
post_data_bits 8
post_data 0x3A
gap 107096
toggle_bit_mask 0x0
repeat 9083 2240

begin codes
KEY_UP 0xD0
KEY_DOWN 0xB0
KEY_OK 0xBA 0x20
KEY_LEFT 0x10
KEY_RIGHT 0xE0
KEY_MENU 0x40
KEY_PLAYPAUSE 0x7A 0x20
end codes

end remote
############################################

Again for the same Apple remote (A1294) the correct lircrc (not ".lircrc") placed in /etc/conf.d/lircrc is this :

###################################
begin
prog = irexec
remote = apple
repeat = 0
button = KEY_PLAYPAUSE
config = mpc toggle
end
begin
prog = irexec
remote = apple
button = KEY_RIGHT
repeat = 0
config = mpc next
end
begin
prog = irexec
remote = apple
button = KEY_LEFT
repeat = 0
config = mpc prev
end
begin
prog = irexec
remote = apple
button = KEY_UP
delay = 2
repeat = 10
config = mpc volume +2
end
begin
prog = irexec
remote = apple
button = KEY_DOWN
delay = 2
repeat = 10
config = mpc volume -2
end
begin
prog = irexec
remote = apple
button = KEY_MENU
button = KEY_DOWN
button = KEY_OK
repeat = 0
config = systemctl poweroff
end
#################################

Tip: remote name in the "lircd.conf" must be match with the remote name in "lircrc"

regards
Stavros

PS
for shutdown i thing that instead of "systemctl poweroff" is better the " /var/www/command/rune_shutdown"
Frank can be more helpfull on that
RPi2B Rev 1.1, Allo DigiOne, ATXRaspi, 16x2 OLED display - running rAudio
s.k.
 
Posts: 113
Joined: 04 Jan 2017, 08:38

Re: IR remote problems

Postby Frost_dk » 27 Jan 2017, 16:55

Frost_dk
 
Posts: 44
Joined: 23 Nov 2015, 20:39
Location: Horsens, Denmark

Re: IR remote problems

Postby s.k. » 27 Jan 2017, 20:02

No, i get this :

[root@RuneAudio ~]# cat /sys/kernel/debug/gpio
GPIOs 0-53, platform/3f200000.gpio, pinctrl-bcm2835:
gpio-5 ( |clock44 ) out hi
gpio-6 ( |clock48 ) out lo
gpio-7 ( |sysfs ) in lo
gpio-8 ( |sysfs ) out hi
gpio-22 ( |sysfs ) out hi
gpio-27 ( |sysfs ) out hi
gpio-35 ( |? ) in hi
gpio-47 ( |? ) out lo
[root@RuneAudio ~]#

But keep in mind that i use a LCD display (probably 35&47),an IR with 2 leds (22&27), a digi+ pro (5&6) & an ATXraspi (7&8).

What kind of receiver do you have ?
Take a look at "https://learn.adafruit.com/using-an-ir-remote-with-a-raspberry-pi-media-center/overview" for IR-receiver based on the TSOP38238 or "http://derekmolloy.ie/raspberry-pi/" for an IR-reciever based on the TSOP34838
RPi2B Rev 1.1, Allo DigiOne, ATXRaspi, 16x2 OLED display - running rAudio
s.k.
 
Posts: 113
Joined: 04 Jan 2017, 08:38

Re: IR remote problems

Postby Frost_dk » 27 Jan 2017, 21:06

Thanks, S.K.
Well to be honest, I dont know the brand of IR receiver, but it works without any problems in volumio. I have even read all buttons from the apple remote, and luckily they have the same value as the one you posted. So I can conclude that the problem lies not within the hardware.
i will try once again and write a new image onto the sd card, and try one more time. Do you first install lirc by "pacman -s lirc"?

Thanks again
Frost_dk
 
Posts: 44
Joined: 23 Nov 2015, 20:39
Location: Horsens, Denmark

Re: IR remote problems

Postby Frost_dk » 27 Jan 2017, 22:23

I have now tried a new sd image, and I have made som progress.. I can now get a proper return from mode2, but still nothing from irw..

to be continued.. :)
Frost_dk
 
Posts: 44
Joined: 23 Nov 2015, 20:39
Location: Horsens, Denmark

Re: IR remote problems

Postby s.k. » 27 Jan 2017, 22:39

in the "RuneAudio_rpi2_rp3_0.4-beta_20160321" image, lirc is allready installed.
if you wont to install it again then :

pacman -Sy
pacman -S lirc lirc-utils

Be sure that you put the correct gpio_in/out numbers in step No1
RPi2B Rev 1.1, Allo DigiOne, ATXRaspi, 16x2 OLED display - running rAudio
s.k.
 
Posts: 113
Joined: 04 Jan 2017, 08:38

Re: IR remote problems

Postby Frost_dk » 27 Jan 2017, 23:23

Hi again.
IT IS ALIVE :)
with the new image, and your guide I got most of it working.. But it was first when I noticed that you have written "/etc/lirc/lircd.conf.d/lircd.conf"
when it should have been "/etc/lirc/lircd.conf.d/lirc.conf "
now it works like a charm..

Again, Thank you for all your help :)

Regards,
Rune
Last edited by Frost_dk on 27 Jan 2017, 23:32, edited 1 time in total.
Frost_dk
 
Posts: 44
Joined: 23 Nov 2015, 20:39
Location: Horsens, Denmark

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 41 guests