RuneAudio_rpi2_rp3_0.4-beta_20170229_2GB + IR REMOTE(KEYES)

Raspberry Pi related support

RuneAudio_rpi2_rp3_0.4-beta_20170229_2GB + IR REMOTE(KEYES)

Postby dom_france » 09 Mar 2018, 16:15

Hello,

I just managed to set up my KEYES brand remote control, I will describe step by step my procedure.

First, a little photo :

Image

This IR remote is available on :

https://fr.aliexpress.com/item/Hot-Sell ... 0.0.yI2aD3

A+

DOM
User avatar
dom_france
 
Posts: 35
Joined: 28 Jan 2018, 07:54

Re: RuneAudio_rpi2_rp3_0.4-beta_20170229_2GB + IR REMOTE(KEY

Postby dom_france » 09 Mar 2018, 16:28

My procedure :
Wiring :
RPi3 -> remote
Gnd -> Gnd
+3,3v -> +vcc
GPIO 23 -> Signal


1) Installing "lirc" package with :
Code: Select all
pacman -S lirc


2) change file "/boot/config.txt" to enable lirc :
Code: Select all
dtoverlay=lirc-rpi
dtparam=gpio_out_pin=24
dtparam=gpio_in_pin=23
dtparam=gpio_in_pull=up


3) Creating a file /etc/module-load.d/lirc.conf with this (use "nano") :
Code: Select all
lirc_rpi


4) Creating a file /etc/conf.d/lircd.conf
Code: Select all
LIRCD_ARGS="--uinput"
DRIVER="default"
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"


5) Creating a file /etc/modprobe.d/lirc.conf
Code: Select all
options lirc_rpi gpio_in_pin=23 gpio_out_pin=22


6) load service "lircd.service" like this : (with systemctl command...)
Image

7) Creating a file /etc/lirc/lircd.conf.d/lircd.conf :
Code: Select all
# 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 Oct 29 14:49:46 2016
#
# contributed by DOUG WYMAN
#
# brand:                       KEYES
# model no. of remote control:
# devices being controlled by this remote:
#

begin remote

  name  KEYES
  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       9087  4478
  one           609  1632
  zero          609   526
  ptrail        610
  repeat       9089  2212
  pre_data_bits   16
  pre_data       0xFF
  gap          108011
  toggle_bit_mask 0x0

      begin codes
          KEY_UP                   0x629D
          KEY_DOWN                 0xA857
          KEY_LEFT                 0x22DD
          KEY_RIGHT                0xC23D
          KEY_OK                   0x02FD
          KEY_1                    0x6897
          KEY_2                    0x9867
          KEY_3                    0xB04F
          KEY_4                    0x30CF
          KEY_5                    0x18E7
          KEY_6                    0x7A85
          KEY_7                    0x10EF
          KEY_8                    0x38C7
          KEY_9                    0x5AA5
          KEY_0                    0x4AB5
          KEY_BACK                 0x42BD
          KEY_EXIT                 0x52AD
      end codes

end remote


RQ : it's speciale file for KEYES remote, each remote has a special file like this...
User avatar
dom_france
 
Posts: 35
Joined: 28 Jan 2018, 07:54

Re: RuneAudio_rpi2_rp3_0.4-beta_20170229_2GB + IR REMOTE(KEY

Postby dom_france » 09 Mar 2018, 16:32

8) there is a BUG in lirc library :
you haved to change this file : /etc/lirc

change
Code: Select all
driver          = devinput
device          = auto


to

Code: Select all
driver          = default
device          = /dev/lirc0


9) OK, no, you can try "irw" command to scrut each ir remote button (one after one...) :

Image

Yeeees !!! Congratulation !!! First step : recognized my IR remote => recognize successfully !!!!
User avatar
dom_france
 
Posts: 35
Joined: 28 Jan 2018, 07:54

Re: RuneAudio_rpi2_rp3_0.4-beta_20170229_2GB + IR REMOTE(KEY

Postby dom_france » 09 Mar 2018, 16:38

9) creating file /etc/lirc/irexec.lircrc : (preparation of mapping key)

RQ : it's my exemple...

Code: Select all
#
# Initial test configuration for systemwide irexec service.
#
# Note that the system-wide service is useful only in corner-cases.
# Most scenarios are better off with a session service as described in the
# Configuration Guide. However, note that both can also be combined.
#
# Also note that the system-wide service runs without a terminal. To
# check the output generated use something like
# 'journalctl -b0 /usr/bin/irexec'. This service just echoes some keys
# commonly available.
#

begin
    prog   = irexec
    button = KEY_UP
    config = echo "KEY_UP"
end

begin
    prog   = irexec
    button = KEY_DOWN
    config = echo "KEY_DOWN"
end

begin
    prog   = irexec
    button = KEY_LEFT
    config = echo "KEY_LEFT"
end

begin
    prog   = irexec
    button = KEY_RIGHT
    config = echo "KEY_RIGHT"
end

begin
    prog   = irexec
    button = KEY_OK
    config = echo "KEY_OK"
end

begin
    prog   = irexec
    button = KEY_1
    config = echo "KEY_1"
end

begin
    prog   = irexec
    button = KEY_2
    config = echo "KEY_2"
end

begin
    prog   = irexec
    button = KEY_3
    config = echo "KEY_3"
end

begin
    prog   = irexec
    button = KEY_4   
    config = echo "KEY_4"
end

begin
    prog   = irexec
    button = KEY_5
    config = echo "KEY_5"
end

begin
    prog   = irexec
    button = KEY_6
    config = echo "KEY_6"
end

begin
    prog   = irexec
    button = KEY_7
    config = echo "KEY_7"
end

begin
    prog   = irexec
    button = KEY_8
    config = echo "KEY_8"
end

begin
    prog   = irexec
    button = KEY_9
    config = echo "KEY_9"
end

begin
    prog   = irexec
    button = KEY_0
    config = echo "KEY_0"
end

begin
    prog   = irexec
    button = KEY_BACK
    config = echo "KEY_BACK"
end

begin
    prog   = irexec
    button = KEY_EXIT
    config = echo "KEY_EXIT"
end


10) Creating /etc/conf.d/lircrc : (mapping key button => mpd fonctionality)
Code: Select all
begin
   prog = irexec
   button = KEY_UP
   config = mpc volume +5
end

begin
   prog = irexec
   button = KEY_DOWN
   config = mpc volume -5
end

begin
     prog = irexec
     button = KEY_LEFT
     config = mpc prev
     repeat = 0
end

begin
     prog = irexec
     button = KEY_RIGHT
     config = mpc next
     repeat = 0
end

begin
     prog = irexec
     button = KEY_OK
     config = mpc toggle
     repeat = 0
end

#It's a test (DOM test)
begin
     prog = irexec
     button = KEY_1
     config = mpc seek +00:01:00
     repeat = 0
end
#It's a test (DOM test)
begin
     prog = irexec
     button = KEY_2
     config = mpc seek -00:01:00
     repeat = 0
end


11) creating a new start service : /lib/systemd/system/irexec_KEYES_IR_REMOTE.service
Code: Select all
[Unit]
Description=Start irexec daemon
Wants=lircd.service
After=network.target

[Service]
Type=simple
ExecStartPre=/usr/bin/sh -c "sleep 3"
ExecStart=/usr/bin/irexec /etc/conf.d/lircrc

[Install]
WantedBy=multi-user.target


12) Run this service :
Image

13) the END


Ouaaaaah...........

DOM from France
User avatar
dom_france
 
Posts: 35
Joined: 28 Jan 2018, 07:54

Re: RuneAudio_rpi2_rp3_0.4-beta_20170229_2GB + IR REMOTE(KEY

Postby poleg » 11 Dec 2018, 11:00

There is contradiction for gpio_out_pin:

- at /boot/config.txt
dtparam=gpio_out_pin=24
dtparam=gpio_in_pin=23

- at /etc/modprobe.d/lirc.conf
options lirc_rpi gpio_in_pin=23 gpio_out_pin=22
poleg
 
Posts: 1
Joined: 11 Dec 2018, 10:55

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 1 guest