{"id":36902338,"url":"https://github.com/bweston6/pi-remote","last_synced_at":"2026-01-12T15:48:54.526Z","repository":{"id":45802144,"uuid":"371157903","full_name":"bweston6/pi-remote","owner":"bweston6","description":"A web interface for a Raspberry Pi with GPIO IR transmitter, that acts in place of a remote.","archived":false,"fork":false,"pushed_at":"2021-05-27T16:16:25.000Z","size":57,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-28T01:53:11.045Z","etag":null,"topics":["flask","gpio","ihaospace","infrared","ir","ir-ctl","ir-keytable","jquery","raspberry-pi","raspberry-pi-3","remote-control"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bweston6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-26T20:13:32.000Z","updated_at":"2022-07-16T17:53:25.000Z","dependencies_parsed_at":"2022-07-17T11:46:57.634Z","dependency_job_id":null,"html_url":"https://github.com/bweston6/pi-remote","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bweston6/pi-remote","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweston6%2Fpi-remote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweston6%2Fpi-remote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweston6%2Fpi-remote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweston6%2Fpi-remote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bweston6","download_url":"https://codeload.github.com/bweston6/pi-remote/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweston6%2Fpi-remote/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["flask","gpio","ihaospace","infrared","ir","ir-ctl","ir-keytable","jquery","raspberry-pi","raspberry-pi-3","remote-control"],"created_at":"2026-01-12T15:48:52.007Z","updated_at":"2026-01-12T15:48:54.517Z","avatar_url":"https://github.com/bweston6.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry Pi IR Transmitter Web Interface\nThis project uses Python's `Flask` to host a TV-remote web interface, which uses `ir-ctl` to emit remote codes from an infrared LED.\n\nAll that means that you can use any device on the local network as a remote control for your TV, or other IR device. \n\n## Hardware\n\n* [Raspberry Pi 3B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/)\n\t* Located by the TV for best reception.\n* [iHaospace IR Transmitter Shield](https://www.amazon.co.uk/dp/B089RD8138)\n\t* Any GPIO based transmitter should work - just take note of the pins that the LEDs are connected to.\n\n## Installation\nTo complete this installation I used [Pi OS Lite](https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-03-25/2021-03-04-raspios-buster-armhf-lite.zip) (Mach 4th 2021). I will presume you already have this flashed to an SD card and have WiFi and SSH setup:\n\n1. Uncomment the following lines in `/boot/config.txt` replacing the first with your IR receiver pin and the second with your IR transmitter pin:\n\n\t```ini\n\t# Uncomment this to enable infrared communication.\n\tdtoverlay=gpio-ir,gpio_pin=18\n\tdtoverlay=gpio-ir-tx,gpio_pin=17\n\t```\n\t\n\t* My pins are 18 for receive and 17 for send. \n\t* You don't need to have a receiver but it will help if you need [register your own keys](#receiving-key-codes-and-customisation).\n\n1. To run the Flask server, and interface with the GPIO, you will have to install some Python packages.\n\n\t`ir-keytable` will allow you to test that receiving is working, and record the key-codes with their protocol emitted from your remote.\n\n\tThis is also a good time to update the Pi:\n\n\t```shell\n\t$ sudo apt update\n\t$ sudo apt full-upgrade python3-flask python3-waitress python3-rpi.gpio ir-keytable\n\t```\n\t\n\tYou should reboot after this step so that the kernel overlays from the previous step, and the updates, are loaded.\n\t\n1. From here you can look at customisation, or start the server by running `sudo ./server.py` at the root of the repository:\n\n\t* This will start the server on port 80, so you just need to point a web browser to the Pi's host-name or IP address.\n\t\n\t* The codes emitted are, by default, for a [JVC LT40C550](https://business.currys.co.uk/catalogue/tv-entertainment/tvs/32-42-inch-tvs/jvc-lt-40c550-40-led-tv/B127240B); so this likely won't work with your TV out of the box. There are also two more remotes for RGB lights.\n\t\n1. To start the web server at boot, you can make a `systemd` service to start it for you. Make the following file as root: `/etc/systemd/system/webRemote.service`, with the following content:\n\n\t```\n\t[Unit]\n\tDescription=An IR remote webserver.\n\tAfter=network-online.target\n\n\t[Service]\n\tExecStart=/home/pi/webRemote/server.py\n\n\t[Install]\n\tWantedBy=multi-user.target\n\t```\n\t\n\tTo notify `systemd` of the new service, enable and start it run the following:\n\t\n\t```shell\n\t$ sudo systemctl daemon-reload\n\t$ sudo systemctl enable --now webRemote.service\n\t```\n\t\n\t* This will start the server on port 80, so you just need to point a web browser to the Pi's host-name or IP address.\n\n\n## Receiving Key-Codes and Customisation\n### Receiving\nThis code works great if you have a JVC LT40C550 TV, or similar RGB lights, but you probably don't. To test that your receiver is working and to note the codes and protocol run the following:\n\n```shell\n$ sudo ir-keytable -t -p all\n```\n\nPoint your remote as the receiver and start mashing some buttons:\n\n* If you get output, and there were no errors when running the command, then you're good to start noting down all the buttons.\n* If not refer to `ir-keytable --help` as you may need to manually specify your device with `--device` or `--sysdev`.\n\n### Manually Transmitting\nTo manually send a key-code refer to the output of `ir-keytable` and take note of the protocol and the key value.\n\nTo transmit this information, use the following command:\n\n```shell\n$ sudo ir-ctl -S nec:0xa1f -d /dev/lirc0\n```\n\n* `nec` is the protocol.\n* `0xa1f` is the key-code.\n* `/dev/lirc0` is the device name of the transmitter.\n\nYour TV should respond, and you might be able to see the IR LED flash by looking through the viewfinder of a phone camera.\n\n### Recording Key-Codes\nThe `keyCodes` and `keyNames` are recorded in `irBlaster.py`:\n\n* Note your remote's protocol as you will have to pass it to the `blast(keyName, protocol)` function in `server.py`.\n* Study the format of the key names in `__decode(keyName)` and enter your own values.\n\t\n\tThe variable names themselves don't matter, but you will call them later via the webpage. Ensure that they are assigned as strings and not as hex like in the file.\n\t\n### Modifying the TV-Remote Webpage\nThere is no super simple way of making your own TV-remote page but it is pretty easy to get a hang of how flask works and replace the buttons with your own.\n\nStart by looking at `server.py`:\n\n* The `@app.route()` is the URL that the code refers to.\n\t* Values in `\u003c\u003e` can be taken from the URL as an argument.\n* The `return` value is the webpage that is returned when a particular link is followed.\n* Any code in-between is python code, such as the `blast(keyName, protocol)` function, that you want to run.\n\nIn the `templates/` directory are the webpages that `server.py` can refer to. You can see from `templates/index.html` how the Python code is called:\n\n* Each button is located within a table and has the following attributes:\n\t* `href` - This is generally blank (`#`) as JavaScript/jQuery is used to handle the non-redirecting buttons.\n\t* `id` - This is the `keyName` from `ir-Blaster` that you want to send. The `/query/...` is called by `jQuery`.\n\t* `class` - There are some styles at the top that you can apply so the buttons have rounded edges. This helps with grouping.\n\t* In-between the `\u003ca...\u003e \u003c/a\u003e` tags is the text that you want to appear on the buttons. I'm using [font-awesome](https://fontawesome.com/) icons for most of these. Please make your own account as mine is only free so there are limits.\n* For examples of buttons that redirect, look for `KEY_SUBTITLE`, `KEY_AUDIO` and so on in `templates/extra.html`. These don't have `id`s so that they won't be caught by the JavaScript and link to `/redirect/\u003ckeyName\u003e`.\n\t* Buttons that don't change the page shouldn't be done like this so that the page doesn't refresh in-between each button press.\n* Ensure that the matching statement in the JavaScript correctly matches the start of your key-names. For example, in `index.html`, `[id^=KEY]` matches IDs (`id`) that start with (`^=`) `KEY`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbweston6%2Fpi-remote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbweston6%2Fpi-remote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbweston6%2Fpi-remote/lists"}