{"id":16251392,"url":"https://github.com/maximkulkin/esp-ir","last_synced_at":"2025-10-16T21:12:03.337Z","repository":{"id":63515019,"uuid":"176440225","full_name":"maximkulkin/esp-ir","owner":"maximkulkin","description":"Library for ESP-OPEN-RTOS to send IR commands.","archived":false,"fork":false,"pushed_at":"2020-11-07T17:44:53.000Z","size":96,"stargazers_count":19,"open_issues_count":2,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T06:06:15.963Z","etag":null,"topics":["esp8266","ir","remote"],"latest_commit_sha":null,"homepage":null,"language":"C","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/maximkulkin.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":"2019-03-19T06:30:57.000Z","updated_at":"2024-11-07T01:18:10.000Z","dependencies_parsed_at":"2022-11-20T12:04:06.683Z","dependency_job_id":null,"html_url":"https://github.com/maximkulkin/esp-ir","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maximkulkin/esp-ir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkulkin%2Fesp-ir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkulkin%2Fesp-ir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkulkin%2Fesp-ir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkulkin%2Fesp-ir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximkulkin","download_url":"https://codeload.github.com/maximkulkin/esp-ir/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkulkin%2Fesp-ir/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269669162,"owners_count":24456610,"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-08-10T02:00:08.965Z","response_time":71,"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":["esp8266","ir","remote"],"created_at":"2024-10-10T15:10:00.301Z","updated_at":"2025-10-16T21:12:03.268Z","avatar_url":"https://github.com/maximkulkin.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"esp-ir\n======\n\nLibrary for [ESP-OPEN-RTOS](https://github.com/SuperHouse/esp-open-rtos) to send and receive IR commands.\n\nReceiving IR codes can be done on arbitrary pin (which supports GPIO mode and pin change interrupts),\n\n![Receiver wiring](resources/ir-decoder-wiring.png)\n\n(big black thing being IR decoder, e.g. TSOP38238. Consult datasheet on particular part pinout).\n\nTransmission though can only be done on GPIO14:\n\n![Transmitter wiring](resources/ir-led-wiring.png)\n\n(pretty much any NPN transistor will do, e.g. 2N2222; transistor base resistor could be 10K Om; LED resistor is calculated based on LED parameters, but you probably safe by assuming it can handle 10-20mA and go with ~220 Om).\n\n\nExample sending command:\n```c\n#include \u003cir/ir.h\u003e\n#include \u003cir/raw.h\u003e\n\nstatic int16_t[] command1 = {\n  3291, -1611,\n  443,  -370,   425,  -421,   421, -1185,   424,  -422,\n  421, -1185,   425,  -421,   421,  -370,   424,  -392,\n  448, -1188,   423, -1214,   444,  -372,   422,  -395,\n  447,  -397,   420, -1186,   449, -1185,   424,  -423,\n  419,  -375,   441,  -372,   423,  -422,   420,  -372,\n  444,  -370,   424,  -422,   420,  -372,   421,  -393,\n  424,  -421,   421,  -371,   422,  -392,   449,  -398,\n  420, -1185,   450,  -396,   421,  -370,   422,  -423,\n};\n\nir_tx_init();\nir_raw_send(command1, sizeof(command1) / sizeof(*command1));\n```\n\nExample receiving NEC-like command:\n```c\n#include \"ir/ir.h\"\n#include \"ir/generic.h\"\n\n#define IR_RX_GPIO 12\n\nstatic ir_generic_config_t my_protocol_config = {\n    .header_mark = 3200,\n    .header_space = -1600,\n\n    .bit1_mark = 400,\n    .bit1_space = -1200,\n\n    .bit0_mark = 400,\n    .bit0_space = -400,\n\n    .footer_mark = 400,\n    .footer_space = -8000,\n\n    .tolerance = 10,\n};\n\nir_rx_init(IR_RX_GPIO, 1024);\nir_decoder_t *generic_decoder = ir_generic_make_decoder(\u0026my_protocol_config);\n\nuint8_t buffer[32];\nwhile (1) {\n    uint16_t size = ir_recv(generic_decoder, 0, buffer, sizeof(buffer));\n    if (size \u003c= 0)\n        continue;\n\n    printf(\"Decoded packet (size = %d): \", size);\n    for (int i=0; i \u003c size; i++) {\n        printf(\"0x%02x \", buffer[i]);\n        if (i % 16 == 15)\n            // newline after every 16 bytes of packet data\n            printf(\"\\n\");\n    }\n\n    if (size % 16)\n        // print final newline unless packet size is multiple of 16 and newline\n        // was printed inside of loop\n        printf(\"\\n\");\n}\n```\n\nLicense\n=======\n\nMIT licensed. See the bundled [LICENSE](https://github.com/maximkulkin/esp-ir/blob/master/LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximkulkin%2Fesp-ir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximkulkin%2Fesp-ir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximkulkin%2Fesp-ir/lists"}