import infrared-remotecontrols with raspberrypi and then use the raw codes on a smartphone with infrared[raspberrypi, android]

shopping list:
http://www.amazon.de/gp/product/B009P04XWW? (breadboard)
http://www.amazon.de/gp/product/B00EFOTJZE? (infrared diode/e.g. VS1838B)
http://www.amazon.de/gp/product/B00DI4ZSRU? (Male – Female jumper wire)

connect the device(this is for the model B):
print out this gpio-pin help so you do not get confused by the pins
https://github.com/simonmonk/wiki_images/raw/master/raspberry%20leaf%20r2.pdf
then connect them like on the following pictures.
irdiode_names
20150119_235626v2
20150120_001748v2

In the 3.18.x RaspberryPi firmware you must modify one additional file for the lirc-rpi kernel extension to be loaded:
Edit your /boot/config.txt file
sudo nano /boot/config.txt
and add:
dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22
Reboot your RaspberryPi after making this change.

Install lirc in raspbian:(based on http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi )
sudo apt-get install lirc -y

sudo nano /etc/modules
add the lines:
lirc_dev
lirc_rpi gpio_in_pin=23 gpio_out_pin=22

Then exit the file with ctrl+x
Press y to confirm to save the file
Press enter

sudo nano /etc/lirc/hardware.conf
change the line:
LIRCD_ARGS=""
to:
LIRCD_ARGS="--uinput"

change the line:
DRIVER="UNCONFIGURED"
to:
DRIVER="default"

change the lines:
DEVICE=""
MODULES=""

to:
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

Then exit the file with ctrl+x
Press y to confirm to save the file
Press enter

2015
sudo nano /boot/config.txt
dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22

sudo /etc/init.d/lirc stop
sudo /etc/init.d/lirc start

sudo reboot

test lirc:
sudo /etc/init.d/lirc stop
mode2 -d /dev/lirc0

use lirc:
irrecord -f -d /dev/lirc0 RemoteControl.conf --disable-namespace
you can use --disable-namespace to disable checks for used keys

if you use the namespace, this is the list of useable names:
https://fredfire1.wordpress.com/2015/02/09/lirc-namespace-raspberrypi/

setup the remote on your smartphone
(you need a smartphone with an ir-transmitter/for example the s4 mini)
install irplus:
https://play.google.com/store/apps/details?id=net.binarymode.android.irplus

copy the raspberrypi-generated .cf or .conf files to the folder /sdcard/Android/data/net.binarymode.android.irplus/files on your smartphone.
for example with ‘es-datei-explorer’:
https://fredfire1.wordpress.com/2015/01/27/winscp-alternative-es-datei-explorer-for-mobile-android/

inside the irplus app:
Gerät hinzufügen->Datei->ok

Advertisements

2 thoughts on “import infrared-remotecontrols with raspberrypi and then use the raw codes on a smartphone with infrared[raspberrypi, android]

  1. Pingback: 树莓派和红外线遥控器开发注记(一):准备工作和测试 | SXKDZ

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s