RPi1-512 LIRC Transmitter/Blaster
#1
Hi,

My project is to use RPi1-512, Kodi, LIRC and an IR transmitter led to send IR codes to teach an universal remote control.

There are some Howto around but only to use Kodi with remote control, so Kodi receive the codes, this is not usual, I know.

What I did so far:
- Build a connector, wires, resistor, IR led to send the IR beam. I didn't had the opportunity to test it.
- Connect to the GPIO connector
- Installed an USB webcam to check if the IR led send something (flashing with remote)
- Install Kodi Krypton build #0406 headless. All commands through ssh WiFi
- Add to /flash/config.txt
Code:
# LIRC setup
dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22
Code:
dmesg | grep lirc
[    9.330336] lirc_dev: IR Remote Control driver registered, major 245
[    9.402180] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.
[   10.323318] lirc_rpi: auto-detected active high receiver on GPIO pin 23
[   10.323634] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0
[   10.323652] lirc_rpi: driver registered!
[   13.547175] input: lircd as /devices/virtual/input/input0
Code:
lsmod
Module                  Size  Used by
rtl8xxxu               52285  0
mac80211              325640  1 rtl8xxxu
cfg80211              238587  1 mac80211
8192cu                599482  0
bcm2835_gpiomem         2791  0
bcm2835_wdt             2922  0
lirc_rpi                6088  3
lirc_dev                7605  1 lirc_rpi
rc_core                15336  1 lirc_dev

- Reboot few times in the process
- I had a look at /etc/lirc/lircd.conf.rpi to note the name of 1 remote and 1 key to send
- I tried
Code:
irsend -d /run/lirc/lircd-lirc0 SEND_ONCE "Dream_Multimedia_URC-39930" "KEY_POWER"
but nothing in the webcam

Questions:
to Milhouse
- As I use the last build, is lirc working with this build? I know sometime packages are removed for few builds.

To all of you who could help:
- How I could test the hardware in kodi with the GPIO?
- Is my process right, what I forgot?
- I have read lirc install on other OS: Do I need to install/set something else (uinput, ...)
- Folders tree is not the same in Openelec than other OS. Where are the files used by lirc in Kodi?
- dmesg shows input pin but not output. Is it right, how does it know the right pin?

Let me know if you need more info
Many thanks for your time
Config, video/audio player:
3T HDD <USB> Odroid N2+ / CoreElec <HDMI> Denon AVR-2313 <HDMI> LG TV 55UF860V
                                          <nfs wired> Linksys WRT32X router <USB> 4T HDD
Reply
#2
I am still looking for a solution but I did some progress and I want to share.

My question was how to check whether my hardware is good or not?
I did a search but had to gather from few sites.
So the way to check it in Kodi 15.2 Openelec 6.0.3 with ssh:

* First install the repository "OpenELEC Add-ons (unofficial)":
- System > Add-ons > ... I had to struggle to find where to add a new repository. I can't exactly tell how, maybe try "Get more" > "parent directory" (..) > Add-on repository ..., play around, then install it.
- Reboot
* Install RPi.GPIO
- Go back in Add-ons and now you should see it in the list: - .. - All repositories - OpenELEC Add-ons (official) - OpenELEC Add-ons (unofficial)
- Click on OpenELEC Add-ons (unofficial) > "Program add-ons" then go down the list to RPi.GPIO
- Install it
- Reboot
* Create a new directory for you python scripts
* Create a file with the name on.py and copy the script:
Code:
#!/usr/bin/python
import sys
sys.path.append('/storage/.kodi/addons/python.RPi.GPIO/lib')
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
#GPIO.cleanup()
GPIO.setwarnings(False)
GPIO.setup(25,GPIO.OUT)
print "Lights on"
GPIO.output(25,GPIO.HIGH)
I use the BCM 25 pin = hardware pin 22
See here
* Create a file with the name off.py and copy the script:
Code:
#!/usr/bin/python
import sys
sys.path.append('/storage/.kodi/addons/python.RPi.GPIO/lib')
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
#GPIO.cleanup()
GPIO.setwarnings(False)
GPIO.setup(25,GPIO.OUT)
print "Lights off"
GPIO.output(25,GPIO.LOW)
* Run the files
Code:
python on.py
If you use a webcam/phone camera, you should see the IR led on. You can as well use a visible led.
Code:
python off.py
Led should be off now.

