Reuse Unwanted Infrared Remote Control to Shutdown and Reboot Raspberry Pi

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.Reuse Unwanted Infrared Remote Control to Shutdown and Reboot Raspberry Pi

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: Install and configure Linux Infrared Remote Control (LIRC) daemon

Complete the steps in my instructable for the above.

Step 3: 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 clientCreate 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

Reuse Unwanted Infrared Remote Control to Shutdown and Reboot Raspberry Pi schematichStep 4: 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.

 

 

For more detail: Reuse Unwanted Infrared Remote Control to Shutdown and Reboot Raspberry Pi


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top