{"id":16735677,"url":"https://github.com/smarthome-go/rpirf","last_synced_at":"2026-04-02T02:53:37.038Z","repository":{"id":110494058,"uuid":"489472747","full_name":"smarthome-go/rpirf","owner":"smarthome-go","description":"A Go library for sending 433mhz signals from a Raspberry Pi","archived":false,"fork":false,"pushed_at":"2023-09-02T21:19:50.000Z","size":39,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-15T01:55:03.309Z","etag":null,"topics":["433mhz","go","golang","gpio-library","hardware-libraries","radio-control","raspberry-pi"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/smarthome-go/rpirf","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smarthome-go.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-06T19:34:08.000Z","updated_at":"2024-07-19T19:23:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"5ea294ed-0a8e-449a-b812-8689b753f3bd","html_url":"https://github.com/smarthome-go/rpirf","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Frpirf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Frpirf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Frpirf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smarthome-go%2Frpirf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smarthome-go","download_url":"https://codeload.github.com/smarthome-go/rpirf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225776635,"owners_count":17522550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["433mhz","go","golang","gpio-library","hardware-libraries","radio-control","raspberry-pi"],"created_at":"2024-10-13T00:06:53.581Z","updated_at":"2026-04-02T02:53:36.995Z","avatar_url":"https://github.com/smarthome-go.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rpirf\n A library for sending `433mhz` signals via a Raspberry Pi.\n\nProtocol and logic ported from https://github.com/milaq/rpi-rf\n## Supported Hardware\n### Sender\nMost generic 433/315MHz capable modules connected via GPIO to a Raspberry Pi will work with this library.\nThe picture below displays a unit which has been tested.\n\n![433mhz sender](./hardware.webp)\n\n### Outlets / Sockets\nMost generic 433mhz remote controlled outlets do work.\nThe picture below displays a outlet which works with the sender and library.\n\n![generic socket](./socket.webp)\n\nThe library has been tested on following outlets using a *Raspberry Pi 3b* and a *Raspberry Pi 2b*, both running *Raspbian Lite*.\n\n\n## Limitations\nAs of now (*March 14 2022*), the library does not support receiving (*sniffing*) signals in order to send them later.\n\nHowever, a Python library by [milaq/rpi-rf](https://github.com/milaq/rpi-rf) is recommended, which supports sending as well as receiving data.\n\nHowever, the go *rpirf* library is only supposed to support sending.\n\n## Installation / Setup\n\nTo install the library in your current go project, *go get* it using following command:\n```\ngo get github.com/smarthome-go/rpirf\n```\nYou can then import the library in your project using following code\n\n```go\nimport \"github.com/smarthome-go/rpirf\"\n```\n\n## Getting started\n### Creating a *new instance*\nBefore data can be sent, the physical device must be set up, and some basic parameters, for example *pulselength* or *protocol* must be set.\n\n```go\ndevice := rpirf.NewRF(17, 1, 10, 180, 24)\n```\n\nThe following parameters describe\n- the `BCM` pin number\n- Protocol to use\n- How often each code should be sent (for redundancy)\n- The pulselength\n- The content length\n\n### Sending codes\nAfter the device has been set up, any `int` can be sent as a code.  \nThe `Send` method encodes the provided code to binary and sends it using the previously configured hardware.\n```go\ndevice.Send(5121438)\n```\n### Cleaning up\nAfter all data has been sent, it is recommended to clean the device.\nHowever, in a typical setup, this function is either `defered` or called on program exit.\n```go\ndevice.Cleanup()\n```\nMake sure to implement proper error handling for the functions above.  \nFor a complete reference, take a look at the [Example](#example)\n\n## Example\n```go\npackage main\n\nimport (\n\t\"github.com/smarthome-go/rpirf\"\n)\n\nfunc main() {\n\tdevice, err := rpirf.NewRF(17, 1, 10, 180, 24)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tif err := device.Send(123456); err != nil {\n\t\tpanic(err.Error())\n\t}\n\tif err := device.Cleanup(); err != nil {\n\t\tpanic(err.Error())\n\t}\n\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthome-go%2Frpirf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmarthome-go%2Frpirf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthome-go%2Frpirf/lists"}