{"id":555,"date":"2026-05-18T23:48:25","date_gmt":"2026-05-18T21:48:25","guid":{"rendered":"https:\/\/elrebo.de\/?p=555"},"modified":"2026-07-05T16:43:12","modified_gmt":"2026-07-05T14:43:12","slug":"av_rmt","status":"publish","type":"post","link":"https:\/\/www.elrebo.de\/index.php\/2026\/05\/18\/av_rmt\/","title":{"rendered":"av_rmt"},"content":{"rendered":"\n<p id=\"block-4181776e-3a42-4b2a-97cb-951748280a3b\">An ESP-IDF component for&nbsp;<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\">A Remote Controller for a YAMAHA Audio Receiver, a PANASONIC Television, a Pioneer DVD Player and an Apple TV.<\/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 using different remote control protocols.&nbsp;It runs on&nbsp;a ESP32 processor connected to an IR transmitter and is built using the ESP-IDF build system in version 5.5+.<\/p>\n\n\n\n<p>It uses component elrebo-de\/rmt_ir, where three protocols are implemented:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>NEC protocol (used by YAMAHA audio receiver)<\/li>\n\n\n\n<li>Panasonic protocol (used by PANASONIC VIERA TV)<\/li>\n\n\n\n<li>Pioneer protocol (used by Pioneer DVD player)<\/li>\n<\/ul>\n\n\n\n<p>The component is implemented as C++&nbsp;class&nbsp;<code>AvRmt<\/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>av_rmt<\/code>&nbsp;is published on the ESP Registry at&nbsp;<a href=\"https:\/\/components.espressif.com\/components\/elrebo-de\/av_rmt\">https:\/\/components.espressif.com\/components\/elrebo-de\/av_rmt<\/a>.<\/p>\n\n\n\n<p id=\"block-0825f935-58b7-47cc-8b7d-c5c0ff281599\">The source code can be found at&nbsp;<a href=\"https:\/\/github.com\/elrebo-de\/esp_av_rmt\">https:\/\/github.com\/elrebo-de\/esp_av_rmt<\/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&nbsp;<code>av_rmt<\/code>&nbsp;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\/av_rmt^1.1.0\"<\/code><\/p>\n\n\n\n<p id=\"block-bcb5b005-9385-4741-bc46-79820efc51da\">You need to include&nbsp;<code>av_rmt.hpp<\/code>.<\/p>\n\n\n\n<p>Then you have to initialize the <code>RmtIr<\/code> class,&nbsp;which does the actual IR communication with the Audio\/Video devices, and the <code>AvRmt<\/code>&nbsp;class, which uses RmtIr to control :<\/p>\n\n\n\n<p><code>ESP_LOGI(tag, \"Initialize RmtIr class\");<br>RmtIr* rmtIr = &amp;rmtIr-&gt;getInstance(); \/\/ get the Singleton instance<br>rmtIr-&gt;setGpioPins(32,0); \/\/ set the GPIO pins for M5 ATOM LITE<br>\/\/rmtIr-&gt;setGpioPins(4,0); \/\/ set the GPIO pins for ESP32C3 Supermini<br>rmtIr-&gt;initialize(); \/\/ initialize RMT IR<br><br>ESP_LOGI(tag, \"Initialize AvRmt class\");<br>AvRmt* avRmt = &amp;avRmt-&gt;getInstance(); \/\/ get the Singleton instance<br><br>avRmt-&gt;initialize(rmtIr);<\/code><\/p>\n\n\n\n<p>Now you can control the Audio\/Video system with these methods:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/\/ Methods to control Audio\/Video devices<br>void switchAllOff();<br>void switchOnTv();<br>void switchOnAppleTv();<br>void switchOnDvd();<br>void switchOnRadio();<\/code><br><code>void increaseVolume();<br>void decreaseVolume();<br>void goToNextChannel();<br>void goToPreviousChannel();<\/code><br><br>Let's have a look at <code>switchAllOff<\/code>. This method switches off the YAMAHA receiver, the Panasonic TV and the Pioneer DVD player. It looks like this:<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"488\" src=\"https:\/\/elrebo.de\/wp-content\/uploads\/2026\/05\/Bildschirmfoto-2026-05-20-um-15.32.42-1024x488.png\" alt=\"\" class=\"wp-image-560\" srcset=\"https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/Bildschirmfoto-2026-05-20-um-15.32.42-1024x488.png 1024w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/Bildschirmfoto-2026-05-20-um-15.32.42-300x143.png 300w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/Bildschirmfoto-2026-05-20-um-15.32.42-768x366.png 768w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/Bildschirmfoto-2026-05-20-um-15.32.42-1536x732.png 1536w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/05\/Bildschirmfoto-2026-05-20-um-15.32.42.png 1960w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Besides setting some state variables it retrieves the pointer to the RmtIr instance and uses this class to transmit command frames to the different devices:<\/p>\n\n\n\n<p>To the YAMAHA receiver  a NEC command frame is sent:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ YAMAHA Receiver<br>rmtIr-&gt;transmitNecCommandFrame((uint8_t)0x7a, (uint8_t)0x1e); \/\/ \"STANDBY\"<\/pre>\n\n\n\n<p>This is the STANDBY command for the YAMAHA receiver.<\/p>\n\n\n\n<p>To the Panasonic TV a Panasonic command frame is sent:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Panasonic TV<br>rmtIr-&gt;transmitPanasonicCommandFrame(0x4004, 0x01, 0x00, 0xfc); \/\/ \"Power Off\"<\/pre>\n\n\n\n<p>This is the &#8220;Power Off&#8221; command for a Panasonic TV.<\/p>\n\n\n\n<p>To the Pioneer DVD player a Pioneer command frame is sent:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Pioneer DVD Player<br>rmtIr-&gt;transmitPioneerCommandFrame((uint8_t)0xa3, (uint8_t)0x99, (uint8_t)0xaf, (uint8_t)0xbb); \/\/ \"Shift + OFF\"<\/pre>\n\n\n\n<p>This is a two-command frame consisting of the &#8220;Shift&#8221; and &#8220;Off&#8221; commands.<\/p>\n\n\n\n<p>The technical details of these command frames and how they are transmitted are hidden inside the <code>RmtIr<\/code> class.<\/p>\n\n\n\n<p>Between the transmitXyzCommandFrame calls the system waits for 500 msec.<\/p>\n\n\n\n<p>((tbc))<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An ESP-IDF component for&nbsp;Physical Computing Purpose A Remote Controller for a YAMAHA Audio Receiver, a PANASONIC Television, a Pioneer DVD Player and an Apple TV. How it is done This repository contains an ESP-IDF component for an IR transmitter using different remote control protocols.&nbsp;It runs on&nbsp;a ESP32 processor connected to an IR transmitter and is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":550,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,16],"tags":[],"class_list":["post-555","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32_socs","category-physical_computing"],"_links":{"self":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/555","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=555"}],"version-history":[{"count":7,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/555\/revisions"}],"predecessor-version":[{"id":597,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/555\/revisions\/597"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/media\/550"}],"wp:attachment":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/media?parent=555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/categories?post=555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/tags?post=555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}