{"id":34227033,"url":"https://github.com/mtraver/rpi-ir-remote","last_synced_at":"2026-03-10T20:34:05.574Z","repository":{"id":54449569,"uuid":"106967622","full_name":"mtraver/rpi-ir-remote","owner":"mtraver","description":"Instructions and code for using a Raspberry Pi as an IR remote control","archived":false,"fork":false,"pushed_at":"2023-10-25T22:22:43.000Z","size":332,"stargazers_count":96,"open_issues_count":4,"forks_count":5,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-16T01:42:22.027Z","etag":null,"topics":["circuit","go","golang","infrared-control","ir-codes","ir-remote","lirc","lirc0-9-4","raspberry-pi","raspberry-pi-iot","raspbian","raspbian-stretch"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtraver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-14T22:34:11.000Z","updated_at":"2024-09-02T01:58:27.000Z","dependencies_parsed_at":"2024-06-18T23:25:35.750Z","dependency_job_id":"08b2df97-0596-49ba-970f-6cd6b2fda8e5","html_url":"https://github.com/mtraver/rpi-ir-remote","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mtraver/rpi-ir-remote","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtraver%2Frpi-ir-remote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtraver%2Frpi-ir-remote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtraver%2Frpi-ir-remote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtraver%2Frpi-ir-remote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtraver","download_url":"https://codeload.github.com/mtraver/rpi-ir-remote/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtraver%2Frpi-ir-remote/sbom","scorecard":{"id":666763,"data":{"date":"2025-08-11","repo":{"name":"github.com/mtraver/rpi-ir-remote","commit":"d185ce4ba7d4f72b0a5bd5dd048d825ee12b3689"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3553 / GHSA-mh63-6h87-95cp","Warn: Project is vulnerable to: GO-2024-3250 / GHSA-29wx-vh33-7x7r","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GO-2023-2153 / GHSA-m425-mq94-257g / GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2025-3488 / GHSA-6v2p-p543-phr9","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T18:19:08.539Z","repository_id":54449569,"created_at":"2025-08-21T18:19:08.539Z","updated_at":"2025-08-21T18:19:08.539Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30352881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circuit","go","golang","infrared-control","ir-codes","ir-remote","lirc","lirc0-9-4","raspberry-pi","raspberry-pi-iot","raspbian","raspbian-stretch"],"created_at":"2025-12-16T00:39:35.896Z","updated_at":"2026-03-10T20:34:05.551Z","avatar_url":"https://github.com/mtraver.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry Pi IR Remote Control\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/mtraver/rpi-ir-remote)](https://goreportcard.com/report/github.com/mtraver/rpi-ir-remote)\n\nGoals:\n1. Using a Raspberry Pi and an IR LED, send IR codes to control audio/video\n   equipment.\n2. Control the Raspberry Pi via voice commands through Google Home.\n\nThere are a number of projects like this around the internet. The hardest\npart for me – and for others, it seems – was the IR driver/lib configuration,\nso this project documents what worked for me given my combination of hardware\nand software.\n\n## Send IR codes with IR LED\n\nMy setup:\n- Raspberry Pi 3 Model B\n- Raspbian Stretch Lite, release date 2017-09-07\n\n### Step 0: Set up the hardware\n\nThere are many ways to set up your LED driver circuit. I used a basic transistor\ncircuit like the one depicted at http://www.raspberry-pi-geek.com/Archive/2015/10/Raspberry-Pi-IR-remote.\n\nMake note of the GPIO pin connected to the base of the transistor, as that's\nthe pin we need to control to drive the LED. In my case that's pin 23 (you'll\nsee this number in the configuration instructions below).\n\n**TIP:** Your eyes can't see infrared light, but your phone's camera can.\nUseful for debugging your circuit.\n\n### Step 1: Install [LIRC](http://www.lirc.org/)\n\n    sudo apt-get install lirc\n\n**NOTE:** I'm using stretch (Debian 9), so this installs LIRC 0.9.4c. 0.9.4 is\nquite different from 0.9.0, which is what you'll get if you're running jessie\n(Debian 8). If you have 0.9.0 Step 3 will be different\u003csup\u003e1\u003c/sup\u003e.\n\n### Step 2: Enable `lirc-rpi` or `gpio-ir` kernel module\n\n**NOTE:** Whether you enable `lirc-rpi` or `gpio-ir` depends on the kernel version you're using\n(check with `uname -a`). On 4.14 you'll use `lirc-rpi` and on 4.19 you'll use `gpio-ir`. Instructions\nfor both cases are given below. See the Appendix if you'd like to read more about this.\n\nWe're going to do this via the device tree by editing `/boot/config.txt`.\n\n    sudo vim /boot/config.txt\n\nYou'll see these lines in `config.txt`:\n\n    # Uncomment this to enable the lirc-rpi module\n    #dtoverlay=lirc-rpi\n\nIf you're on **kernel version 4.14**, uncomment the `dtoverlay` line and change it to look like this:\n\n    dtoverlay=lirc-rpi,gpio_in_pin=22,gpio_out_pin=23\n\nIf you're on **kernel version 4.19**, add these lines (you can leave any lines containing `lirc-rpi` commented out, or you can remove them):\n\n    dtoverlay=gpio-ir,gpio_pin=22\n    dtoverlay=gpio-ir-tx,gpio_pin=23\n\nSee how `gpio_out_pin` / `gpio-ir-tx`'s `gpio_pin` is set to 23? If you're not using pin 23 change that.\nYou can ignore `gpio_in_pin` / `gpio-ir`'s `gpio_pin`. It's used for an IR receiver.\nTODO(mtraver) document that if I ever actually use the receiver for anything.\n\nOptional: To enable more verbose logging (which you'll find in `dmesg`), add\n`debug=1` like this (as long as you're on 4.14; adding `debug=1` didn't seem to\nchange the behavior of `gpio-ir` on 4.19):\n\n    # Uncomment this to enable the lirc-rpi module\n    dtoverlay=lirc-rpi,gpio_in_pin=22,gpio_out_pin=23,debug=1\n\n**DO NOT** edit `/etc/modules`. Other tutorials may mention putting something\nsimilar to what we added to `config.txt` into `/etc/modules`. This is\nunnecessary.\n\n**DO NOT** add a file in `/etc/modprobe.d`. Other tutorials may mention putting\nsomething similar to what we added to `config.txt` into a file like\n`/etc/modprobe.d/ir-remote.conf` or `/etc/modprobe.d/lirc.conf`. This is\nunnecessary.\n\n### Step 3: Configure LIRC\n\nThe default LIRC configuration does not enable transmitting. From the LIRC\n[configuration guide](http://www.lirc.org/html/configuration-guide.html):\n\n\u003e From 0.9.4+ LIRC is distributed with a default configuration based on\n\u003e the devinput driver. This should work out of the box with the following\n\u003e limitations:\n\u003e\n\u003e - There must be exactly one capture device supported by the kernel\n\u003e - The remote(s) used must be supported by the kernel.\n\u003e - There is no need to do IR blasting (i. e., to send IR data).\n\nLet's fix that.\n\n    sudo vim /etc/lirc/lirc_options.conf\n\nChange `driver` to `default` and `device` to `/dev/lirc0`. Here's the diff\nbetween the default config and my config:\n\n    $ diff -u3 /etc/lirc/lirc_options.conf.dist /etc/lirc/lirc_options.conf\n    --- /etc/lirc/lirc_options.conf.dist  2017-04-05 20:23:20.000000000 -0700\n    +++ /etc/lirc/lirc_options.conf 2017-10-14 14:58:18.584886645 -0700\n    @@ -8,8 +8,8 @@\n\n     [lircd]\n     nodaemon        = False\n    -driver          = devinput\n    -device          = auto\n    +driver          = default\n    +device          = /dev/lirc0\n     output          = /var/run/lirc/lircd\n     pidfile         = /var/run/lirc/lircd.pid\n     plugindir       = /usr/lib/arm-linux-gnueabihf/lirc/plugins\n\n\n**DO NOT** edit or add `hardware.conf`. Other tutorials may mention making\nchanges to `/etc/lirc/hardware.conf`. LIRC 0.9.4 does not use\n`hardware.conf`\u003csup\u003e2\u003c/sup\u003e.\n\n### Step 4: Add remote control config files\n\nWe need to tell LIRC which codes to transmit to talk to the equipment we wish\nto control. LIRC maintains a repo of config files for many remote controls:\nhttps://sourceforge.net/projects/lirc-remotes/\n\nFind the one for your remote control and place it in `/etc/lirc/lircd.conf.d`.\nAs long as it has a `.conf` extension it'll be picked up.\n\nIf there isn't an existing config for your remote, you're in for an adventure...\nI happen to be controlling a Cambridge Audio CXA60 amp with my Raspberry Pi and\nthere was no config file for it so I made one. It's checked into this repo.\n\nHere's what my config directory looks like:\n\n    $ ll /etc/lirc/lircd.conf.d\n    total 52\n    drwxr-xr-x 2 root root  4096 Oct 14 11:49 .\n    drwxr-xr-x 3 root root  4096 Oct 14 14:58 ..\n    -rw-r--r-- 1 root root  2679 Oct 14 11:49 cxa_cxc_cxn.lircd.conf\n    -rw-r--r-- 1 root root 33704 Apr  5  2017 devinput.lircd.conf\n    -rw-r--r-- 1 root root   615 Apr  5  2017 README.conf.d\n\n### Step 5: Reboot\n\n    sudo reboot\n\nBelow are some sanity checks for modules and services and stuff after you reboot.\n\nOn **kernel version 4.14** using `lirc-rpi`:\n\n    $ dmesg | grep lirc\n    [    3.276240] lirc_dev: IR Remote Control driver registered, major 243\n    [    3.285866] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.\n    [    4.340562] lirc_rpi: auto-detected active low receiver on GPIO pin 22\n    [    4.340882] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0\n    [    4.340888] lirc_rpi: driver registered!\n    [   11.929858] input: lircd-uinput as /devices/virtual/input/input0\n\n    $ lsmod | grep lirc\n    lirc_rpi                9032  3\n    lirc_dev               10583  1 lirc_rpi\n    rc_core                24377  1 lirc_dev\n\n    $ ll /dev/lirc0\n    crw-rw---- 1 root video 243, 0 Oct 14 17:08 /dev/lirc0\n\n    $ ps aux | grep lirc\n    root       343  0.0  0.1   4208  1084 ?        Ss   17:08   0:00 /usr/bin/irexec /etc/lirc/irexec.lircrc\n    root       381  0.0  0.1   4280  1140 ?        Ss   17:08   0:00 /usr/sbin/lircmd --nodaemon\n    root       516  0.4  0.4   7316  3980 ?        Ss   17:09   0:00 /usr/sbin/lircd --nodaemon\n    root       517  0.0  0.1   4284  1164 ?        Ss   17:09   0:00 /usr/sbin/lircd-uinput\n    pi         574  0.0  0.0   4372   552 pts/0    S+   17:09   0:00 grep --color=auto lirc\n\nOn **kernel version 4.19** using `gpio-ir`:\n\n    $ dmesg | grep \"lirc\\|gpio-ir\"\n    [    3.459164] rc rc0: GPIO IR Bit Banging Transmitter as /devices/platform/gpio-ir-transmitter@17/rc/rc0\n    [    3.459396] rc rc0: lirc_dev: driver gpio-ir-tx registered at minor = 0, no receiver, raw IR transmitter\n    [    3.522934] rc rc1: lirc_dev: driver gpio_ir_recv registered at minor = 1, raw IR receiver, no transmitter\n    [   14.468862] input: lircd-uinput as /devices/virtual/input/input1\n\n    $ lsmod | grep gpio_ir\n    gpio_ir_tx             16384  0\n    gpio_ir_recv           16384  0\n\n    $ ll /dev/lirc0\n    crw-rw---- 1 root video 252, 0 May 26 17:10 /dev/lirc0\n\n    $ ps aux | grep lirc\n    root       364  0.0  0.1   4268  1088 ?        Ss   17:11   0:00 /usr/sbin/lircmd --nodaemon\n    root       369  0.0  0.1   4196  1072 ?        Ss   17:11   0:00 /usr/bin/irexec /etc/lirc/irexec.lircrc\n    root       555  0.1  0.3   7296  3428 ?        Ss   17:11   0:00 /usr/sbin/lircd --nodaemon\n    root       556  0.0  0.1   4272  1172 ?        Ss   17:11   0:00 /usr/sbin/lircd-uinput\n    pi         893  0.0  0.0   4368   544 pts/0    S+   17:13   0:00 grep --color=auto lirc\n\n### Step 6: Test\n\n    irsend SEND_ONCE cambridge_cxa KEY_POWER_ON\n\nReplace `cambridge_cxa` with the contents of the `name` field from your remote\ncontrol config file, and `KEY_POWER_ON` with some code from the `codes` section.\n\nAt the very least this should execute without errors. If you enabled debugging\nin the device tree (see Step 2) you can get some insight into what happened\nby executing `dmesg | grep lirc`. Use your phone camera to watch the LED light\nup.\n\n## Control via voice commands\n\n**NOTE:** I built this before Google launched [smart home Actions](https://developers.google.com/actions/smarthome/).\nAt the time there were only conversation-based Actions, which don't fit this use\ncase. A smart home Action is a better solution than what I describe below.\n\nI wanted to issue IR codes by voice, so I did the following:\n- Wrote a web server that runs on the Raspberry Pi. It exposes one endpoint for\n  each IR code (e.g. /volup to turn up the volume), and `POST`ing to the\n  endpoint will call the `irsend` command line utility to issue the code. See\n  below for more info on deploying the web server.\n- Exposed the web server to the internet using [ngrok](https://ngrok.com/).\n  The docs are great so I leave this step as an exercise for the reader.\n- Use [IFTTT webhooks](https://ifttt.com/maker_webhooks) to set up rules such\n  that when I say something like \"Ok Google, it's music time\" to my Google Home,\n  IFTTT fires off a request to the ngrok endpoint that points to the Raspberry\n  Pi, instructing it to issue the IR code that turns on the sound system.\n\n### Build the server\n\nThe server is written in Go. The main package is `cmd/server/main.go`. This repo\nincludes a Makefile that builds it for your host architecture as well as ARMv6\n(e.g. Raspberry Pi Zero W) and ARMv7 (e.g. Raspberry Pi 3 B\u003csup\u003e3\u003c/sup\u003e). It\nwill produce binaries in the `out` directory.\n\n### Security!\n\n**NOTE:** Again, I built this before Google launched\n[smart home Actions](https://developers.google.com/actions/smarthome/). Using\nsmart home Actions is the most secure and elegant way to do this.\n\nSecurity is good. The knobs available to us aren't great [insert rant here about\nthe current state of IoT security] but we'll do what we can to lock it down.\n\n- ngrok ([config options here](https://ngrok.com/docs#config))\n    - ngrok can do HTTP basic auth. Use it. Of course the password is in the\n      clear in your IFTTT rule but it's better than nothing.\n    - Set `bind_tls: true` in your config to expose only an HTTPS endpoint.\n    - Set `inspect: false` in your config to disable request inspection.\n- Web server\n    - The web server has a basic token check built in. In the JSON payload\n      `POST`ed by IFTTT, include a `token` key. If its value doesn't match\n      the token defined on the Raspberry Pi it will stop and return a 403.\n\nThat's all that's possible as far as I can tell. IFTTT webhooks don't allow for\nany kind of secure token authentication.\n\n### Running the server\n\nThe web server is a statically linked binary. We'll use systemd to start it up\nand keep it running.\n\n1. Place the `server` binary built for your required architecture in `/home/pi`.\n2. This repo contains a systemd service definition at `config/systemd/irremote.service`.\n   Copy it into the `/lib/systemd/system` directory on the Raspberry Pi.\n3. To enable and start the service, run\n\n   ```\n   sudo systemctl enable irremote.service\n   sudo systemctl start irremote.service\n   ```\n\n### Running ngrok\n\nThere is also a systemd service definition for ngrok in `config/systemd`. Follow the same steps\nas above to install and enable it.\n\nThe service definition assumes that the ngrok binary is at `/usr/local/bin/ngrok`. Change the service\ndefinition (both `ConditionPathExists` and `ExecStart`) if you'd like ngrok to live somewhere else.\n\n## Appendix\n\n### `Warning: Cannot access device: /dev/lirc0` on kernel 4.19\n\n**NOTE:** This is just a record of my debugging process from when I upgraded to 4.19 and\nLIRC stopped working. All actions required for 4.19 are already included above.\n\nOn 2019-05-25 I upgraded my pi and it ended up on\n`Linux 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l`.\n\nLIRC no longer worked! Checking the logs I found this:\n\n    $ grep lirc /var/log/syslog\n    ...\n    May 25 15:27:01 irremote-pi lircd-0.9.4c[793]: Warning: Cannot access device: /dev/lirc0\n    ...\n\nThankfully I had checked the kernel version before upgrading. It was\n`Linux 4.14.52-v7+ #1123 SMP Wed Jun 27 17:35:49 BST 2018 armv7l`.\n\nAs a first step I tried rolling back to that version using `rpi-update`. I found the commit\nin [github.com/Hexxeh/rpi-firmware](https://github.com/Hexxeh/rpi-firmware/commits/master)\nthat upgraded to 4.14.52 and passed that commit hash to `rpi-update` to roll back:\n\n\n    sudo rpi-update 963a31330613a38e160dc98b708c662dd32631d5\n\n\nAfter rebooting, the kernel was indeed rolled back and LIRC worked again.\n\nAlright, now time to find the breaking commit!\n\nFirst I jumped straight to the last 4.14: `kernel: Bump to 4.14.98` (`a08ece3d48c3c40bf1b501772af9933249c11c5b`, committed 2019-02-12).\nThis put me on `Linux 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux` and LIRC worked. Woohoo!\n\nThe next update goes all the way to 4.19.23. I upgraded to `1c60d16af8cc43214495f18549228dde83e99265` and ended up\non `Linux 4.19.23-v7+ #1202 SMP Mon Feb 18 15:55:19 GMT 2019 armv7l GNU/Linux`. LIRC did not work;\nthe warning about `/dev/lirc0` was back.\n\n#### `gpio-ir` on 4.19\n\nI was all set to call it a day and leave my pi on 4.14, but then I found this:\nhttps://www.raspberrypi.org/forums/viewtopic.php?t=235256.\n\nThe TL;DR is that 4.19 does not include `lirc_dev` so one must use `gpio-ir`. It's simply a change to\nthe `dtoverlay` in `/boot/config.txt` and it works as before. For sending IR codes that's all that's required.\n\nFor recording there's more to do but I'll leave it as an exercise for the reader to follow the instructions\nin the aforementioned raspberrypi.org forum post. For me sending IR codes worked both with and without the\npatched LIRC; I don't record IR codes in this project so I stuck with the stock, unpatched LIRC.\n\n## Footnotes\n[1] Other projects around the internet tend to be built using 0.9.0, leading to\nsome frustration while configuring, even though configuring 0.9.4 is a nicer\nexperience. I hope this project can help others in the same boat!\n\n[2] Alec Leamas, LIRC maintainer, states\n[here](http://lirc.10951.n7.nabble.com/Re-lirc-installation-on-raspberry-pi-running-Raspbian-jessie-tp10721p10725.html)\nthat \"0.9.4 does not use hardware.conf.\"\n\n[3] \"How can this be!? The Raspberry Pi 3 B uses the BCM2837, a 64-bit ARMv8\nSoC!\" you exclaim. \"That is correct,\" I reply, \"but Raspbian is 32-bit only so\nthe chip runs in 32-bit mode. It therefore cannot execute ARMv8 binaries.\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtraver%2Frpi-ir-remote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtraver%2Frpi-ir-remote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtraver%2Frpi-ir-remote/lists"}