{"id":16299523,"url":"https://github.com/fonger/esp8266-rtos-ir","last_synced_at":"2025-07-15T23:49:16.034Z","repository":{"id":77558436,"uuid":"207235653","full_name":"Fonger/ESP8266-RTOS-IR","owner":"Fonger","description":"Infrared remote control library for latest ESP8266 RTOS SDK 3.2, esp-idf style","archived":false,"fork":false,"pushed_at":"2019-09-11T08:54:22.000Z","size":35,"stargazers_count":15,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T10:51:26.460Z","etag":null,"topics":["esp-idf","esp8266","esp8266-rtos","espressif","infrared","ir-remote","rtos"],"latest_commit_sha":null,"homepage":"","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/Fonger.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":"2019-09-09T06:03:46.000Z","updated_at":"2024-08-02T07:41:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"3148ab5e-d1b5-4e3b-921f-f19de20ca4ed","html_url":"https://github.com/Fonger/ESP8266-RTOS-IR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Fonger/ESP8266-RTOS-IR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fonger%2FESP8266-RTOS-IR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fonger%2FESP8266-RTOS-IR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fonger%2FESP8266-RTOS-IR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fonger%2FESP8266-RTOS-IR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fonger","download_url":"https://codeload.github.com/Fonger/ESP8266-RTOS-IR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fonger%2FESP8266-RTOS-IR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265468052,"owners_count":23770828,"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":["esp-idf","esp8266","esp8266-rtos","espressif","infrared","ir-remote","rtos"],"created_at":"2024-10-10T20:48:22.283Z","updated_at":"2025-07-15T23:49:15.971Z","avatar_url":"https://github.com/Fonger.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP8266-RTOS-IR\n\nInfrared rx/tx library for [espressif/ESP8266_RTOS_SDK](https://github.com/espressif/ESP8266_RTOS_SDK) (v3.2+, esp-idf style) 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**transmission though can only be done on `GPIO14`**.\n\nThis library use i2s WS pin to send accurate 38KHz IR signals with 50% duty cycle without blocking CPU like other libraries do.\n\nRecently, espressif has released official IR feature (`driver/ir-rx.h` `driver/ir-tx.h`) in master branch but this library is more lightweight.\n\n## Compatibility\n\nESP8266_RTOS_SDK v3.2+\n\n## Installation\n\nBecause of [this issue #663](https://github.com/espressif/ESP8266_RTOS_SDK/issues/663) you should add the following line to `$IDF_PATH/components/freertos/port/esp8266/include/freertos/FreeRTOSConfig.h` manually.\n\n```c\n#define INCLUDE_xTimerPendFunctionCall  1\n```\n\nThen you can clone this project inside your components folder.\n\n## Usage\n\nExample sending command:\n\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\n```c\n#include \u003cir/ir.h\u003e\n#include \u003cir/generic.h\u003e\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\n## License\n\nMIT licensed. See the bundled [LICENSE](https://github.com/Fonger/ESP8266-RTOS-IR/blob/master/LICENSE) file for more details.\n\nThis library is based on [maximkulkin/esp-ir](https://github.com/maximkulkin/esp-ir) which works with [esp-open-rtos](https://github.com/SuperHouse/esp-open-rtos) instead of the official espressif SDK.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffonger%2Fesp8266-rtos-ir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffonger%2Fesp8266-rtos-ir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffonger%2Fesp8266-rtos-ir/lists"}