Now I am sure my hardware is working, back to lirc and remote control
Maybe someone could help me?
Config, video/audio player:
3T HDD <USB> Odroid N2+ / CoreElec <HDMI> Denon AVR-2313 <HDMI> LG TV 55UF860V
                                          <nfs wired> Linksys WRT32X router <USB> 4T HDD
Reply
#3
At last it's working!!!
For reference:

From LIRC site:
- Why should I use LIRC?
- You might want to send IR signals to other devices (IR blasting).

I found my config.txt was not right, so new configuration is:
/flash/config.txt
Code:
# LIRC setup
dtoverlay=lirc-rpi
# Uncomment this to override the defaults for the lirc-rpi module
dtparam=gpio_out_pin=22
dtparam=gpio_out_pin=25
#dtparam=gpio_in_pin=17
#dtparam=gpio_in_pull=down

AFAIK, the useful files are
/usr/share/kodi/system/keymaps/remote.xml
/usr/share/kodi/system/Lircmap.xml
/etc/lirc/lircd.conf.rpi
/etc/lirc/lircd.conf.xbox

Now it's working but not with all the remote in the /etc/lirc/lircd.conf.rpi file
Code:
#  irsend -#20 -d /run/lirc/lircd-lirc0 SEND_ONCE "mceusb" "KEY_PLAY"
#  irsend -#20 -d /run/lirc/lircd-lirc0 SEND_ONCE "vista_mce" "KEY_PLAY"
#  irsend -#20 -d /run/lirc/lircd-lirc0 SEND_ONCE "Dream_Multimedia_URC-39930" "KEY_PLAY"
are OK but
Code:
#  irsend -#20 -d /run/lirc/lircd-lirc0 SEND_ONCE "Apple_A1156" "KEY_PLAYPAUSE"
irsend: command failed: SEND_ONCE Apple_A1156 KEY_PLAYPAUSE 20
irsend: transmission failed
#  irsend -#20 -d /run/lirc/lircd-lirc0 SEND_ONCE "XboxDVDDongle" "KEY_PAUSE"
irsend: command failed: SEND_ONCE XboxDVDDongle KEY_PAUSE 20
irsend: transmission failed
#  irsend -#20 -d /run/lirc/lircd-lirc0 SEND_ONCE "Xbox 360 Remote" "KEY_PLAY"
irsend: command failed: SEND_ONCE Xbox 360 Remote KEY_PLAY 20
irsend: unknown command: "360"
I'd guess the last "unknown command: "360"" is due to the space in the name but what about the other errors?

I'd like to modify the file but it is in read-only. How to edit and/or add files in the /etc/lirc/ directory?

I installed lirc-config-0.9.3a-3.fc23.noarch on my fedora box.
/etc/lirc/lircd.conf.d/README explains the files tree, so:
Code:
# cat /storage/.config/lircd.conf
# Populated config files can be found at http://sf.net/p/lirc-remotes. The
# irdb-get(1) and lirc-setup(1) tools can be used to search and download
# config files.
#
# From 0.9.2 config files could just be dropped as-is in the lircd.conf.d
# directory and be included by this file.

include "lircd.conf.d/*.conf"
Create a directory /storage/.config/lircd.conf.d/ and transfert all the usefull .conf files in it.
Is it working in Kodi? I tried but didn't work for me.
Where should I place the .conf file(s) for my remote(s)?

Any help is more than welcome.
Config, video/audio player:
3T HDD <USB> Odroid N2+ / CoreElec <HDMI> Denon AVR-2313 <HDMI> LG TV 55UF860V
                                          <nfs wired> Linksys WRT32X router <USB> 4T HDD
Reply

Logout Mark Read Team Forum Stats Members Help
RPi1-512 LIRC Transmitter/Blaster0