{"id":18535507,"url":"https://github.com/zopieux/rsl366r","last_synced_at":"2026-05-07T13:13:38.512Z","repository":{"id":146498139,"uuid":"328471635","full_name":"zopieux/rsl366r","owner":"zopieux","description":"A very simple PlatformIO project converting serial commands to RSL366R commands. Tested with Chacon remote plugs (SKU 54660).","archived":false,"fork":false,"pushed_at":"2021-01-30T17:12:46.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-26T06:39:45.597Z","etag":null,"topics":["433mhz","arduino","atmega2560","bluepill","iot","platformio","rc-switch","rsl366","rsl366r","stm32f103c8t6"],"latest_commit_sha":null,"homepage":"","language":"C++","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/zopieux.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,"zenodo":null}},"created_at":"2021-01-10T20:21:17.000Z","updated_at":"2021-01-30T17:12:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f08e45b-72d2-4130-bca6-a6ae142e9c15","html_url":"https://github.com/zopieux/rsl366r","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zopieux/rsl366r","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopieux%2Frsl366r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopieux%2Frsl366r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopieux%2Frsl366r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopieux%2Frsl366r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zopieux","download_url":"https://codeload.github.com/zopieux/rsl366r/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopieux%2Frsl366r/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32739129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"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":["433mhz","arduino","atmega2560","bluepill","iot","platformio","rc-switch","rsl366","rsl366r","stm32f103c8t6"],"created_at":"2024-11-06T19:24:45.099Z","updated_at":"2026-05-07T13:13:38.481Z","avatar_url":"https://github.com/zopieux.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rsl366r\n\nControl radio-controlled power sockets with any Arduino-compatible board and a cheap 433Mhz emitter.\n\n## Hardware needed\n\n1. Some 5V-enabled board with one digital I/O pin and serial communication (eg. USB). I've tested this code successfully with:\n   * A $2 “Blue Pill” STM32F103C8T6 from Aliexpress (`bluepill_f103c8_128k`)\n   * A $6 AT MEGA 2560 clone from Aliexpress (`megaatmega2560`)\n1. A 433 Mhz RF transmitter module. I often see them referred to as “Superheterodyne”. They are often sold in receiver/transmitter kits, for instance [this $1 one](https://www.aliexpress.com/item/32980820915.html) from Aliexpress. \n1. Radio-controlled (433.95MHz) power sockets. This was tested with two [RSL366R ](https://www.amazon.fr/dp/B00FIMWB6Q), sold under the *Chacon* brand, part number SKU 54660.\n\nYou'll possibly need more stuff to upload the program to your device. I used a TTL-232R-3v3 to flash my Blue Pill. Arduino boards like the 2560 are programmed using the built-in USB port and do not need extra cables.\n\nPlug the 433 Mhz transmitter *5V* and *GND* pins to *5V* and *GND* on your board, and its *data* pin to any appropriate digital pin on the board.\nRefer to your board pinout to choose an appropriate digital I/O pin and make note of its Arduino pin number. The example below uses Arduino pin number `10`.\n\n## Setup\n\nRefer to the [Platformio documentation](https://docs.platformio.org/en/latest/tutorials/index.html) on how to compile and program your device from this code. \nYou might need to tweak [`platformio.ini`](./platformio.ini) to fit your environment, such as serial port names or other boards.\n\nYou do not need to change the C++ code for normal usage. All the relevant communication parameters (data pin, pulse length, pulse repeats) are dynamically configurable at runtime. See below.\n\n## Usage\n\nOnce flashed, the device should appear as a serial interface (eg. `/dev/ttyACM0`) to your host computer.\nIt speaks a very simple binary protocol for configuring and sending commands. Please refer to the self-explanatory \nPython code below.\n\nWell-known pulse codes for RSL366R are [documented here](https://gist.github.com/Zopieux/b4a51bca101d59339a839e3cc8e0ec98).\n\nYou might want to tweak the pulse length and TX repeats if the values used below are flaky on your setup.\n5 TX repeats and a 413 µs pulse length work very reliably for me.\n\n```python\nimport serial, struct\n\n# Serial speed is 9600 bauds.\n# Assuming little-endian platform.\ns = serial.Serial(\"/dev/ttyACM0\", 9600)\n\n# First, let's configure the device.\n# Size (bytes) | 1            | 1            | 1            | 2\n# Index        | 0            | 1            | 2            | 3, 4\n# Meaning      | cmd          | transmit pin | pulse repeat | pulse length\nCONFIGURE = 0x00\ns.write(struct.pack(\"\u003cBBBH\", CONFIGURE, 10, 5, 413))\n# Device confirms with an ASCII-encoded LF-terminated line.\nprint(s.readline())\n# b'transmitPin=10;repeatTx=5;pulseLength=413;\\n'\n\n# Then let's send a pulse code.\n# Size (bytes) | 1            | 4\n# Index        | 0            | 1\n# Meaning      | cmd          | transmit code\nSEND = 0x01\ns.write(struct.pack(\"\u003cBL\", SEND, 1381717))\n# Device confirms with an ASCII-encoded LF-terminated line.\nprint(s.readline())\n# b'codeToSend=1381717;\\n'\n```\n\n## License\n\n[GNU General Public License v3.0 or later](https://spdx.org/licenses/GPL-3.0-or-later.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopieux%2Frsl366r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzopieux%2Frsl366r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopieux%2Frsl366r/lists"}