Using an IR Remote with Volumio

I had a bit of a harder time that I should getting an IR receiver to work with my RPi & iQ Audio Pi-DAC, so I thought I would put up how I did manage to get it work to help others on this forum. It is really worth taking your time to do this as it makes Volumio a 1000x better than it already is, if feels like a real appliance after you do this, especially because you can shutdown Volumio with a power button :wink:

Hardware

RPi, obviously this will work without a PiDAC

I used a TSOP38238 IR Receiver, they are readily available on ebay. Buy a couple, just incase you burn them out (if you are clumsy like me) by connecting the wires wrong! (http://www.vishay.com/docs/82491/tsop382.pdf)

I also used a CD Audio Cable from Maplins to run the wire from the Pi-DAC case outside my TV cabinet. I pulled off the black plastic connectors and used the 3 metal pins crimped inside to connect the wires directly to the RPi and the pins of the IR Receiver. (http://www.maplin.co.uk/p/internal-analogue-audio-cables-lq80b)

Wiring Up

IR Receiver (with the domed bit facing towards you)
White cable: Left pin, marked as data out on the data sheet
Black cable: Middle pin, ground
Red cable: Right pin, supply voltage

RPi
White Cable: GPIO23 (IO23 on PiDAC)
Black Cable: Ground, 0V
Red Cable: 3.3V

Software

This was the part that gave me the most headaches. >:(

Login via SSH and install LIRC

sudo apt-get install lirc

Set LIRC to use GPIO 23

sudo modprobe lirc_rpi gpio_in_pin=23

See if it is working:

mode2 -d /dev/lirc0

If it has worked, it will output some pulse/space messages on the terminal when you press buttons on your remote. (Press Ctrl+C to exit)

If it has worked, edit /etc/modules to load lirc every time you boot.

sudo nano /etc/modules

Add these two lines to the file:

lirc_dev lirc_rpi gpio_in_pin=23

Save and Exit.

Next, Edit /etc/lirc/hardware.conf

sudo nano /etc/lirc/hardware.conf

Replace its contents with this:

# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="--uinput"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false

#Don't start irexec, even if a good config file seems to exist.
START_IREXEC=true

#Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="default"
# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

# Default configuration files for your hardware if any
LIRCD_CONF="\etc\lirc\lircd.conf"
LIRCMD_CONF=""

(TIP) The START_IREXEC was the hardest part to figure out because IREXEC, which is the daemon that runs in the background to receive commands from your remote will not start if you add it to /etc/rc.local, the configuration file for lircrc has to be at /etc/lirc/lircrc, see the configuring LIRCEXEC section below.

Programming your remote

Stop lirc services running in the background

sudo /etc/init.d/lirc stop

The /etc/lirc/lircd.conf stores the buttons and their commands from your remote control. Generate a new configuration by running:

sudo irrecord -f -d /dev/lirc0 /etc/lirc/lircd.conf

Follow the onscreen instructions, when it asks you for command names, log into Volumio from another terminal session and run the following command to get a list of commands:

irrecord —list-namespace

I used KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_PLAY etc from the remote for my DVD Player.

Once you are done, reboot volumio and test that the remote is working by running:

irw

The buttons you press will be shown on the screen (Press Ctrl+C to exit).

Configuring IREXEC

Now we want volumio to respond to the buttons using IREXEC, which is a background process that listens for IR commands and runs corresponding commands on the system.

Many tutorials make a ~/.lircrc in the home folder, but it cannot be started automatically as a process this way with LIRC. For it to work properly, make the configuration file at /etc/lirc/lircrc:

sudo nano /etc/lirc/lircrc

Next, copy these commands into the lircrc file. I used the following to control MPD in the lircrc file. You will also notice I use two of the buttons to stop and start Squeezelite (find more info on configuring the lircrc file here: lirc.org/html/configure.html).

begin prog = irexec button = KEY_PREVIOUSSONG config = mpc prev; mpc play repeat = 0 end begin prog = irexec button = KEY_NEXTSONG config = mpc next; mpc play repeat = 0 end begin prog = irexec button = KEY_PLAY config = mpc play repeat = 0 end begin prog = irexec button = KEY_PAUSE config = mpc toggle repeat = 0 end begin prog = irexec button = KEY_STOP config = mpc stop repeat = 0 end begin prog = irexec button = KEY_VOLUMEUP config = mpc volume +1 repeat = 4 end begin prog = irexec button = KEY_VOLUMEDOWN config = mpc volume -1 repeat = 4 end begin prog = irexec button = KEY_FASTFORWARD config = mpc seek +1% repeat = 4 end begin prog = irexec button = KEY_REWIND config = mpc seek -1% repeat = 4 end begin prog = irexec button = KEY_MUTE config = mpc volume 0 repeat = 0 end begin prog = irexec button = KEY_EJECTCD config = /etc/init.d/squeezelite stop repeat = 0 end begin prog = irexec button = KEY_AUX config = mpc stop; /etc/init.d/squeezelite start repeat = 0 end begin prog = irexec button = KEY_POWER config = sudo halt repeat = 0 end

Once that is done, reboot and your remote should be working with volumio :slight_smile: Good Luck!

1 Like

Great write up - mind if I link to it from the IQaudio web site?

Best regards,

Gordon

You don;t have to use killall to stop lirc, sudo /etc/init.d/lirc stop (or restart)

More info here: http://volumio.org/forum/how-installed-lirc-with-receiver-and-remote-volumio-t360.html

Harry

Gordon, Sure, no problem.

Harry, thanks for spotting that, I have updated the instructions.

Wow! :open_mouth: You make this look even easier than adding physical buttons to the Raspberry.

The 1991 Akai “Digital HiFi MIDI system” I want to connect my Pi to has a remote with some buttons i dont use. Your making me consider getting a IR receiver and drop the buttons i was working on :smiley:

Hi,

First of all thanks for the great writeup, it was easy for me to setup the remote for my RaPi. I am planning to integrate Volumio with front Fascia of my stock Head unit. So far I managed to setup everything as per this thread, tested out the Remote with the

irw

and it works absolutely file, I also setup the configuration in

/etc/lirc/lircrc

however the Volumio fails to recognise any key-presses on the remote. Please advise on the next steps for trouble shooting:
Following is what is setup in the lircrc config file:

[code]begin
prog = irexec
button = PREV
config = mpc prev; mpc play
repeat = 0
end
begin
prog = irexec
button = NEXT
config = mpc next; mpc play
repeat = 0
end
begin
prog = irexec
button = AST
config = mpc play
repeat = 0
end
begin
prog = irexec
button = UP
config = mpc toggle
repeat = 0
end
begin
prog = irexec
button = DOWN
config = mpc stop
repeat = 0
begin
prog = irexec
button = VOLUME+
config = mpc volume +1
repeat = 4
end
begin
prog = irexec
button = VOLUME-
config = mpc volume -1
repeat = 4
end
begin
prog = irexec
button = BUTTON1
config = mpc seek +1%
repeat = 4
end
begin
prog = irexec
button = BUTTON3
config = mpc seek -1%
repeat = 4
end
begin
prog = irexec
button = MUTE
config = mpc volume 0
repeat = 0
end
begin
prog = irexec
button = POWER_DOWN
config = sudo halt
repeat = 0
end
begin
prog = irexec
button = BUTTON2
config = mpc shuffle
repeat = 0
end

[/code]

PS: I used root profile to setup all these configurations. And running

dmesg

shows this

[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Initializing cgroup subsys cpuacct [ 0.000000] Linux version 3.12.26+ (dc4@dc4-Latitude-E6510) (gcc version 4.8. 3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03 ) ) #702 PREEMPT Wed Aug 6 17:43:49 BST 2014 [ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr =00c5387d [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruc tion cache [ 0.000000] Machine: BCM2708 [ 0.000000] cma: CMA: reserved 8 MiB at 1e800000 [ 0.000000] Memory policy: ECC disabled, Data cache writeback [ 0.000000] On node 0 totalpages: 126976 [ 0.000000] free_area_init_node: node 0, pgdat c0617b48, node_mem_map c06c800 0 [ 0.000000] Normal zone: 992 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 126976 pages, LIFO batch:31 [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pag es: 125984 [ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 b cm2708_fb.fbheight=416 bcm2708.boardrev=0x10 bcm2708.serial=0xeef96362 smsc95xx. macaddr=B8:27:EB:F9:63:62 bcm2708.disk_led_gpio=47 bcm2708.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1fa00000 vc_mem.mem_s ize=0x20000000 force_turbo=1 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc =ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 elevator=noop rootfstype=ext4 r ootwait smsc95xx.turbo_mode=N [ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes) [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) [ 0.000000] Memory: 488328K/507904K available (4481K kernel code, 241K rwdata , 1340K rodata, 143K init, 701K bss, 19576K reserved) [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) [ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) [ 0.000000] vmalloc : 0xdf800000 - 0xff000000 ( 504 MB) [ 0.000000] lowmem : 0xc0000000 - 0xdf000000 ( 496 MB) [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB) [ 0.000000] .text : 0xc0008000 - 0xc05b78f4 (5823 kB) [ 0.000000] .init : 0xc05b8000 - 0xc05dbde4 ( 144 kB) [ 0.000000] .data : 0xc05dc000 - 0xc0618660 ( 242 kB) [ 0.000000] .bss : 0xc061866c - 0xc06c7e28 ( 702 kB) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] Preemptible hierarchical RCU implementation. [ 0.000000] NR_IRQS:394 [ 0.000000] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 4 294967ms [ 0.000000] Switching to timer-based delay loop [ 0.000000] Console: colour dummy device 80x30 [ 0.000000] console [tty1] enabled [ 0.001202] Calibrating delay loop (skipped), value calculated using timer fr equency.. 2.00 BogoMIPS (lpj=10000) [ 0.001259] pid_max: default: 32768 minimum: 301 [ 0.001782] Mount-cache hash table entries: 512 [ 0.002599] Initializing cgroup subsys memory [ 0.002713] Initializing cgroup subsys devices [ 0.002749] Initializing cgroup subsys freezer [ 0.002779] Initializing cgroup subsys blkio [ 0.002924] CPU: Testing write buffer coherency: ok [ 0.003384] Setting up static identity map for 0xc0444618 - 0xc0444674 [ 0.005315] devtmpfs: initialized [ 0.021397] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5 [ 0.023011] NET: Registered protocol family 16 [ 0.028430] DMA: preallocated 4096 KiB pool for atomic coherent allocations [ 0.029101] cpuidle: using governor ladder [ 0.029149] cpuidle: using governor menu [ 0.029640] bcm2708.uart_clock = 0 [ 0.031655] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers. [ 0.031714] hw-breakpoint: maximum watchpoint size is 4 bytes. [ 0.031747] mailbox: Broadcom VideoCore Mailbox driver [ 0.031843] bcm2708_vcio: mailbox at f200b880 [ 0.031946] bcm_power: Broadcom power driver [ 0.031982] bcm_power_open() -> 0 [ 0.032006] bcm_power_request(0, 8) [ 0.532724] bcm_mailbox_read -> 00000080, 0 [ 0.532764] bcm_power_request -> 0 [ 0.533017] Serial: AMBA PL011 UART driver [ 0.533158] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83, base_baud = 0) is a PL011 rev3 [ 0.901529] console [ttyAMA0] enabled [ 0.928226] bio: create slab <bio-0> at 0 [ 0.933748] SCSI subsystem initialized [ 0.937739] usbcore: registered new interface driver usbfs [ 0.943434] usbcore: registered new interface driver hub [ 0.948995] usbcore: registered new device driver usb [ 0.955651] Switched to clocksource stc [ 0.959916] FS-Cache: Loaded [ 0.963085] CacheFiles: Loaded [ 0.978811] NET: Registered protocol family 2 [ 0.984276] TCP established hash table entries: 4096 (order: 3, 32768 bytes) [ 0.991686] TCP bind hash table entries: 4096 (order: 2, 16384 bytes) [ 0.998276] TCP: Hash tables configured (established 4096 bind 4096) [ 1.004723] TCP: reno registered [ 1.008017] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 1.013886] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 1.020652] NET: Registered protocol family 1 [ 1.025603] RPC: Registered named UNIX socket transport module. [ 1.031664] RPC: Registered udp transport module. [ 1.036423] RPC: Registered tcp transport module. [ 1.041141] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 1.048547] bcm2708_dma: DMA manager at f2007000 [ 1.053286] bcm2708_gpio: bcm2708_gpio_probe c05e9ed0 [ 1.058862] vc-mem: phys_addr:0x00000000 mem_base=0x1fa00000 mem_size:0x20000 000(512 MiB) [ 1.068460] audit: initializing netlink socket (disabled) [ 1.073949] type=2000 audit(0.910:1): initialized [ 1.243675] VFS: Disk quotas dquot_6.5.2 [ 1.248042] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 1.257008] FS-Cache: Netfs 'nfs' registered for caching [ 1.263904] NFS: Registering the id_resolver key type [ 1.269186] Key type id_resolver registered [ 1.273393] Key type id_legacy registered [ 1.278197] msgmni has been set to 969 [ 1.283935] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 2 52) [ 1.291809] io scheduler noop registered (default) [ 1.296762] io scheduler deadline registered [ 1.301370] io scheduler cfq registered [ 1.306589] BCM2708FB: allocated DMA memory 5ec00000 [ 1.311638] BCM2708FB: allocated DMA channel 0 @ f2007000 [ 1.331605] Console: switching to colour frame buffer device 82x26 [ 1.341778] uart-pl011 dev:f1: no DMA platform data [ 1.348221] kgdb: Registered I/O driver kgdboc. [ 1.354768] vc-cma: Videocore CMA driver [ 1.360101] vc-cma: vc_cma_base = 0x00000000 [ 1.366166] vc-cma: vc_cma_size = 0x00000000 (0 MiB) [ 1.372812] vc-cma: vc_cma_initial = 0x00000000 (0 MiB) [ 1.388789] brd: module loaded [ 1.398369] loop: module loaded [ 1.402996] vchiq: vchiq_init_state: slot_zero = 0xde800000, is_master = 0 [ 1.412226] Loading iSCSI transport class v2.0-870. [ 1.419571] usbcore: registered new interface driver smsc95xx [ 1.426824] dwc_otg: version 3.00a 10-AUG-2012 (platform bus) [ 1.633970] Core Release: 2.80a [ 1.638469] Setting default values for core params [ 1.644477] Finished setting default values for core params [ 1.851322] Using Buffer DMA mode [ 1.855909] Periodic Transfer Interrupt Enhancement - disabled [ 1.862983] Multiprocessor Interrupt Enhancement - disabled [ 1.869820] OTG VER PARAM: 0, OTG VER FLAG: 0 [ 1.875438] Dedicated Tx FIFOs mode [ 1.880513] WARN::dwc_otg_hcd_init:1042: FIQ DMA bounce buffers: virt = 0xdec 14000 dma = 0x5ec14000 len=9024 [ 1.892957] FIQ FSM acceleration enabled for : [ 1.892957] Non-periodic Split Transactions [ 1.892957] Periodic Split Transactions [ 1.892957] High-Speed Isochronous Endpoints [ 1.914761] dwc_otg: Microframe scheduler enabled [ 1.914849] WARN::hcd_init:473: FIQ at 0xc031f7e0 [ 1.921003] WARN::hcd_init:474: FIQ ASM at 0xc031fa90 length 36 [ 1.928341] WARN::hcd_init:500: MPHI regs_base at 0xdf806000 [ 1.935326] dwc_otg bcm2708_usb: DWC OTG Controller [ 1.941574] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1 [ 1.950231] dwc_otg bcm2708_usb: irq 32, io mem 0x00000000 [ 1.957104] Init: Port Power? op_state=1 [ 1.962309] Init: Power Port (0) [ 1.967106] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 1.975227] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber= 1 [ 1.983795] usb usb1: Product: DWC OTG Controller [ 1.989829] usb usb1: Manufacturer: Linux 3.12.26+ dwc_otg_hcd [ 1.996982] usb usb1: SerialNumber: bcm2708_usb [ 2.003634] hub 1-0:1.0: USB hub found [ 2.008847] hub 1-0:1.0: 1 port detected [ 2.014482] dwc_otg: FIQ enabled [ 2.014500] dwc_otg: NAK holdoff enabled [ 2.014510] dwc_otg: FIQ split-transaction FSM enabled [ 2.014530] Module dwc_common_port init [ 2.014964] usbcore: registered new interface driver usb-storage [ 2.022711] mousedev: PS/2 mouse device common for all mice [ 2.030322] bcm2835-cpufreq: min=700000 max=700000 cur=700000 [ 2.037558] bcm2835-cpufreq: switching to governor powersave [ 2.044481] bcm2835-cpufreq: switching to governor powersave [ 2.051466] sdhci: Secure Digital Host Controller Interface driver [ 2.058942] sdhci: Copyright(c) Pierre Ossman [ 2.064608] sdhci: Enable low-latency mode [ 2.115757] mmc0: SDHCI controller on BCM2708_Arasan [platform] using platfor m's DMA [ 2.126317] mmc0: BCM2708 SDHC host at 0x20300000 DMA 2 IRQ 77 [ 2.133571] sdhci-pltfm: SDHCI platform and OF driver helper [ 2.140749] ledtrig-cpu: registered to indicate activity on CPUs [ 2.150401] hidraw: raw HID events driver (C) Jiri Kosina [ 2.164777] usbcore: registered new interface driver usbhid [ 2.171861] usbhid: USB HID core driver [ 2.181752] TCP: cubic registered [ 2.188540] Initializing XFRM netlink socket [ 2.196261] NET: Registered protocol family 17 [ 2.202250] Key type dns_resolver registered [ 2.211328] Indeed it is in host mode hprt0 = 00021501 [ 2.222387] registered taskstats version 1 [ 2.236939] Waiting for root device /dev/mmcblk0p3... [ 2.297831] mmc0: read SD Status register (SSR) after 3 attempts [ 2.318919] mmc0: new high speed SDHC card at address 59b4 [ 2.326629] mmcblk0: mmc0:59b4 MS 7.35 GiB [ 2.334034] mmcblk0: p1 p3 [ 2.399205] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. O pts: (null) [ 2.410371] VFS: Mounted root (ext4 filesystem) on device 179:3. [ 2.429121] devtmpfs: mounted [ 2.434051] Freeing unused kernel memory: 140K (c05b8000 - c05db000) [ 2.442031] usb 1-1: new high-speed USB device number 2 using dwc_otg [ 2.451271] Indeed it is in host mode hprt0 = 00001101 [ 2.656097] usb 1-1: New USB device found, idVendor=0424, idProduct=9514 [ 2.664372] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 2.673894] hub 1-1:1.0: USB hub found [ 2.679900] hub 1-1:1.0: 5 ports detected [ 2.965915] usb 1-1.1: new high-speed USB device number 3 using dwc_otg [ 3.086226] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00 [ 3.094750] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber =0 [ 3.107914] smsc95xx v1.0.4 [ 3.175003] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-bcm2708_usb-1 .1, smsc95xx USB 2.0 Ethernet, b8:27:eb:f9:63:62 [ 3.285952] usb 1-1.3: new full-speed USB device number 4 using dwc_otg [ 3.423260] usb 1-1.3: New USB device found, idVendor=08bb, idProduct=2706 [ 3.438504] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber =0 [ 3.458421] usb 1-1.3: Product: USB Audio DAC [ 3.464735] usb 1-1.3: Manufacturer: Burr-Brown from TI [ 3.495361] input: Burr-Brown from TI USB Audio DAC as /devi ces/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.2/input/input0 [ 3.528158] hid-generic 0003:08BB:2706.0001: input,hidraw0: USB HID v1.00 Dev ice [Burr-Brown from TI USB Audio DAC ] on usb-bcm2708_usb-1.3/i nput2 [ 3.645950] usb 1-1.5: new high-speed USB device number 5 using dwc_otg [ 3.766714] usb 1-1.5: New USB device found, idVendor=0781, idProduct=5577 [ 3.775449] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber =3 [ 3.785061] usb 1-1.5: Product: Firebird USB Flash Drive [ 3.792251] usb 1-1.5: Manufacturer: SanDisk [ 3.802342] usb 1-1.5: SerialNumber: 4C532000061023101045 [ 3.811764] usb-storage 1-1.5:1.0: USB Mass Storage device detected [ 3.820405] scsi0 : usb-storage 1-1.5:1.0 [ 4.449842] udevd[158]: starting version 175 [ 4.827327] scsi 0:0:0:0: Direct-Access SanDisk Cruzer Pop 1.26 PQ : 0 ANSI: 5 [ 4.861373] sd 0:0:0:0: [sda] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB) [ 4.897023] sd 0:0:0:0: [sda] Write Protect is off [ 4.903581] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00 [ 4.922560] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doe sn't support DPO or FUA [ 4.965923] sda: sda1 [ 4.979066] sd 0:0:0:0: [sda] Attached SCSI removable disk [ 5.045383] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 5.419561] bcm2708_i2c_init_pinmode(0,0) [ 5.525818] bcm2708_i2c_init_pinmode(0,1) [ 5.531845] bcm2708_i2c bcm2708_i2c.0: BSC0 Controller at 0x20205000 (irq 79) (baudrate 100000) [ 5.806079] bcm2708_spi bcm2708_spi.0: master is unqueued, this is deprecated [ 5.941868] bcm2708_spi bcm2708_spi.0: SPI Controller at 0x20204000 (irq 80) [ 6.059964] bcm2708_i2c_init_pinmode(1,2) [ 6.092823] bcm2708_i2c_init_pinmode(1,3) [ 6.158944] bcm2708_i2c bcm2708_i2c.1: BSC1 Controller at 0x20804000 (irq 79) (baudrate 100000) [ 6.634640] bcm2708-i2s bcm2708-i2s.0: Failed to create debugfs directory [ 7.585803] pcm512x 1-004d: Failed to reset device: -5 [ 7.592772] pcm512x: probe of 1-004d failed with error -5 [ 7.657191] pcm512x 1-004c: Failed to reset device: -5 [ 7.664159] pcm512x: probe of 1-004c failed with error -5 [ 8.024663] FAT-fs (sda1): utf8 is not a recommended IO charset for FAT files ystems, filesystem will be case sensitive! [ 8.499944] usbcore: registered new interface driver snd-usb-audio [ 11.418065] EXT4-fs (mmcblk0p3): re-mounted. Opts: (null) [ 11.908472] EXT4-fs (mmcblk0p3): Mount option "nouser_xattr" will be removed by 3.5 [ 11.908472] Contact linux-ext4@vger.kernel.org if you think we should keep it . [ 11.908472] [ 11.935016] EXT4-fs (mmcblk0p3): re-mounted. Opts: nouser_xattr,errors=remoun t-ro [ 12.807662] lirc_dev: IR Remote Control driver registered, major 248 [ 12.920331] lirc_rpi: module is from the staging directory, the quality is un known, you have been warned. [ 13.895718] lirc_rpi: auto-detected active low receiver on GPIO pin 23 [ 13.909348] lirc_rpi lirc_rpi.0: lirc_dev: driver lirc_rpi registered at mino r = 0 [ 13.921784] lirc_rpi: driver registered! [ 15.751498] input: lircd as /devices/virtual/input/input1 [ 19.434984] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. [ 22.028239] NET: Registered protocol family 10 [ 22.438419] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup [ 22.448063] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 24.098359] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E 1 [ 24.110530] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 36.582048] Installing knfsd (copyright (C) 1996 okir@monad.swb.de). [ 103.959498] bcm2835-cpufreq: switching to governor performance [ 103.968251] bcm2835-cpufreq: switching to governor performance [ 191.275483] lirc_rpi: AIEEEE: 1 1 54923b68 54923a9e c161b f1ac1 [ 302.698058] EXT4-fs (mmcblk0p3): error count since last fsck: 3 [ 302.706392] EXT4-fs (mmcblk0p3): initial error at time 1396987247: mb_free_bl ocks:1426: block 309248 [ 302.720632] EXT4-fs (mmcblk0p3): last error at time 1396987322: ext4_remount: 4680

Hi venki,

This is what I get from my dmesg

[ 14.125821] lirc_dev: IR Remote Control driver registered, major 248 [ 14.233583] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned. [ 15.202893] lirc_rpi: auto-detected active low receiver on GPIO pin 23 [ 15.216431] lirc_rpi lirc_rpi.0: lirc_dev: driver lirc_rpi registered at minor = 0 [ 15.227223] lirc_rpi: driver registered! [ 16.940042] input: lircd as /devices/virtual/input/input0

Which is more or less exacly what you have from your one above. You have to reset the rpi once before lircrd starts working, possibly it has not started yet?

A

Hi Sid,

Thanks for the prompt response, I had restarted the Pi probably 5-6 times but still it doesn’t seems to be picking up the commands, I even tried running

irexec -d

manually, still could not control it. Should I redo everything with user “pi”.

Thanks in Advance,
Venki

Could you edited this line in hardware.conf? It worked for me!

LIRCD_CONF="\etc\lirc\lircd.conf"

By the way, you ca also make key-combinations. Instead of using one key press to shutdown my Pi I have to press a sequence of keys.

lircrc:

begin prog = irexec remote = apple button = KEY_MENU button = KEY_DOWN button = KEY_MENU repeat = 0 config = mpc stop & sudo halt end

So no accidental shutdowns :smiley:

Harry

There was a problem with the way I copied the /etc/lirc/hardware.conf config line.

Change the last line of that file to this as well:

LIRCMD_CONF=""

I know it looks the same, but I think it is a different kind of inverted-double commas, even though they look the same.

I have changed the instructions above to match yours, glad it worked for you.

BTW, thats a nice three finger salute for a shutdown, I going to add that to mine as well.

Hi sid_d,

Thank You very much! Amazing :smiley:

It works (nearly) out of the box. Just in your lircrc is in section “KEY_STOP” the “end” command missed…

Very fine

Klaus

Hi,

I learned the keys from my remote using IRRECORD as described and got the following lircd.conf file.

# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.9.0-pre1(default) on Sat Jan  3 17:46:32 2015
#
# contributed by 
#
# brand:                       /etc/lirc/lircd.conf
# model no. of remote control: 
# devices being controlled by this remote:
#

begin remote

  name  /etc/lirc/lircd.conf
  flags RAW_CODES|CONST_LENGTH
  eps            30
  aeps          100

  gap          90036

      begin raw_codes

          name key_play
             8504    4235     546    1612     532    1604
              535     527     550     525     546     529
              553    1586     552     535     539    1592
              549     541     532     550     526    1594
              546    1619     526    1593     548     533
              540    1606     535     526     550     549
              525    1598     544    1594     550    1590
              551    1608     533     547     529     523
              557    1565     570    1615     527     526
              549     530     543     550     525     530
              545    1623     520    1591     551     527
              547

          name key_pause
             8516    4226     537    1599     548    1591
              547     528     547     525     549     539
              537    1597     542     528     551    1608
              530     527     548     509     570    1590
              549    1591     549    1600     544     527
              546    1612     530     525     549    1593
              549    1573     569    1593     550    1605
              535    1593     551     545     529     525
              548    1594     556     496     569     528
              547     529     548     548     527     525
              550    1591     549    1612     530     550
              525

          name key_stop
             8508    4241     529    1616     526    1599
              543     525     549     526     549     529
              546    1592     549     531     544    1614
              532     522     548     549     526    1613
              528    1595     546    1599     544     537
              537    1622     522     525     548     527
              548     527     549     526     550    1613
              526    1599     550     526     541     526
              550    1593     549    1592     549    1592
              549    1601     540     540     536     530
              545    1615     525    1572     571     525
              550

          name key_previoussong
             8511    4227     544    1593     546    1604
              539     535     540     525     549     550
              525    1593     549     527     548    1575
              568     525     548     527     547    1596
              547    1596     544    1614     528     526
              550    1611     530     532     542    1613
              530     530     548    1599     557    1576
              547    1600     542     547     529     538
              536    1614     529     524     549    1601
              542     526     548     527     554     521
              549    1613     528    1591     550     541
              533

          name key_nextsong
             8507    4221     551    1608     534    1594
              548     543     531     530     544     526
              549    1596     545     542     535    1593
              549     542     536     543     534    1609
              524    1600     544    1594     547     548
              528    1613     533     522     546     543
              533     548     527    1592     549    1615
              530    1591     549     531     541     538
              538    1573     569    1593     549    1600
              540     525     551     545     532     546
              526    1608     537    1581     558     548
              525

          name key_rewind
             8508    4226     550    1594     549    1574
              567     549     526     544     530     527
              549    1612     531     525     549    1614
              527     545     529     526     547    1612
              539    1587     548    1592     549     525
              548    1595     549     542     531    1613
              531    1594     547     524     551    1570
              571    1593     549     527     547     527
              549    1606     534     527     547     527
              549    1613     528     529     548     528
              546    1599     543    1593     549     545
              529

          name key_fastforward
             8507    4226     548    1596     546    1615
              527     542     533     527     548     527
              547    1592     551     532     542    1592
              547     529     546     528     553    1593
              549    1588     549    1579     562     526
              549    1593     558     537     528     536
              541    1592     550     542     532    1585
              555    1595     550     550     522     526
              549    1593     549    1609     533     529
              545    1594     547     523     560     539
              529    1615     527    1591     550     525
              549

          name key_program
             8510    4284     492    1601     522    1600
              523     559     509     563     506     546
              523    1604     517     545     524    1600
              522     544     525     525     542    1599
              523    1614     514    1610     507     567
              501    1616     507     544     523    1598
              525     558     509     561     510    1597
              523    1609     512     562     509     545
              525    1595     526     551     516    1590
              531    1611     513     558     511     546
              522    1597     526    1609     510     548
              523

          name key_ejectcd
             8513    4244     527    1604     538    1613
              527     536     540     526     548     527
              548    1612     529     533     543    1591
              549     537     539     526     547    1601
              542    1580     562    1606     535     525
              550    1569     573     548     528    1591
              547     530     547     504     592    1575
              547    1614     526     529     545     528
              545    1595     550     525     548    1603
              540    1593     547     526     551     525
              549    1610     531    1594     556     541
              525

          name key_unknown
             8500    4309     473    1649     472    1668
              504     544     524     531     539     545
              474    1655     516     568     452    1662
              511     543     524     545     475    1667
              453    1658     461    1661     514     546
              473    1655     515     564     456    1646
              527     544     523     568     452    1666
              454    1648     525     544     523     546
              476    1636     533     551     469    1648
              474    1646     524     547     521     558
              464    1677     444    1647     523     562
              520

          name key_info
             8501    4255     524    1593     547    1591
              551     548     526     548     533     520
              549    1596     545     526     548    1594
              547     527     549     548     527    1586
              555    1595     548    1594     549     526
              546    1596     547     511     565    1597
              541     528     549     525     550    1600
              541    1616     525     549     526     526
              556    1586     548     529     547    1613
              529    1612     528     527     547     528
              549    1619     521    1596     547     527
              548

          name key_power
             8511    4233     543    1592     550    1594
              547     536     537     531     544     528
              546    1594     552     535     538    1616
              526     529     544     527     548    1593
              573    1596     521    1591     549     529
              548    1611     532     547     526    1595
              555     537     530     526     549    1592
              549    1592     550     548     525     528
              548    1611     533     541     533    1593
              549    1582     558     525     551     539
              535    1620     522    1591     550     527
              549

      end raw_codes

end remote

But all keys from the remote following the entry for key_program (key_ejectcd; key_info; key_unknow; key_power) are recognized as key_program (as displayed using irw).

Can anyone help what I’m doing wrong?

BR

Michael

Thanks a lot Sid_d and Michael,
I configured my tv remote without prolems.

This is my lircd.conf :

# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.9.0-pre1(default) on Fri Jan  9 23:21:22 2015
#
# contributed by romvise
#
# brand: Samsung                       /etc/lirc/lircd.conf
# model no. of remote control: AA59-00741A
# devices being controlled by this remote: Raspberry Pi
#

begin remote

  name  /etc/lirc/lirc.conf
  flags RAW_CODES|CONST_LENGTH
  eps            30
  aeps          100

  gap          108123

      begin raw_codes

          name KEY_VOLUMEUP
             4572    4489     580    1652     592    1636
              610    1660     583     531     597     519
              601     537     600     520     589     539
              582    1618     629    1640     607    1667
              595     516     591     530     592     512
              626     498     626     500     610    1636
              608    1675     566    1661     585     535
              589     535     589     527     590     513
              612     536     586     540     585     533
              591     535     586    1657     588    1660
              586    1662     582    1657     590    1659
              586

          name KEY_VOLUMEDOWN
             4554    4479     591    1656     612    1608
              605    1648     642     472     614     533
              579     521     641     483     631     515
              585    1655     614    1619     601    1641
              608     508     616     533     585     517
              646     472     624     524     586    1660
              589    1656     588     510     640    1627
              593     531     588     526     597     534
              627     496     589     523     597     533
              601    1650     586     535     589    1655
              587    1646     602    1658     581    1660
              593

          name KEY_PLAY
             4544    4495     584    1654     596    1650
              660    1578     594     537     587     532
              662     453     641     473     609     519
              665    1576     622    1645     633    1613
              585     516     648     495     596     531
              583     519     641     508     615    1626
              586    1659     595    1640     635     494
              600     528     585     544     603    1636
              585     513     643     506     597     525
              585     537     623    1624     586    1645
              604    1654     613     508     606    1641
              607

          name KEY_PAUSE
             4570    4469     630    1621     594    1656
              592    1652     595     510     660     482
              598     502     611     512     674     449
              611    1658     613    1607     616    1629
              639     483     652     488     597     510
              608     538     616     484     611     535
              584    1647     603     533     592    1652
              588     535     589     530     588    1661
              586     513     627    1644     585     523
              599    1658     584     540     584    1657
              588    1663     605     511     610    1638
              585

          name KEY_STOP
             4574    4458     614    1632     647    1620
              590    1641     634     505     588     515
              647     487     595     539     608     506
              631    1605     603    1645     606    1657
              585     514     624     524     588     537
              584     513     614     535     583     548
              578    1658     585    1652     597     534
              588     539     584     513     629    1644
              585     526     603    1654     586     535
              622     503     596    1648     599    1653
              587    1633     608     535     587    1659
              589

          name KEY_RED
             4567    4490     618    1623     582    1638
              654    1591     632     490     675     471
              584     548     579     510     642     508
              581    1640     621    1623     611    1633
              638     490     601     543     584     531
              624     479     611     538     587     511
              611     536     615    1632     586    1642
              604     532     594    1652     586    1658
              583     541     585    1665     583    1638
              605     535     590     535     586    1658
              591     533     588     534     592    1653
              587

          name KEY_GREEN
             4544    4467     601    1656     587    1654
              595    1652     586     512     618     521
              598     535     619     479     614     534
              585    1657     590    1657     586    1634
              608     540     585     512     633     514
              581     568     559     517     621     524
              582     542     583    1659     595     531
              584    1660     587     533     608     517
              588     537     585    1657     587    1661
              591     527     592    1652     592     532
              593    1653     590    1661     583    1655
              593

          name KEY_YELLOW
             4634    4414     627    1621     602    1652
              590    1623     641     506     610     513
              586     512     645     501     618     506
              593    1650     639    1609     582    1660
              629     494     605     517     586     538
              624     499     608     514     582    1641
              636     509     585    1657     631     495
              596    1647     604     522     613     509
              585     536     584     540     618    1626
              585     528     625    1630     582     521
              621    1642     585    1660     614    1630
              586

          name KEY_BLUE
             4600    4456     618    1595     620    1652
              620    1621     570     555     620     487
              630     496     580     555     622     491
              604    1652     617    1626     596    1624
              646     507     590     525     572     548
              629     499     593     530     570     530
              650    1609     596    1662     615     503
              593    1647     569     557     616     505
              595     527     568    1678     601     521
              588     528     628    1625     592     506
              594    1676     594    1647     575    1672
              584

          name KEY_PREVIOUS
             4582    4461     596    1660     600    1621
              608    1664     583     510     606     565
              563     514     656     465     643     504
              586    1635     615    1632     642    1610
              602     535     620     487     607     511
              609     535     602     500     608    1655
              616     509     619    1629     585     512
              635     490     610     538     583    1644
              604     535     584     535     605    1642
              607     515     595    1652     586    1646
              599    1652     595     509     606    1648
              603

          name KEY_NEXT
             4564    4495     579    1655     590    1661
              583    1655     591     514     602     536
              588     517     645     478     605     543
              581    1642     608    1656     588    1662
              581     539     584     518     638     496
              604     521     592     536     609     510
              596     532     587     513     652    1616
              587     532     613     513     593    1653
              587     523     606    1651     596    1649
              588    1656     588     520     614    1646
              587    1667     579     537     584    1662
              583

      end raw_codes

end remote

and here my lircrc :

begin
    prog = irexec
    button = KEY_PREVIOUS
    config = mpc prev; mpc play
    repeat = 0
end
begin
    prog = irexec
    button = KEY_NEXT
    config = mpc next; mpc play
    repeat = 0
end
begin
    prog = irexec
    button = KEY_PLAY
    config = mpc play
    repeat = 0
end
begin
    prog = irexec
    button = KEY_PAUSE
    config = mpc toggle
    repeat = 0
end
begin
    prog = irexec
    button = KEY_STOP
    config = mpc stop
    repeat = 0
end
begin
    prog = irexec
    button = KEY_VOLUMEUP
    config = mpc volume +1
    repeat = 4
end
begin
    prog = irexec
    button = KEY_VOLUMEDOWN
    config = mpc volume -1
    repeat = 4
end
begin
    prog = irexec
    button = KEY_RED             
    button = KEY_RED
    config = sudo halt
    repeat = 0
end

Roberto

Roberto,

you’re using exactly eight keys for controlling MPC. I discovered, that it works up to eight keys and that any further key will be recognized as the 8th key.

Can you add on or two more and combine them with the repeat, single or consume mode and report if that works?

BR

Michael

Hi Michael,

I’ve added this piece to my lircrc and it works :

begin prog = irexec button = KEY_GREEN button = KEY_GREEN config = sudo reboot repeat = 0 end begin prog = irexec button = KEY_YELLOW config = mpc single repeat = 0 end begin prog = irexec button = KEY_BLUE config = mpc consume repeat = 0 end
I hope it help you,

Roberto

Thanks Roberto,

so generally it should work. Don’t know what I’m doing wrong. I think I’ve to spend some time on it…

BR

Michael

Hi,

I followed sid_d’s tutorial and installed lirc with volumio1.51. No problems so far. Noe I updated to 1.55 and failed in getting it running.

I did:
sudo apt-get update
sudo apt-get install lirc

and lirc installed without error. But then I alreaqdy failed on the first step.
sudo modprobe lirc_rpi gpio_in_pin=18 quit with
ERROR: could not inster ‘lirc_rpi’: no such device

Could any one advise on what I’m doing wrong?

Any help is appreciated.

BR

Michael

i got past that error by editing config.txt

nano /boot/config.txt

at the end of the file add the following line

dtoverlay=lirc-rpi

i dont konow if its required but i chose to reboot as well after this by running

reboot

the previous commands were entered using a root console
so if the comands dont work you need to add

sudo before each command
source https://github.com/OpenELEC/OpenELEC.tv/issues/3908

Thanks for contribution this. It gave me a kickstart to get lirc to work with volumio.

Anyone has a solution that would use the websocket volumio makes available? Maybe this would be more responsive in the UI instead of waiting for the UI to see what MPD/MPC is up to ?

Yes, you can write your own websocket client, here’s the API:
volumio.github.io/docs/API/WebSocket_APIs.html

More info on this thread as well:
websocket-home-automation-t4622.html