{"id":539,"date":"2026-05-05T10:07:09","date_gmt":"2026-05-05T08:07:09","guid":{"rendered":"https:\/\/elrebo.de\/?p=539"},"modified":"2026-07-05T16:38:41","modified_gmt":"2026-07-05T14:38:41","slug":"rmt_ir","status":"publish","type":"post","link":"https:\/\/www.elrebo.de\/index.php\/2026\/05\/05\/rmt_ir\/","title":{"rendered":"rmt_ir"},"content":{"rendered":"\n<p id=\"block-4181776e-3a42-4b2a-97cb-951748280a3b\">An ESP-IDF component for <a href=\"https:\/\/elrebo.de\/index.php\/2026\/02\/20\/physical-computing\/\">Physical Computing<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-7d97ee68-2d89-4d13-8288-00dd987acb59\">Purpose<\/h2>\n\n\n\n<p id=\"block-1d1d24a6-b742-4059-8109-d967d12206b5\">Receive and transmit remote control IR signals for ESP32 systems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-61b2c80a-1db6-4e1c-8eee-ab6a95815bbc\">How it is done<\/h2>\n\n\n\n<p id=\"block-90bceb18-9bf6-4f1d-a264-07eb69adb8e2\">This repository contains an ESP-IDF component for an IR transmitter and receiver using different remote control protocols.&nbsp;It runs on&nbsp;any ESP32 processor connected to an IR receiver and\/or IR transmitter and is built using the ESP-IDF build system in version 5.5+.<\/p>\n\n\n\n<p>Currently three protocols are implemented:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>NEC protocol (used eg. by YAMAHA audio receiver)<\/li>\n\n\n\n<li>PANASONIC protocol (used eg. by PANASONIC VIERA TV)<\/li>\n\n\n\n<li>Pioneer protocol (used eg. by Pioneer DVD player)<\/li>\n<\/ul>\n\n\n\n<p>The component is implemented as C++&nbsp;class&nbsp;<code>RmtIr<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Where to find it<\/h2>\n\n\n\n<p id=\"block-24ebe2bc-e6d0-463b-a7b7-8f27ff745e13\"><code>rmt_ir<\/code> is published on the ESP Registry at <a href=\"https:\/\/components.espressif.com\/components\/elrebo-de\/rmt_ir\">https:\/\/components.espressif.com\/components\/elrebo-de\/rmt_ir<\/a>.<\/p>\n\n\n\n<p id=\"block-0825f935-58b7-47cc-8b7d-c5c0ff281599\">The source code can be found at <a href=\"https:\/\/github.com\/elrebo-de\/esp_rmt_ir\">https:\/\/github.com\/elrebo-de\/esp_rmt_ir<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-9d7e1a9b-4122-415e-8961-7e22b2f7a96f\">How to use it<\/h2>\n\n\n\n<p id=\"block-553fec87-e142-488e-a536-2e2a3ad9db50\">As an ESP-IDF component <code>rmt_ir<\/code> must be included into idf_component.yml as a dependency. As usual this can be done by executing this command:<\/p>\n\n\n\n<p id=\"block-308aacb2-5f62-43b6-90cb-2acb726d4c8f\"><code>idf.py add-dependency \"elrebo-de\/rmt_ir^1.3.0\"<\/code><\/p>\n\n\n\n<p id=\"block-bcb5b005-9385-4741-bc46-79820efc51da\">You need to include&nbsp;<code>rmt_ir.hpp<\/code>.<\/p>\n\n\n\n<p>Then you have to initialize the&nbsp;<code>RmtIr<\/code>&nbsp;class:<\/p>\n\n\n\n<p><code>\/* Initialize RmtIr class *\/<br>RmtIr* rmtIr = &amp;rmtIr-&gt;getInstance(); \/\/ get the Singleton instance<br>rmtIr-&gt;setGpioPins(12,26); \/\/ set the GPIO pins<br>rmtIr-&gt;initialize(); \/\/ initialize RMT IR<br><\/code><\/p>\n\n\n\n<p>Now you can transmit NEC IR codes with\u00a0<code>transmitNecCommandFrame<\/code>\u00a0and\u00a0<code>transmitNecRepeatFrame<\/code>, PANASONIC IR codes with\u00a0<code>transmitPanasonicCommandFrame<\/code> and Pioneer IR codes with <code>transmitPioneerCommandFrame<\/code>.<\/p>\n\n\n\n<p>This example sends the IR code for pushing the&nbsp;&#8220;TV Scene&#8221;&nbsp;button on the remote control of a YAMAHA audio receiver:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rmtIr-&gt;transmitNecCommandFrame((uint8_t)0x7a, (uint8_t)0x03); \/\/ \"TV Scene\"<br><\/code><\/pre>\n\n\n\n<p>This example sends the IR code for pushing the&nbsp;&#8220;Power 0\/1&#8221;&nbsp;button on the remote control of a PANASONIC VIERA TV:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rmtIr-&gt;transmitPanasonicCommandFrame(0x4004, 0x01, 0x00, 0xbc);  \/\/ \"Power 0\/1\"<br><\/code><\/pre>\n\n\n\n<p>This example sends the IR code for switching on the Pioneer DVD player:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rmtIr->transmitPioneerCommandFrame((uint8_t)0xa3, (uint8_t)0x99, (uint8_t)0xaf, (uint8_t)0xba); \/\/ \"ON\" starts the DVD player<\/code><\/pre>\n\n\n\n<p>and this example selects the next track on the CD\/DVD:<\/p>\n\n\n\n<p><code>rmtIr->transmitPioneerCommandFrame((uint8_t)0xa3, (uint8_t)0x9c); \/\/ \"Next\" goes to next track (if a CD is inserted)<br><\/code><br>It is also possible to receive IR signals with an IR receiver.<\/p>\n\n\n\n<p>This example receives IR signals in an endless loop and prints the received data in the log:<\/p>\n\n\n\n<p><code>while(1) {<br>    rmtIr-&gt;receiveNecOrPanasonicFrame();<br>}<br><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>An ESP-IDF component for Physical Computing Purpose Receive and transmit remote control IR signals for ESP32 systems. How it is done This repository contains an ESP-IDF component for an IR transmitter and receiver using different remote control protocols.&nbsp;It runs on&nbsp;any ESP32 processor connected to an IR receiver and\/or IR transmitter and is built using the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":540,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,1,16],"tags":[67,70,68,69,66],"class_list":["post-539","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32_socs","category-oss","category-physical_computing","tag-ir","tag-ir-remote-controller","tag-nec-protocol","tag-panasonic-tv-protocol","tag-remote-control"],"_links":{"self":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/comments?post=539"}],"version-history":[{"count":4,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/539\/revisions"}],"predecessor-version":[{"id":595,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/539\/revisions\/595"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/media\/540"}],"wp:attachment":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/media?parent=539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/categories?post=539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/tags?post=539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}