{"id":21295,"date":"2021-07-03T23:00:55","date_gmt":"2021-07-03T14:00:55","guid":{"rendered":"https:\/\/www.souichi.club\/?p=21295"},"modified":"2022-03-31T20:49:40","modified_gmt":"2022-03-31T11:49:40","slug":"amazon-freertos","status":"publish","type":"post","link":"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/","title":{"rendered":"Installed Amazon FreeRTOS on ESP32 DevKitC and tried the sample program."},"content":{"rendered":"<ul class=\"bogo-language-switcher list-view\"><li class=\"en-US en current first\"><span class=\"bogoflags bogoflags-us\"><\/span> <span class=\"bogo-language-name\"><a rel=\"alternate\" hreflang=\"en-US\" href=\"https:\/\/www.souichi.club\/en\/wp-json\/wp\/v2\/posts\/21295\/\" title=\"English\" class=\"current\" aria-current=\"page\">English<\/a><\/span><\/li>\n<li class=\"ja last\"><span class=\"bogoflags bogoflags-jp\"><\/span> <span class=\"bogo-language-name\"><a rel=\"alternate\" hreflang=\"ja\" href=\"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/21295\/\" title=\"Japanese\">\u65e5\u672c\u8a9e<\/a><\/span><\/li>\n<\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69defaffbdd99\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #454e5c;color:#454e5c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #454e5c;color:#454e5c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69defaffbdd99\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Amazon_FreeRTOS\" >Amazon FreeRTOS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Outline_drawing\" >Outline drawing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Environment\" >Environment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Equipment_needed\" >Equipment needed<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#procedure\" >procedure<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Download_FreeRTOS\" >Download FreeRTOS<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#folder_structure\" >folder structure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Registering_a_Device\" >Registering a Device<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Credential_files\" >Credential files<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Set_up_Wi-Fi_Credentials\" >Set up Wi-Fi Credentials<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Set_up_AWS_credentials\" >Set up AWS credentials<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#ESP-IDF_Tools\" >ESP-IDF Tools<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Setting_Environment_Variables\" >Setting Environment Variables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#CMake\" >CMake<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Download\" >Download<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Install\" >Install<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Modify_TOPIC\" >Modify TOPIC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#CMake-2\" >CMake<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Specifying_the_program_to_build\" >Specifying the program to build<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Errors_in_Python\" >Errors in Python<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Build\" >Build<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Write_Flush\" >Write (Flush)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Execution_result\" >Execution result<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#Monitoring\" >Monitoring<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#MQTT_test_client\" >MQTT test client<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/www.souichi.club\/en\/aws\/amazon-freertos\/#The_End\" >The End<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Amazon_FreeRTOS\"><\/span>Amazon FreeRTOS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The April 2021 issue of Interface magazine(Japanese Magazine) included an introduction to Amazon x microcontroller FreeRTOS, so I gave it a try.<\/p>\n\n\n\n<p>FreeRTOS (Real Time Operating System) was acquired by Amazon in 2017 and is being developed as &#8220;Amazon FreeRTOS&#8221;.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A lightweight and simple RTOS (Real Time Operating System)<\/li><li>Suitable for processes that perform tasks within a certain time frame that require real-time performance<\/li><li>Easy to connect to AWS IoT Core (supports IoT)<\/li><li>MIT license is easy to use for products.<\/li><li>It is not mandatory to release your own modified source code.<\/li><li>The original FreeRTOS had a MIT license, which made it a little difficult to use for commercial purposes.<\/li><li>Security features are provided (encrypted by connecting to AWS using a public key system).<\/li><\/ul>\n\n\n\n<p>I installed Amazon FreeRTOS and the sample program on ESP32 DevKitC (ESP-wroom-32) according to the instructions in the magazine, connected to AWS IoT Core, and tried to publish a message, so I&#8217;ll write this article as a reminder.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Outline_drawing\"><\/span>Outline drawing<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-04.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-04.png?resize=768%2C432&#038;ssl=1\" alt=\"Sending messages from ESP32 DevKitC to AWS IoT Core\" class=\"wp-image-21302\" width=\"768\" height=\"432\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-04.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-04.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-04.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-04.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-04.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Download the appropriate sample program (including FreeRTOS) from the AWS FreeRTOS Device Software page<\/li><li>Configure the AWS IoT Core<\/li><li>Compile in the ESP-IDF environment on your PC<\/li><li>Write to ESP32 DevkitC<\/li><li>Program to publish (send) messages to IoT Core at intervals of several seconds<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Environment\"><\/span>Environment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this case, the environment we tried was as follows.<\/p>\n\n\n<figure class=\"wp-block-table is-style-regular\">\n<table class=\"r_table01\">\n<tbody>\n<tr>\n<td class=\"r_td30\">\n<p>IoT Device<\/p>\n<\/td>\n<td>\n<p>ESP32-DevKitC\uff08ESP-WROOM-32\uff09<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>PC and OS for development environment<\/p>\n<\/td>\n<td>\n<p>DELL G7 15 7588<\/p>\n<p>Windows10 Home Version 2004<\/p>\n<p>OS Build:19041.985<\/p>\n<p>* By the way, compiling and writing to IoT devices worked fine on Ubuntu 20.04 LST and ESP-IDF v3.3 under Windows 10 WSL (Windows Subsystem for Linux).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ESP-IDF<\/p>\n<\/td>\n<td>\n<p>v3.3<\/p>\n<p>*v4.2 is deprecated at this time.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Equipment_needed\"><\/span>Equipment needed<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>I bought a module with ESP-WROOM-32 on it.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Tensilica LX6 Dual Core CPU Processor<\/li><li>520 KB SRAM<\/li><li>Wi-Fi 802.11 b\/g\/n, Bluetooth 4.2<\/li><li>SPI \/ SDIO \/ I2C \/ UART Interface<\/li><li>30 pins (15 pins x 2)<\/li><li>Micro USB Type-B (power supply, data transfer)<\/li><li>Button x 2 (EN+BOOT)<\/li><li>LED indicator x 2<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"procedure\"><\/span>procedure<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The procedure is as follows.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Download FreeRTOS from the AWS console and configure AWS IoT Core<\/li><li>Download credentials<\/li><li>Install ESP-IDF tools on your computer<\/li><li>Set environment variables<\/li><li>Setting up the CMake environment<\/li><li>Modify the source code, build, and compile<\/li><li>Write to ESP32-DevKitC (Flush)<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Download_FreeRTOS\"><\/span>Download FreeRTOS<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Login to the AWS (Amazon Web Services) console and navigate to the AWS IoT Core page from the list of services.<\/p>\n\n\n\n<p>Select &#8220;Software&#8221; from the menu at the bottom left.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-05.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-05.png?resize=768%2C375&#038;ssl=1\" alt=\"Select software in AWS IoT Core\" class=\"wp-image-21309\" width=\"768\" height=\"375\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-05.png?resize=1024%2C500&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-05.png?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-05.png?resize=768%2C375&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-05.png?resize=1536%2C750&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-05.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>&#8220;FreeRTOS Device Software&#8221;, click the &#8220;Configure Downloads&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-06.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-06.png?resize=768%2C377&#038;ssl=1\" alt=\"Configure Downloads\" class=\"wp-image-21310\" width=\"768\" height=\"377\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-06.png?resize=1024%2C503&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-06.png?resize=300%2C148&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-06.png?resize=768%2C378&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-06.png?resize=1536%2C755&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-06.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>Scroll down to &#8220;Connect to AWS IoT &#8211; ESP32-DevKitC ESP32-DevKitC&#8221; and click on &#8220;Quick Connect&#8221;.<\/p>\n\n\n\n<p>Note<br>There is a similarly named &#8220;Connect to AWS Greengrass &#8211; ESP32-DevKitC&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-07.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-07.png?resize=768%2C377&#038;ssl=1\" alt=\"Connect to AWS IoT - ESP32-DevKitC ESP32-DevKitC\" class=\"wp-image-21311\" width=\"768\" height=\"377\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-07.png?resize=1024%2C503&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-07.png?resize=300%2C148&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-07.png?resize=768%2C378&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-07.png?resize=1536%2C755&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-07.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>Scroll down to the bottom of the screen for instructions.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Download FreeRTOS for your device<\/li><li>Register your device<\/li><li>Download your credentials<\/li><li>Configure FreeRTOS on your device<\/li><li>Test your device<\/li><\/ol>\n\n\n\n<p>Review the steps and click the &#8220;Get Started&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-09.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-09.png?resize=768%2C544&#038;ssl=1\" alt=\"Review the procedure and Get started\" class=\"wp-image-21313\" width=\"768\" height=\"544\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-09.png?resize=1024%2C725&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-09.png?resize=300%2C212&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-09.png?resize=768%2C543&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-09.png?resize=1536%2C1087&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-09.png?w=1878&amp;ssl=1 1878w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>select a FreeRTOS version to use: 202012.00 Latest<\/li><li>Hardware platform: ESP32-DevKitC<\/li><\/ul>\n\n\n\n<p>and click &#8220;Show More Details&#8221;.<\/p>\n\n\n\n<p>As of May 2021, the latest version was 202012.00.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-10.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-10.png?resize=768%2C376&#038;ssl=1\" alt=\"show more details\" class=\"wp-image-21315\" width=\"768\" height=\"376\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-10.png?resize=1024%2C501&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-10.png?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-10.png?resize=768%2C376&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-10.png?resize=1536%2C752&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-10.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>In the Libraries, click &#8220;Add another library&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-11.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-11.png?resize=768%2C375&#038;ssl=1\" alt=\"Add another library\" class=\"wp-image-21321\" width=\"768\" height=\"375\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-11.png?resize=1024%2C500&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-11.png?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-11.png?resize=768%2C375&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-11.png?resize=1536%2C750&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-11.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>Click &#8220;OTA Updates&#8221; to add it to the library for download.<\/p>\n\n\n\n<p>OTA (Over-The-Air) is a function that updates software wirelessly and is used when you want to update the program of an IoT device remotely.<\/p>\n\n\n\n<p>In this article, we will not describe the OTA demo.<\/p>\n\n\n\n<p>We have confirmed that ESP32-DevKitC gets the latest file when the update binary file is stored in Amazon s3, and automatically updates to the latest software over the air.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-12.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-12.png?resize=768%2C412&#038;ssl=1\" alt=\"add OT Updates\" class=\"wp-image-21322\" width=\"768\" height=\"412\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-12.png?resize=1024%2C549&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-12.png?resize=300%2C161&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-12.png?resize=768%2C412&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-12.png?resize=1536%2C824&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-12.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>Make sure that OTA Updates has been added to the installation library and scroll down.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-13.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"502\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-13.png?resize=1024%2C502&#038;ssl=1\" alt=\"OTA Updates\" class=\"wp-image-21323\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-13.png?resize=1024%2C502&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-13.png?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-13.png?resize=768%2C377&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-13.png?resize=1536%2C754&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-13.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/figure>\n\n\n\n<p>Make sure that the &#8220;coreMQTT Demos&#8221; Enable demo is selected.<\/p>\n\n\n\n<p>After this, multiple demo projects will be downloaded to your computer, and here you can specify which demo project you want to compile and run.<\/p>\n\n\n\n<p>In this case, I have enabled the MQTT demo project, but you can change the project to be compiled by modifying the description in aws_demo_config.h even after downloading.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-14.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-14.png?resize=768%2C377&#038;ssl=1\" alt=\"&quot;coreMQTT Demos&quot; demo is selected\" class=\"wp-image-21324\" width=\"768\" height=\"377\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-14.png?resize=1024%2C502&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-14.png?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-14.png?resize=768%2C377&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-14.png?resize=1536%2C754&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-14.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Name required: ConnecttoAWSIoT-ESP32-DevKitC-test-en<\/li><li>Description (optional): Get started with the libraries required to securely connect to AWS IoT.test-en<\/li><\/ul>\n\n\n\n<p>and click the &#8220;Create and download&#8221; button.<\/p>\n\n\n\n<p>&#8220;Create&#8221; means that you need to create things, certificates, and create policies in AWS IoT Core, but it will create them automatically behind the scenes.<\/p>\n\n\n\n<p>If you have already created things, certificates, and policies manually, you can just &#8220;download&#8221; them.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-15.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-15.png?resize=768%2C376&#038;ssl=1\" alt=\"Create and download\" class=\"wp-image-21325\" width=\"768\" height=\"376\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-15.png?resize=1024%2C501&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-15.png?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-15.png?resize=768%2C376&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-15.png?resize=1536%2C752&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-15.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>Save the freertos-xxxxx.zip file (about 60MB) in an your PC folder and extract it.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"folder_structure\"><\/span>folder structure<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>I unzipped it under D:\\GoogleDriveD\\M2B\\<\/p>\n\n\n<pre><code class=\"lang-shell\">\u251c\u2500d:\n\u2502  \u2502      \n\u2502  \u251c\u2500GoogleDriveD\n\u2502  \u2502  \u2502\n\u2502  \u2502  \u251c\u2500\u2500M2B\n\u2502  \u2502  \u2502  \u2502\n\u2502  \u2502  \u2502  \u251c\u2500\u2500build\u3000\u30fb\u30fb\u30fb\u3000Create an empty one (for storing build files)\n\u2502  \u2502  \u2502  \u2502\n\u2502  \u2502  \u2502  \u251c\u2500\u2500FreeRTOS \u30fb\u30fb\u30fb Unzip it here.\n\u2502  \u2502  \u2502  \u2502  \u2502\n\u2502  \u2502  \u2502  \u2502  \u251c\u2500\u2500demos\u3000\u30fb\u30fb\u30fbDemo Applications\n\u2502  \u2502  \u2502  \u2502  \u2502\n\u2502  \u2502  \u2502  \u2502  \u251c\u2500\u2500device\n\u2502  \u2502  \u2502  \u2502  \u2502\n\u2502  \u2502  \u2502  \u2502  \u251c\u2500\u2500freertos_kernel\u3000\u30fb\u30fb\u30fb Kernel of FreeRTOS\n\u2502  \u2502  \u2502  \u2502  \u2502\n\u2502  \u2502  \u2502  \u2502  \u251c\u2500\u2500libraries\u3000\u30fb\u30fb\u30fb\u3000Libraries\n\u2502  \u2502  \u2502  \u2502  \u2502\n\u2502  \u2502  \u2502  \u2502  \u251c\u2500\u2500tests\n\u2502  \u2502  \u2502  \u2502  \u2502\n\u2502  \u2502  \u2502  \u2502  \u251c\u2500\u2500tools\u3000\u30fb\u30fb\u30fb\u3000Tools (Conversion tools for authentication files,etc)\n\u2502  \u2502  \u2502  \u2502  \u2502\n\u2502  \u2502  \u2502  \u2502  \u251c\u2500\u2500vendors\u3000\u30fb\u30fb\u30fb ESP-IDF\n\u2502  \u2502  \u2502  \u2502  \u2502<\/code><\/pre>\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Registering_a_Device\"><\/span>Registering a Device<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Moves to the screen for entering the device name.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Name: ESP-WROOM-32-Test-en<\/li><\/ul>\n\n\n\n<p>and click the &#8220;Next&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-16.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-16.png?resize=768%2C377&#038;ssl=1\" alt=\"Register your device\" class=\"wp-image-21332\" width=\"768\" height=\"377\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-16.png?resize=1024%2C503&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-16.png?resize=300%2C148&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-16.png?resize=768%2C378&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-16.png?resize=1536%2C755&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-16.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>Click the &#8220;Download and continue&#8221; button to create and download the credentials.<\/p>\n\n\n\n<p>Also, AWS IoT Core things and policies will be created automatically.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-17.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-17.png?resize=768%2C377&#038;ssl=1\" alt=\"Download your credentials\" class=\"wp-image-21333\" width=\"768\" height=\"377\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-17.png?resize=1024%2C502&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-17.png?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-17.png?resize=768%2C377&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-17.png?resize=1536%2C754&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-17.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Credential_files\"><\/span>Credential files<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Credentials.zip will be created, save it and extract it.<\/p>\n\n\n\n<p>\u30fbaws_clientcredential.h<br>\u30fbaws_clientcredential_keys.h<br>\u30fbESP-WROOM-32-Test-en.cert.pem<br>\u30fbESP-WROOM-32-Test-en.private.key<br>\u30fbESP-WROOM-32-Test-en.public.key<\/p>\n\n\n\n<p>The above five files will be extracted.<\/p>\n\n\n\n<p>In the AWS console, you will see &#8220;Configure FreeRTOS on your device&#8221;, so follow the instructions and modify the files you just extracted to suit your environment.<\/p>\n\n\n\n<p>I will mainly configure the Wi-Fi Credentials and AWS Credentials.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-18.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-18.png?resize=768%2C377&#038;ssl=1\" alt=\"Configure FreeRTOS on your device\" class=\"wp-image-21334\" width=\"768\" height=\"377\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-18.png?resize=1024%2C502&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-18.png?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-18.png?resize=768%2C377&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-18.png?resize=1536%2C754&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-18.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>The next step in the AWS console is to test (receive MQTT messages), and before that, set up the ESP-IDF environment on the PC side.<\/p>\n\n\n\n<p>The AWS console in the browser can be left as it is, or you can exit it once here (the test screen can be called up later).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Set_up_Wi-Fi_Credentials\"><\/span>Set up Wi-Fi Credentials<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Set the Wi-Fi credentials in the aws_clientcredential.h file that you downloaded and extracted earlier.<\/p>\n\n\n\n<p>The following three points need to be changed.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>clientcredentialWIFI_SSID: Specify the SSID.<\/li><li>clientcredentialWIFI_PASSWORD: Specify the password.<\/li><li>clientcredentialWIFI_SECURITY: Specify the encryption (security) method.*<\/li><\/ul>\n\n\n\n<p>* The following three types of encryption can be specified.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>eWiFiSecurityOpen<\/li><li>eWiFiSecurityWEP<\/li><li>eWiFiSecurityWPA<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-20.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-20.png?resize=768%2C362&#038;ssl=1\" alt=\"Wi-Fi Credentials\" class=\"wp-image-21137\" width=\"768\" height=\"362\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-20.png?resize=1024%2C483&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-20.png?resize=300%2C141&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-20.png?resize=768%2C362&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-20.png?resize=520%2C245&amp;ssl=1 520w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-20.png?resize=720%2C340&amp;ssl=1 720w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-20.png?w=1427&amp;ssl=1 1427w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Set_up_AWS_credentials\"><\/span>Set up AWS credentials<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>aws_clientcredential.h<\/li><li>aws_clientcredential_keys.h<\/li><\/ul>\n\n\n\n<p>to d:\\GoogleDriveD\\M2B\\FreeRTOS\\demos\\include\\~.<\/p>\n\n\n\n<p>There is already a file with the same name, so I renamed it and backed it up just in case.<\/p>\n\n\n\n<p>The contents of the aws_clientcredential_keys.h file are as follows.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-19.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-19.png?resize=512%2C367&#038;ssl=1\" alt=\"aws_clientcredential_keys.h\" class=\"wp-image-21343\" width=\"512\" height=\"367\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-19.png?resize=1024%2C733&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-19.png?resize=300%2C215&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-19.png?resize=768%2C550&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-19.png?w=1059&amp;ssl=1 1059w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/figure>\n\n\n\n<p>The information for the private key (ESP-WROOM-32-Test.private.key) to connect to the AWS IoT Core is set.<\/p>\n\n\n\n<p>The line ends with \\n&#8221;\\, which is a convention for writing key information in C language code.<\/p>\n\n\n\n<p>A tool to convert the original key format into the above format is included below.<\/p>\n\n\n<pre><code class=\"lang-shell\">D:\\GoogleDriveD\\M2B\\FreeRTOS\\tools\\certificate_configuration\\CertificateConfigurator.html<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"ESP-IDF_Tools\"><\/span>ESP-IDF Tools<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Download the ESP-IDF tools (Ver 3.3) <a href=\"https:\/\/docs.espressif.com\/projects\/esp-idf\/en\/v3.3\/get-started-cmake\/windows-setup.html\" target=\"_blank\" rel=\"noreferrer noopener\">from this page<\/a>.<\/p>\n\n\n\n<p>As of May 2021, the latest version of FreeRTOS for ESP32-DevKitC (202012.00) recommended Ver 3.3 instead of Ver 4.2.<\/p>\n\n\n\n<p>I think it will eventually support ESP-IDF Ver 4.2.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-22.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-22.png?resize=768%2C359&#038;ssl=1\" alt=\"Standard setup of Toolchain for Windows\" class=\"wp-image-21145\" width=\"768\" height=\"359\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-22.png?resize=1024%2C479&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-22.png?resize=300%2C140&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-22.png?resize=768%2C359&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-22.png?resize=1536%2C718&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-22.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>Scroll down to download https:\/\/dl.espressif.com\/dl\/esp-idf-tools-setup-1.2.exe (ESP-IDF Ver 3.3 version).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-23.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-23.png?resize=768%2C360&#038;ssl=1\" alt=\"Download https:\/\/dl.espressif.com\/dl\/esp-idf-tools-setup-1.2.exe\" class=\"wp-image-21146\" width=\"768\" height=\"360\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-23.png?resize=1024%2C480&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-23.png?resize=300%2C141&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-23.png?resize=768%2C360&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-23.png?resize=1536%2C720&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-23.png?resize=520%2C245&amp;ssl=1 520w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-23.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>Run the downloaded esp-idf-tools-setup-1.2.exe and you will be prompted to accept the license, select &#8220;I accept the agreement&#8221; and click the &#8220;Next&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-24.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-24.png?resize=440%2C359&#038;ssl=1\" alt=\"accept the license\" class=\"wp-image-21147\" width=\"440\" height=\"359\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-24.png?w=586&amp;ssl=1 586w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-24.png?resize=300%2C245&amp;ssl=1 300w\" sizes=\"auto, (max-width: 440px) 100vw, 440px\" \/><\/a><\/figure>\n\n\n\n<p>Select the installation location (default is C:\\Program Files\\Espressif\\ESP-IDF Tools) and click the &#8220;Next&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-25.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-25.png?resize=434%2C354&#038;ssl=1\" alt=\"Select the installation location and click Next.\" class=\"wp-image-21148\" width=\"434\" height=\"354\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-25.png?w=579&amp;ssl=1 579w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-25.png?resize=300%2C245&amp;ssl=1 300w\" sizes=\"auto, (max-width: 434px) 100vw, 434px\" \/><\/a><\/figure>\n\n\n\n<p>Select &#8220;Custom Installation&#8221; and click the &#8220;Next&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-26.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-26.png?resize=434%2C355&#038;ssl=1\" alt=\"select Custom Installation\" class=\"wp-image-21149\" width=\"434\" height=\"355\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-26.png?w=579&amp;ssl=1 579w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-26.png?resize=300%2C245&amp;ssl=1 300w\" sizes=\"auto, (max-width: 434px) 100vw, 434px\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Add Tools to Path\uff1aFor all users<\/li><li>Download and Run CMake 3.11.1 Installer\uff1aUncheck the box.<\/li><li>Download and Run Python 2.7.14 installer and install Python dependencies\uff1aUncheck the box.<\/li><\/ul>\n\n\n\n<p>I clicked the &#8220;Next&#8221; button.<\/p>\n\n\n\n<p>CMAKE is unchecked because we will install the latest version separately.<\/p>\n\n\n\n<p>I also unchecked Python because I already have Ver 3.7 installed, but you can check the box according to your environment.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-27.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-27.png?resize=435%2C354&#038;ssl=1\" alt=\"CMake installer and other options\" class=\"wp-image-21150\" width=\"435\" height=\"354\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-27.png?w=580&amp;ssl=1 580w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-27.png?resize=300%2C244&amp;ssl=1 300w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><\/a><\/figure>\n\n\n\n<p>Click the &#8220;Install&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-28.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-28.png?resize=436%2C353&#038;ssl=1\" alt=\"install\" class=\"wp-image-21151\" width=\"436\" height=\"353\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-28.png?w=581&amp;ssl=1 581w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-28.png?resize=300%2C243&amp;ssl=1 300w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/a><\/figure>\n\n\n\n<p>Installed successfully.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-29.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-29.png?resize=434%2C354&#038;ssl=1\" alt=\"Installed successfully.\" class=\"wp-image-21152\" width=\"434\" height=\"354\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-29.png?w=578&amp;ssl=1 578w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-29.png?resize=300%2C245&amp;ssl=1 300w\" sizes=\"auto, (max-width: 434px) 100vw, 434px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Setting_Environment_Variables\"><\/span>Setting Environment Variables<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Set IDF_PATH as a Windows environment variable.<\/p>\n\n\n\n<p>From the Start menu, search for &#8220;Environment Variables&#8221; and select &#8220;Edit the system environment variables&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-20.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-20.png?resize=490%2C400&#038;ssl=1\" alt=\"Edit the system environment variables\" class=\"wp-image-21350\" width=\"490\" height=\"400\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-20.png?w=980&amp;ssl=1 980w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-20.png?resize=300%2C245&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-20.png?resize=768%2C627&amp;ssl=1 768w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/a><\/figure>\n\n\n\n<p>&#8220;Advanced&#8221; tab, click the &#8220;Environment Variables&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-21.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-21.png?resize=359%2C357&#038;ssl=1\" alt=\"Environment Cariables\" class=\"wp-image-21351\" width=\"359\" height=\"357\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-21.png?w=479&amp;ssl=1 479w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-21.png?resize=300%2C298&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-21.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-21.png?resize=80%2C80&amp;ssl=1 80w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><\/a><\/figure>\n\n\n\n<p>Click the &#8220;New&#8221; button in the &#8220;System variables&#8221; field.<\/p>\n\n\n\n<p>If you only want to use ESP-IDF with this user, you can select User variables.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-22.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-22.png?resize=353%2C389&#038;ssl=1\" alt=\"New System variables\" class=\"wp-image-21352\" width=\"353\" height=\"389\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-22.png?w=706&amp;ssl=1 706w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-22.png?resize=273%2C300&amp;ssl=1 273w\" sizes=\"auto, (max-width: 353px) 100vw, 353px\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Variable name: IDF_PATH<\/li><li>Variable value: Set the following value<\/li><\/ul>\n\n\n<pre><code class=\"lang-shell\">D:\\GoogleDriveD\\M2B\\FreeRTOS\\vendors\\espressif\\esp-idf<\/code><\/pre>\n\n\n<p>Enter the above text and click the &#8220;OK&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-23.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-23.png?resize=560%2C163&#038;ssl=1\" alt=\"New System Valiables\" class=\"wp-image-21353\" width=\"560\" height=\"163\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-23.png?w=746&amp;ssl=1 746w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-23.png?resize=300%2C87&amp;ssl=1 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/figure>\n\n\n\n<p>IDF_PATH has been added.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-24.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-24.png?resize=530%2C583&#038;ssl=1\" alt=\"IDF_PATH has been added.\" class=\"wp-image-21354\" width=\"530\" height=\"583\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-24.png?w=706&amp;ssl=1 706w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-24.png?resize=273%2C300&amp;ssl=1 273w\" sizes=\"auto, (max-width: 530px) 100vw, 530px\" \/><\/a><\/figure>\n\n\n\n<p>Then, select the system variables Path and click the &#8220;Edit&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-25.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-25.png?resize=530%2C583&#038;ssl=1\" alt=\"system environment variable Path\" class=\"wp-image-21355\" width=\"530\" height=\"583\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-25.png?w=706&amp;ssl=1 706w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-25.png?resize=273%2C300&amp;ssl=1 273w\" sizes=\"auto, (max-width: 530px) 100vw, 530px\" \/><\/a><\/figure>\n\n\n\n<p>A list of already configured Path will be displayed, click the &#8220;New&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-26.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-26.png?resize=452%2C498&#038;ssl=1\" alt=\"PATH\" class=\"wp-image-21356\" width=\"452\" height=\"498\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-26.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-26.png?resize=272%2C300&amp;ssl=1 272w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/a><\/figure>\n\n\n\n<p>The bottom line will be added, so add the following Path, and click the &#8220;OK&#8221; button.<\/p>\n\n\n<pre><code class=\"lang-shell\">D:\\GoogleDriveD\\M2B\\FreeRTOS\\vendors\\espressif\\esp-idf\\tools<\/code><\/pre>\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-27.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-27.png?resize=452%2C498&#038;ssl=1\" alt=\"add the following Path,\" class=\"wp-image-21357\" width=\"452\" height=\"498\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-27.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-27.png?resize=272%2C300&amp;ssl=1 272w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/a><\/figure>\n\n\n\n<p>Click the &#8220;OK&#8221; button on the previous screen to finish setting the environment variables.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-28.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-28.png?resize=530%2C583&#038;ssl=1\" alt=\"finish setting the environment variables\" class=\"wp-image-21359\" width=\"530\" height=\"583\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-28.png?w=706&amp;ssl=1 706w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-28.png?resize=273%2C300&amp;ssl=1 273w\" sizes=\"auto, (max-width: 530px) 100vw, 530px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CMake\"><\/span>CMake<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Download\"><\/span>Download<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Next, download the CMake installer <a href=\"https:\/\/cmake.org\/download\/\" target=\"_blank\" rel=\"noreferrer noopener\">from this page<\/a> to set up the CMake compilation environment.<\/p>\n\n\n\n<p>Scroll down to the bottom.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-39.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-39.png?resize=768%2C359&#038;ssl=1\" alt=\"Download the CMake installer\" class=\"wp-image-21168\" width=\"768\" height=\"359\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-39.png?resize=1024%2C479&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-39.png?resize=300%2C140&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-39.png?resize=768%2C359&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-39.png?resize=1536%2C718&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-39.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>Download &#8220;cmake-3.21.0-rc1-windows-x86_64.msi&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-40.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-40.png?resize=768%2C359&#038;ssl=1\" alt=\"Download cmake-3.21.0-rc1-windows-x86_64.msi\" class=\"wp-image-21169\" width=\"768\" height=\"359\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-40.png?resize=1024%2C479&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-40.png?resize=300%2C140&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-40.png?resize=768%2C359&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-40.png?resize=1536%2C718&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-40.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install\"><\/span>Install<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Run &#8220;cmake-3.20.2-windows-x86_64.msi&#8221; to launch the installer and click the &#8220;Next&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-41.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-41.png?resize=462%2C362&#038;ssl=1\" alt=\"Next\" class=\"wp-image-21170\" width=\"462\" height=\"362\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-41.png?w=616&amp;ssl=1 616w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-41.png?resize=300%2C235&amp;ssl=1 300w\" sizes=\"auto, (max-width: 462px) 100vw, 462px\" \/><\/a><\/figure>\n\n\n\n<p>When the End-User License Agreement is displayed, check &#8220;I accept the terms in the License Agreement&#8221; and click the &#8220;Next&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-42.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-42.png?resize=462%2C360&#038;ssl=1\" alt=\"License Agreement\" class=\"wp-image-21171\" width=\"462\" height=\"360\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-42.png?w=616&amp;ssl=1 616w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-42.png?resize=300%2C234&amp;ssl=1 300w\" sizes=\"auto, (max-width: 462px) 100vw, 462px\" \/><\/a><\/figure>\n\n\n\n<p>Select &#8220;Add CMake to the system PATH for all users&#8221; and click the &#8220;Next&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-43.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-43.png?resize=461%2C361&#038;ssl=1\" alt=\"Add to Path for all users\" class=\"wp-image-21172\" width=\"461\" height=\"361\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-43.png?w=614&amp;ssl=1 614w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-43.png?resize=300%2C235&amp;ssl=1 300w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/a><\/figure>\n\n\n\n<p>Specify the Destination Folder and click the &#8220;Next&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-44.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-44.png?resize=461%2C361&#038;ssl=1\" alt=\"Destination Folder\" class=\"wp-image-21173\" width=\"461\" height=\"361\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-44.png?w=615&amp;ssl=1 615w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-44.png?resize=300%2C235&amp;ssl=1 300w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/a><\/figure>\n\n\n\n<p>Click the &#8220;Install&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-45.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-45.png?resize=464%2C361&#038;ssl=1\" alt=\"Install\" class=\"wp-image-21174\" width=\"464\" height=\"361\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-45.png?w=618&amp;ssl=1 618w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-45.png?resize=300%2C233&amp;ssl=1 300w\" sizes=\"auto, (max-width: 464px) 100vw, 464px\" \/><\/a><\/figure>\n\n\n\n<p>Click the &#8220;Finish&#8221; button when the installation has been successfully completed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-46.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-46.png?resize=461%2C362&#038;ssl=1\" alt=\"Finish\" class=\"wp-image-21175\" width=\"461\" height=\"362\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-46.png?w=615&amp;ssl=1 615w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-46.png?resize=300%2C236&amp;ssl=1 300w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Modify_TOPIC\"><\/span>Modify TOPIC<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Open the following file and make some changes to the program source.<\/p>\n\n\n<pre><code class=\"lang-shell\">D:\\GoogleDriveD\\M2B\\FreeRTOS\\demos\\coreMQTT\\mqtt_demo_mutual_auth.c<\/code><\/pre>\n\n\n<ul class=\"wp-block-list\"><li>#define mqttexampleTOPIC\uff1a &#8220;\/iotdemo\/topic\/1&#8221;<\/li><li>#define mqttexampleMESSAGE\uff1a&#8221;Hello World! from ESP-WROOM-32&#8243;<\/li><\/ul>\n\n\n\n<p>Topic is a key for sorting messages in MQTT, and you can set the hierarchical structure with &#8220;\/&#8221; (slash).<\/p>\n\n\n\n<p>You can set any hierarchical structure, if you are interested in the recommended structure, please refer to the &#8220;<a href=\"https:\/\/docs.aws.amazon.com\/whitepapers\/latest\/designing-mqtt-topics-aws-iot-core\/mqtt-design-best-practices.html\" target=\"_blank\" rel=\"noreferrer noopener\">MQTT design best practices<\/a>&#8220;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-47.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-47.png?resize=768%2C356&#038;ssl=1\" alt=\"Modify TPOIC and messages\" class=\"wp-image-21179\" width=\"768\" height=\"356\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-47.png?resize=1024%2C475&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-47.png?resize=300%2C139&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-47.png?resize=768%2C356&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-47.png?w=1379&amp;ssl=1 1379w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CMake-2\"><\/span>CMake<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Start Power shell, go to the directory where you installed FreeRTOS, and create a build file with the following command.<\/p>\n\n\n<pre><code class=\"lang-shell\">d:\ncd .\\GoogleDriveD\\M2B\\FreeRTOS\\\ncmake -DVENDOR=espressif -DBOARD=esp32_devkitc -DCOMPILER=xtensa-esp32 -G Ninja -S . -B ..\\build\\<\/code><\/pre>\n\n\n<p>Parameters<\/p>\n\n\n<figure class=\"wp-block-table is-style-regular\">\n<table class=\"r_table01\">\n<tbody>\n<tr>\n<td class=\"r_td30\">\n<p>-DVENDOR<\/p>\n<\/td>\n<td>\n<p>Specify the company name.<\/p>\n<p>espressif company.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-DBOARD<\/p>\n<\/td>\n<td>\n<p>Specify the board name.<\/p>\n<p>I specified esp32_devkitc.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-DCOMPILER<\/p>\n<\/td>\n<td>\n<p>Specify the compiler.<\/p>\n<p>xtensa-esp32 is specified.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-G<\/p>\n<\/td>\n<td>\n<p>The Ninja build system was specified for the CMake generator.<\/p>\n<p>Windows only<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-S<\/p>\n<\/td>\n<td>\n<p>Specify the location of the source code.<\/p>\n<p>Since we have already moved it to D:\\GoogleDriveD\\M2B\\FreeRTOS, we specified &#8220;.&#8221; in the current directory. in the current directory.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-B<\/p>\n<\/td>\n<td>\n<p>Specify the location of the generated build file.<\/p>\n<p>&nbsp;..\\build\\ is specified.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-48.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-48.png?resize=512%2C361&#038;ssl=1\" alt=\"Creating a Build file\" class=\"wp-image-21181\" width=\"512\" height=\"361\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-48.png?resize=1024%2C721&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-48.png?resize=300%2C211&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-48.png?resize=768%2C541&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-48.png?w=1103&amp;ssl=1 1103w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/figure>\n\n\n\n<p>If the cmake command is executed successfully, the following message will be displayed and the Build file will be created under the build folder.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-76.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-76.png?resize=768%2C541&#038;ssl=1\" alt=\"Creating a Build file\" class=\"wp-image-21276\" width=\"768\" height=\"541\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-76.png?resize=1024%2C721&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-76.png?resize=300%2C211&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-76.png?resize=768%2C541&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-76.png?w=1106&amp;ssl=1 1106w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Specifying_the_program_to_build\"><\/span>Specifying the program to build<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The sample program to be built is specified in the following file.<\/p>\n\n\n<pre><code class=\"lang-shell\">D:\\GoogleDriveD\\M2B\\FreeRTOS\\vendors\\espressif\\boards\\esp32\\aws_demos\\config_files\\aws_demo_config.h<\/code><\/pre>\n\n\n<p>CONFIG_CORE_MQTT_MUTUAL_AUTH_DEMO_ENABLED is specified because we enabled &#8220;coreMQTT Demos&#8221; in the AWS console demo activation described above.<\/p>\n\n\n\n<p>If you want to build other sample programs, there is a list of projects that can be set in lines 32-47, so select one and define it with #define.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-61.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-61.png?resize=768%2C541&#038;ssl=1\" alt=\"Specifying a sample program to compile\" class=\"wp-image-21185\" width=\"768\" height=\"541\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-61.png?resize=1024%2C721&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-61.png?resize=300%2C211&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-61.png?resize=768%2C541&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-61.png?w=1341&amp;ssl=1 1341w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Errors_in_Python\"><\/span>Errors in Python<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>I had an error at Cmake with the following error message.<\/p>\n\n\n\n<p>&#8220;Some Python dependencies must be installed.&#8221;<\/p>\n\n\n\n<p>In that case, use the following command to install additional modules that you need.<\/p>\n\n\n<pre><code class=\"lang-shell\">python -m pip install --user -r .\\vendors\\espressif\\esp-idf\\requirements.txt<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Build\"><\/span>Build<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Compile the build file with the following command.<\/p>\n\n\n<pre><code class=\"lang-shell\">cmake --build ..\\build\\<\/code><\/pre>\n\n\n<p>Alternatively, you can go to the build directory and use the following command.<\/p>\n\n\n<pre><code class=\"lang-shell\">cd ..\\build\\\nninja<\/code><\/pre>\n\n\n<p>It will be compiled successfully and aws_demos.bin (executable file) will be created.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-77.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-77.png?resize=768%2C541&#038;ssl=1\" alt=\"Compiled successfully.\" class=\"wp-image-21278\" width=\"768\" height=\"541\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-77.png?resize=1024%2C721&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-77.png?resize=300%2C211&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-77.png?resize=768%2C541&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-77.png?w=1103&amp;ssl=1 1103w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Write_Flush\"><\/span>Write (Flush)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Connect your computer to the ESP32 DevKitC with the USB cable (Type-B).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-64.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-64.jpg?resize=512%2C307&#038;ssl=1\" alt=\"Connecting your computer to the ESP32\" class=\"wp-image-21211\" width=\"512\" height=\"307\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-64.jpg?resize=1024%2C614&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-64.jpg?resize=300%2C180&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-64.jpg?resize=768%2C461&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-64.jpg?resize=1536%2C922&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-64.jpg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/figure>\n\n\n\n<p>Then use idf.py to write (flash) to the board.<\/p>\n\n\n<pre><code class=\"lang-shell\">.\\vendors\\espressif\\esp-idf\\tools\\idf.py flash -b 115200 -B ..\\build\\<\/code><\/pre>\n\n\n<p>Parameter<\/p>\n\n\n<figure class=\"wp-block-table is-style-regular\">\n<table class=\"r_table01\">\n<tbody>\n<tr>\n<td class=\"r_td30\">\n<p>idf.py<\/p>\n<\/td>\n<td>\n<p>writing program<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>flash<\/p>\n<\/td>\n<td>\n<p>Writing<\/p>\n<p>Specify deletion with erase_flash<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-b<\/p>\n<\/td>\n<td>\n<p>Specify the write speed.<\/p>\n<p>If an error occurs when 115200 is specified, reduce the speed.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-B<\/p>\n<\/td>\n<td>\n<p>Specify the location of the build file.<\/p>\n<p>..\\build\\ is specified.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-p<\/p>\n<\/td>\n<td>\n<p>Specify the port.<\/p>\n<p>At the time of flush (write), even if it is not specified, it was written to the target COM port automatically, but when it is specified explicitly, it can be specified like COM7.<\/p>\n<p>The target COM port can be confirmed by looking at the ports (COM and LPT) in the device manager.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n\n\n<p>A new Window will open and writing will start on the board.<\/p>\n\n\n\n<p>When the Writing at reaches 100%, the Window will automatically close and writing will end.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-78.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-78.png?resize=768%2C401&#038;ssl=1\" alt=\"Writing to the board\" class=\"wp-image-21282\" width=\"768\" height=\"401\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-78.png?resize=1024%2C535&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-78.png?resize=300%2C157&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-78.png?resize=768%2C401&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-78.png?w=1223&amp;ssl=1 1223w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>To delete the file, use the following command.<\/p>\n\n\n<pre><code class=\"lang-shell\">.\\vendors\\espressif\\esp-idf\\tools\\idf.py erase_flash -b 115200 -B ..\\build\\<\/code><\/pre>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Execution_result\"><\/span>Execution result<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>As soon as the writing is finished, the sample program runs and messages are sent to AWS IoT Core via MQTT protocol.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Monitoring\"><\/span>Monitoring<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The following command from PowerShell was supposed to be able to monitor the program, but unfortunately, in my environment, the window opened for a moment, but closed immediately and I could not monitor it.<\/p>\n\n\n<pre><code class=\"lang-shell\">.\\vendors\\espressif\\esp-idf\\tools\\idf.py flash monitor -p COM7 - b 115200 -B ..\\build\\<\/code><\/pre>\n\n\n<p>I gave up trying to monitor by command from PowerShell, and tried to monitor by serial connection with PuTTY.<\/p>\n\n\n\n<p>Make the following settings via serial.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Serial line to connect to: COM7 (depends on the environment)<\/li><li>speed(baud): 115200<\/li><li>Data bits: 8<\/li><li>Stop bits: 1<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-29.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-29.png?resize=452%2C426&#038;ssl=1\" alt=\"Setting PuTTY\" class=\"wp-image-21376\" width=\"452\" height=\"426\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-29.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-29.png?resize=300%2C283&amp;ssl=1 300w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/a><\/figure>\n\n\n\n<p>I was able to monitor the output results of the ESP-32 DevKitC to the serial console by connecting with PuTTY.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Topic Name\uff1aESP-WROOM-32-GGTest\/iotdemo\/topic\/1<\/li><\/ul>\n\n\n\n<p>I found out that it publishes (sends) at<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-72.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-72.png?resize=559%2C391&#038;ssl=1\" alt=\"PuTTY\u3067\u306e\u30e2\u30cb\u30bf\u30fc\" class=\"wp-image-21231\" width=\"559\" height=\"391\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-72.png?w=745&amp;ssl=1 745w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-72.png?resize=300%2C210&amp;ssl=1 300w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"MQTT_test_client\"><\/span>MQTT test client<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Confirm that the AWS IoT Core side is subscribing (receiving) the message.<\/p>\n\n\n\n<p>If the AWS console is still intact, you can receive and display the test message.<\/p>\n\n\n\n<p>If it is closed, select IoT Core from the list of services in the AWS console, go to the AWS IoT page, and then select &#8220;MQTT Test Client&#8221; from the menu.<\/p>\n\n\n\n<p>Enter &#8220;#&#8221; (Sharp is a wildcard) in the Topic filter field and click the &#8220;Subscribe&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-01.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-01.png?resize=768%2C361&#038;ssl=1\" alt=\"MQTT test client\" class=\"wp-image-21377\" width=\"768\" height=\"361\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-01.png?resize=1024%2C481&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-01.png?resize=300%2C141&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-01.png?resize=768%2C361&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-01.png?resize=1536%2C722&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-01.png?resize=520%2C245&amp;ssl=1 520w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-01.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>After waiting for a while, it receives a series of messages(Hello World! from ESP-WROOM-32) from ESP-32 DevKitC.<\/p>\n\n\n\n<p>Since the received message is not in JSON format, the message &#8220;Message cannot be displayed in specified format&#8221; message is displayed, but you don&#8217;t need to worry about it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-02.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-02.png?resize=768%2C360&#038;ssl=1\" alt=\"Hello World! from ESP-WROOM-32\" class=\"wp-image-21378\" width=\"768\" height=\"360\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-02.png?resize=1024%2C480&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-02.png?resize=300%2C141&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-02.png?resize=768%2C360&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-02.png?resize=1536%2C720&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-02.png?resize=520%2C245&amp;ssl=1 520w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-02.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>This sample program will terminate the program after sending a few messages.<\/p>\n\n\n\n<p>Pressing the EN (Enable) button on the ESP32 DevKitC will reset it and start the program from the beginning.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-03.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-03.jpg?resize=400%2C429&#038;ssl=1\" alt=\"reset button\" class=\"wp-image-21381\" width=\"400\" height=\"429\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-03.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-03.jpg?resize=280%2C300&amp;ssl=1 280w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-en-03.jpg?resize=768%2C823&amp;ssl=1 768w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_End\"><\/span>The End<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this sample program, I was able to connect to AWS IoT Core easily.<\/p>\n\n\n\n<p>Also, when connecting to cloud services from ESP32, I felt that using Amazon FreeRTOS to connect to AWS IoT Core is a good choice because it ensures security.<\/p>\n\n\n\n<p>I would like to try another sample project soon.<\/p>\n\n\n\n<p>That&#8217;s the end of this article.<\/p>\n\n\n<div class=\"postscript_balloon\">Finally.<\/div>\n\n\n<p>I hope this article will be useful to someone somewhere.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>FreeRTOS (Real Time Operating System) was acquired by Amazon in 2017 and is being developed as &#8220;Amazon FreeRTOS&#8221;.<br \/>\nA lightweight and simple Real Time OS<\/p>\n","protected":false},"author":5,"featured_media":21225,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/www.souichi.club\/?p=20954","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-21295","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aws","en-US"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/amazon-freertos-71.jpg?fit=1920%2C1920&ssl=1","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/21295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/comments?post=21295"}],"version-history":[{"count":3,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/21295\/revisions"}],"predecessor-version":[{"id":25133,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/21295\/revisions\/25133"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/media\/21225"}],"wp:attachment":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/media?parent=21295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/categories?post=21295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/tags?post=21295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}