Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


IR Remote Control with Lirc
#41
(04-16-2019, 10:19 AM)rikardo1979 Wrote: So the solution was very simple at the end :Big Grin

There is a change in latest 4.19.x kernel 

All what's needed after all is todo a change in /boot/config.txt

from original
Code:
dtoverlay=lirc-rpi,gpio_in_pin=4


to
Code:
dtoverlay=gpio-ir,gpio_pin=4


This is related to my lirc use on my RaspDAC Mini streamer

Hope this helps to others

Hi. It helped. I managed to install LIRC on moode 5 thanks to your tip.
Remy
Reply
#42
(04-19-2019, 06:22 PM)remy1961 Wrote:
(04-16-2019, 10:19 AM)rikardo1979 Wrote: So the solution was very simple at the end :Big Grin

There is a change in latest 4.19.x kernel 

All what's needed after all is todo a change in /boot/config.txt

from original
Code:
dtoverlay=lirc-rpi,gpio_in_pin=4


to
Code:
dtoverlay=gpio-ir,gpio_pin=4


This is related to my lirc use on my RaspDAC Mini streamer

Hope this helps to others

Hi. It helped. I managed to install LIRC on moode 5 thanks to your tip.
Remy

Nice one. I am glad I could help. Enjoy your music
<marquee behavior="alternate" scrolldelay=150
~~~~>>>Please always follow rules and read before you post<<<~~~~

</marquee>
Reply
#43
Hi,

Did you try with config = /usr/bin/mpc next instead ?
Reply
#44
Hi guys!
Help organize the volume up or down with /var/www/vol.sh, while the button on the remote control is pressed. Repeat in .lircrc does not work correctly - jumps up and down.


Found the answer in here
Reply
#45
Sad 
Hey there guys!

As already mentioned with the new kernel the operation of lirc has changed (gpio-ir). If a remote has already been configered, this seems not to be any problem. There only has to be done the change with gpio-ir.

My problem is, I've installed moode newly and haven't connected any remote yet via lirc. Moreover my remote isn't listed in the configurations list provided by lirc where setups could be derrived. I therefore have to use irrecord.
The command:
Code:
sudo irrecord -n -d /dev/lirc0 ~/lircd.conf
is my problem. At first, key presses are detected (dots are coming up at the terminal) until it says specify a key name and press it.
Here's the problem. There is always coming up a signal length of 0 which does not take me any further. Someone on the internet mentioned that a protocol has changed here, leading to a non working irrecord..

Is there any way to successfully record new remotes?
Reply
#46
Now that the Moode 6.5.0 is released and I had to reinstall lirc, I thought I'd share an up-to-date guide.
At the time of writing the current lirc version is 0.10.1


Guide updated for Moode 8.3.0. Current lirc version is 0.10.2.

Setup

1. Install lirc:

Code:
sudo apt-get update
sudo apt-get install -y lirc

2. Navigate to lirc directory and disable the devinput driver config:

Code:
cd /etc/lirc
sudo mv ./lircd.conf.d/devinput.lircd.conf ./lircd.conf.d/devinput.lircd.conf.dist

3. Set up the hardware

Open lirc_options.conf:

Code:
sudo nano lirc_options.conf

And replace

Code:
driver          = devinput
device          = auto

with

Code:
driver          = default
device          = /dev/lirc0

4. Set the input pin you want to use

Open /boot/config.txt:

Code:
sudo nano /boot/config.txt

And add this line at the end (replace 25 with whichever gpio pin you use):

Code:
dtoverlay=gpio-ir,gpio_pin=25

5. Set up the irexec service to start on boot:

Code:
sudo systemctl enable irexec

6. Reboot


Usage

All your remotes are stored in /etc/lirc/lircd.conf.d/ directory.
You can have multiple configuration files for different remotes:

Code:
ls /etc/lirc/lircd.conf.d/
KNOB.lircd.conf  RC-5330.lircd.conf  RM-860.lircd.conf

These files contain remote-specific protocol information and translate IR codes to user-defined key codes:

Code:
   KEY_POWER                    0x0EFB38
   KEY_UP                       0x0EFBA7
   KEY_DOWN                     0x0EFBA6
   
These key codes are then used in irexec.lircrc file to map button presses to actions (see The lircrc file format)

Code:
begin
   prog   = irexec
   button = KEY_POWER
   config = python /home/pi/scripts/shutdown.py
end

begin
   prog   = irexec
   button = KEY_UP
   repeat = 1
   delay = 2
   config = mpc volume +5
end


You can get remote configuration files from the remotes database, or you can record them manually using the irrecord utility:

1. Stop the lircd service:

Code:
sudo systemctl stop lircd

2. Run irrecord and follow the instructions, the generated file will be saved as /home/pi/myremote.lircd.conf:

Code:
irrecord -n -d /dev/lirc0 ~/myremote.lircd.conf

3. Copy the file to lirc remotes directory:

Code:
sudo cp /home/pi/myremote.lircd.conf /etc/lirc/lircd.conf.d/myremote.lircd.conf


After adding your remotes and configuring the lircrc file, restart lircd and irexec services:

Code:
sudo systemctl restart lircd
sudo systemctl restart irexec
Reply
#47
Working perfectly fine on new build v7
Reply
#48
Hi,

I did try the steps proposed by Waffle, but it lacks explanation about how to map received keys towards mpc commands. I found in Drone7 post the explanations.

Thank you both for your precious explanations. I managed to use the MSL Digital Remote Pi with a Rega Appollo-R cd player :-).

Greg
Reply
#49
> I'm struggling to get this to work on a new 7 build and an apple A1294. I get output with mode 2 and the services look to be running, but nothing when I run irw.
Any suggestions?

Same here. Tried at least 10 fresh installs of moode audio v7 and couldn't get irw or irexec to detect keys and I'm pretty confident that I followed properly the lircrc and lircd configuration set up and the patch :/
Reply
#50
@KmPan could you please share with us exactly which steps you took Smile ?
as mentioned above I couldn't get irexec or irw to work but everything else is working fine, I was able to generate the configuration.
thanks in advance
Reply


Forum Jump: