ir-transmitter [raspberrypi]

20150203_031526
20150209_020741

based on:
http://alexba.in/blog/2013/03/09/raspberrypi-ir-schematic-for-lirc
http://www.spech.de/blog/article/universalfernbedienungrpi

shopping list:
Infrared Diode LED IR Emission: http://www.amazon.de/gp/product/B00EFOTJZE?
BC547 TO-92 NPN Transistor: http://www.amazon.de/gp/product/B00CYYMPN0?
4,7k Ohm resistor: http://www.amazon.de/Carbon-Resistor-0-25w-4-7k-Ohm/dp/B004S0Z95O/
10x single male: http://www.amazon.de/gp/product/B008QUVM4E?
breadboard: http://www.amazon.de/gp/product/B00KAPF3Z2?

Installation for the ir-transmitter is the
same as https://fredfire1.wordpress.com/2015/01/19/copy-remote-controls-onto-phone-raspberrypi-android/

backup the old lirc file:
sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd_original.conf

Remove a wrong file:
sudo rm ~/RC.conf

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

ir-record:
irrecord -f -d /dev/lirc0 RC.conf --disable-namespace
// --disable -namespace is for disabling namespace
// -f is for raw mode (use raw mode if the other mode does not work)
or:
irrecord -f -d /dev/lirc0 ~/RC.conf
or:
irrecord -d /dev/lirc0 universalfb

useable namespace names:
https://fredfire1.wordpress.com/2015/02/09/lirc-namespace-raspberrypi/
eg:
KEY_POWER
KEY_CD
KEY_VOLUMEDOWN
KEY_VOLUMEUP

or get the files from:
a) http://lirc-remotes.sourceforge.net/remotes-table.html
b) http://lirc.sourceforge.net/remotes/
wget http://lirc.sourceforge.net/remotes/samsung/AA59-00382A
sudo cp AA59-00382A /etc/lirc/lircd.conf

put all remotes into one file and replace the old lircd:
cat *.conf > lircd.conf
sudo cp lircd.conf /etc/lirc/lircd.conf

or only some remotes into one file:
cat remote1.conf remote2.conf rc3 > lircd.conf
sudo cp lircd.conf /etc/lirc/lircd.conf

copy over new config file:
sudo cp ~/RC.conf /etc/lirc/lircd.conf

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

list all codes for RC.conf:
irsend LIST RC.conf ""

send ir-code once:
irsend SEND_ONCE RC.conf KEY_POWER

send ir-code multiple times:
irsend --count=5 SEND_ONCE RC.conf KEY_VOLUMEDOWN

if you like to remote control your lirc server with your smartphone:
you have to start the lirc server on port 8765:
you can do that once with:
sudo /etc/init.d/lirc stop
sudo lircd --listen --device=/dev/lirc0

but if you want to have the server avaliable on start you have follow the next steps:

sudo nano /etc/init.d/lirc

and insert the line:
ARGS="--listen $ARGS"

like on the picture:
/initd-lircd

then you can use one of the following apps to control the lirc server:
1)https://play.google.com/store/apps/details?id=com.chham.lirc_client (LIRC-CLIENT)
2)https://play.google.com/store/apps/details?id=com.datscharf (AMOTE free)

convert codes from raw to hex:
irrecord -a /etc/lircd.conf

convert and save codes from raw to hex:
irrecord -a lircd.conf >> lircd_hex.conf

Using the reciever diode with lirc:
1) get the name of the remote and the command from the file:
sudo nano /etc/lirc/lircd.conf
eg: name: samsung.conf
button: KEY_POWER
2) prepair a mpc search and play function based on:
http://th0th.me/log/mpd-music-player-daemon-jump-to-song/
cd
wget http://th0th.me/log/wp-content/uploads-old/2011/04/mpdminion.tar.gz
tar -xvf mpdminion.tar.gz
rm mpdminion.tar.gz

3) change your lircrc file:
sudo nano /etc/lirc/lircrc


begin
prog = irexec
remote = samsung.conf
button = POWER
config = mpc stop
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = 1
config = mpc play 1
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = 2
config = mpc play 8
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = 3
config = mpc play 29
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = 4
config = /home/xxfreeddyxx/minion.sh backe
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = 5
config = /home/xxfreeddyxx/minion.sh Hochzeit
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = 6
config = /home/xxfreeddyxx/minion.sh Sauseschritt
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = 7
config = /home/fred/minion.sh Noob
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = 8
config = /home/fred/minion.sh Dennis
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = 9
config = /home/fred/minion.sh O-Ton-Charts
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = VOLUMEUP
config = mpc volume +5
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = VOLUMEDOWN
config = mpc volume -5
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = PLAY
config = mpc play
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = STOP
config = mpc stop
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = REWIND
config = mpc prev
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = CHANNELDOWN
config = mpc prev
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = FORWARD
config = mpc next
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = CHANNELUP
config = mpc next
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = GUIDE
config = mpc stop;/bin/su – xxfreeddyxx -c /home/xxfreeddyxx/create_date_text.sh && /home/xxfreeddyxx/pico_speak.sh “$(cat /home/xxfreeddyxx/speaktest)”
repeat = 0
end
begin
prog = irexec
remote = samsung.conf
button = RETURN
config = sudo reboot
repeat = 0
end

4) restart lirc:
sudo /etc/init.d/lirc restart

Advertisements

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