loading

Introduction

This remote control in the picture used to control a fan until the fan stopped working. I threw away the fan and saved the remote control unit. This is definitely my personal favourite instructable because it is is useful for lazy people like me. Too lazy to use click on menu, buttons, keyboards and mouse.

Scope

This instructable will show how to install and configure a LIRC client program, irexec:

  1. To shutdown the Raspberry Pi.
  2. To reboot the Raspberry Pi.

It will NOT cover how to add infrared interface to Raspberry Pi which is covered in my other instructable.

Target Readers

Anyone who has a Raspberry Pi with a infrared interface.

Step 1: Record and Map Infrared Codes to LIRC Events

Step 2: Make Raspberry Pi Respond to Remote Control Events

The remote control unit sends IR signals when its buttons are pressed. LIRC daemon captures the IR signals and translate it to LIRC events. However, it doesn't know what to do with the LIRC events. "irexec" is the program that will translate the LIRC events into actions. irexec is classified as a LIRC client

Create a configuration file that will tell irexec what to do when LIRC events occur.

$cd /etc/lirc

Enter the values as show in the screenshot.

$sudo vi lircrc

Step 3: Test

Open terminal emulator in Raspberry Pi

$sudo reboot

Point the remote control at the Raspberry Pi
Press the button that was mapped to "KEY_RESTART". The Raspberry Pi should reboot.

Press the button that was mapped to "KEY_POWER". The Raspberry Pi should power off.

If nothing happens, then it's time to debug.

About This Instructable

7,494views

36favorites

Bio: Systems Administrator and Software Programmer.
More by mirza irwan osman:Install Modem USB Device in Raspberry Pi Make the Volume Knob of Sound Blaster X-Fi Surround 5.1 Pro Sound Card Work in Raspberry Pi Create a Volume Control for USB Sound Card in Raspberry Pi 
Add instructable to: