General setup
- Raspberry PI 2
- SEG ArtColor TV
- PIR module (GPIO 17, 18), IR transmitter (GPIO 4)
The PIR module will detect motion. If a motion is sense the TV will be switched on via the IR transmitter (simulation of IR remote). After a predefined timeout periode without further motion the TV will switched off (to standby).
Install and enable lirc
-
install
lirc
sudo apt-get install lirc
- enable
lirc
module - edit/boot/config.txt
dtoverlay=lirc-rpi,gpio_out_pin=4,gpio_in_pin=22
- configure
lirc
- edit/etc/lirc/hardware.conf
LIRCD_ARGS="" ... DRIVER="default" DEVICE="/dev/lirc0" MODULES="lirc_rpi"
Setup IR command to power on/off the TV
- learn IR command
irrecord -d /dev/lirc0 ~/lircd.conf
- copy new file
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
- edit the name parameter in
/etc/lirc/lircd.conf
I choose magicmirror - start
lirc
pi@mamomami /etc/lirc $ sudo /etc/init.d/lirc start [ ok ] Loading LIRC modules:. [ ok ] Starting remote control daemon(s) : LIRC :.
- check if IR command is available
pi@mamomami /etc/lirc $ irsend LIST "magicmirror" "" irsend: 00000000000043bc KEY_POWER
- run
lirc
service on start upsudo update-rc.d lirc defaults
Keine Kommentare
Kommentar veröffentlichen