{"id":13802004,"url":"https://github.com/mcauser/micropython-ys-rf34t","last_synced_at":"2025-10-28T15:39:18.935Z","repository":{"id":150620723,"uuid":"230220005","full_name":"mcauser/micropython-ys-rf34t","owner":"mcauser","description":"MicroPython examples using YS-RF34T 433MHz ASK/OOK UART transceivers","archived":false,"fork":false,"pushed_at":"2019-12-26T08:04:07.000Z","size":10090,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-22T12:33:28.112Z","etag":null,"topics":["esp32","micropython","rf-ask","tinypico","uart","ys-rf34t"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcauser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-26T07:48:54.000Z","updated_at":"2023-07-23T10:46:40.000Z","dependencies_parsed_at":"2023-05-06T09:32:37.459Z","dependency_job_id":null,"html_url":"https://github.com/mcauser/micropython-ys-rf34t","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mcauser/micropython-ys-rf34t","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-ys-rf34t","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-ys-rf34t/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-ys-rf34t/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-ys-rf34t/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcauser","download_url":"https://codeload.github.com/mcauser/micropython-ys-rf34t/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcauser%2Fmicropython-ys-rf34t/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267468386,"owners_count":24092333,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["esp32","micropython","rf-ask","tinypico","uart","ys-rf34t"],"created_at":"2024-08-04T00:01:32.849Z","updated_at":"2025-10-28T15:39:13.879Z","avatar_url":"https://github.com/mcauser.png","language":null,"readme":"# MicroPython YS-RF34T 433MHz ASK/OOK UART Transceiver\n\nMicroPython examples using YS-RF34T 433MHz ASK/OOK UART transceivers.\n\n![demo](docs/demo.jpg)\n\nThis module consists of an unlabelled MCU that provides a UART interface to two daughter ASK/OOK modules.\n\nA 433MHz receiver (YS-RF470) and a 433MHz transmitter (H34C).\n\nThis module can be used to emulate or program a ASK/OOK based fixed code remotes.\n\nDoes not support rolling code.\n\n# Examples\n\n```python\nfrom machine import Pin, UART\nuart = UART(1, tx=14, rx=15, baudrate=9600)\n\n# sniff for a remote\ndef sniff():\n    while True:\n        if uart.any():\n            print(uart.readline())\n\n# eg. received b'\\xfd\\x84\\x19\\x04D\\xdf'\n\n# replay a remote\ndef replay():\n    # almost the same buf as received\n    # byte 1 is how long to tx for\n    uart.write(bytearray(b'\\xfd\\x03\\x84\\x19\\x04D\\xdf'))\n\n# transmit\ndef tx(addr, key, time=3, width=64):\n\tbuf = bytearray(b'\\xfd\\x00\\x00\\x00\\x00\\x00\\xdf')\n\tbuf[1] = time \u0026 0xff\n\tbuf[2] = (addr \u003e\u003e 8) \u0026 0xff\n\tbuf[3] = addr \u0026 0xff\n\tbuf[4] = width \u0026 0xff\n\tuart.write(buf)\n\n# (0x84 \u003c\u003c 8) | 0x19 = 33817\ntx(33817, 4)\n\n# receive\ndef rx():\n    while True:\n        if uart.any():\n            buf = uart.readline()\n            if len(buf) == 6 and buf[0] == 0xfd and buf[5] == 0xdf:\n                addr = (buf[1] \u003c\u003c 8) | buf[2]\n                key = buf[3]\n                print('Found! Address: {}, Key: {}'.format(addr,key))\n\nrx()\n# Found! Address: 33817, Key: 1\n# Found! Address: 33817, Key: 2\n# Found! Address: 33817, Key: 4\n# Found! Address: 33817, Key: 8\n```\n\nThe MCU understands 2262, 2260, 1527 encoded transmissions.\n\nIf you're not receiving anything, check your RX and TX are not switched otherwise the remote might be using an unsupported protocol.\n\n## Pinout\n\nPin | Name | Description\n:--:|:----:|:--------------------------------\n1   | GND  | Ground\n2   | RXD  | UART receive\n3   | TXD  | UART transmit\n4   | VCC  | Supply voltage 3V3 - 5V\n\n## Connections\n\n### TinyPICO ESP32\n\n```python\nfrom machine import Pin, UART\nuart = UART(1, tx=14, rx=15, baudrate=9600)\n```\n\nYS-RF34T | TinyPICO (ESP32)\n-------- | ----------------\nGND      | GND\nRXD      | 14 TXD\nTXD      | 15 RXD\nVCC      | 3V3\n\n## Transmit Protocol\n\nWrite 7 bytes and the MCU will build and send out the desired packet using the onboard ASK/OOK RF module.\n\nPacket = (Header, Time, Address 2, Address 1, Key, Width, Footer), eg.\n\nbyte | name   | description\n---- | ------ | -----------\n0    | header | constant value of 0xFD\n1    | time   | transmit time - signal repeats until timeout\n2    | addr2  | high address bits\n3    | addr1  | low address bits\n4    | key    | which button was pressed\n5    | width  | width of signal in ms\n6    | footer | constant value of 0xDF\n\n\nheader | time | addr2 | addr1 | key  | width | footer | eg\n------ | ---- | ----- | ----- | ---- | ----- | ------ | -------------------------------\n0xFD   | 0x03 | 0x84  | 0x19  | 0x04 | 0x40  | 0xDF   | b'\\xfd\\x03\\x84\\x19\\x04\\x40\\xdf'\n0xFD   | 0x06 | 0x22  | 0x33  | 0x44 | 0x50  | 0xDF   | b'\\xfd\\x06\\x22\\x33\\x44\\x50\\xdf'\n\n# Receive Protocol\n\nWhen the MCU receives a signal from the receiving ASK/OOK RF module, it will output 6 bytes over UART.\n\nThe packet is almost identical to the TX packet, only is missing the Time value.\n\nbyte | name   | description\n---- | ------ | ------------------------\n0    | header | constant value of 0xFD\n1    | addr2  | high address bits\n2    | addr1  | low address bits\n3    | key    | which button was pressed\n4    | width  | width of signal in ms\n5    | footer | constant value of 0xDF\n\nheader | addr2 | addr1 | key  | width | footer | eg\n------ | ----- | ----- | ---- | ----- | ------ | ---------------------------\n0xFD   | 0x84  | 0x19  | 0x04 | 0x44  | 0xDF   | b'\\xfd\\x84\\x19\\x04\\x44\\xdf'\n\n\n## RTL-SDR capture with URH and replay with YS-RF34T\n\nSee [RTL-SDR-URH.md](RTL-SDR-URH.md).\n\n## Parts\n\n* [YS-RF34T](https://www.aliexpress.com/item/32963111334.html) $5.85 AUD\n* [TinyPICO](https://www.tinypico.com/) $20.00 USD\n* [RTL-SDR](https://www.rtl-sdr.com/buy-rtl-sdr-dvb-t-dongles/) $21.95 AUD\n\n## Links\n\n* [micropython.org](http://micropython.org)\n* [TinyPICO Getting Started](https://www.tinypico.com/gettingstarted)\n* [URH](https://github.com/jopohl/urh)\n* [RTL-SDR](https://www.rtl-sdr.com)\n\n## License\n\nLicensed under the [MIT License](http://opensource.org/licenses/MIT).\n\nCopyright (c) 2019 Mike Causer\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Communications"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcauser%2Fmicropython-ys-rf34t","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcauser%2Fmicropython-ys-rf34t","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcauser%2Fmicropython-ys-rf34t/lists"}