{"id":1022,"date":"2019-09-07T09:34:32","date_gmt":"2019-09-07T09:34:32","guid":{"rendered":"http:\/\/fambach.net\/?p=1022"},"modified":"2024-04-04T13:03:57","modified_gmt":"2024-04-04T13:03:57","slug":"esp32-nuetzliche-infos","status":"publish","type":"post","link":"https:\/\/www.fambach.net\/en\/esp32-nuetzliche-infos\/","title":{"rendered":"ESP32 Useful Information"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" 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: #999;color:#999\" 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><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Fakten\" title=\"Facts\">Facts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Anwendungsbereiche\" title=\"Areas of application\">Areas of application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Ansichten\" title=\"Views\">Views<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Programmierung\" title=\"Programming\">Programming<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Bibliotheken\" title=\"Libraries\">Libraries<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Testprogramm\" title=\"Test programme\">Test programme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Alexa\" title=\"Alexa\">Alexa<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Probleme\" title=\"Problems\">Problems<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Gerat_erkannt_funktioniert_aber_nicht\" title=\"Ger\u00e4t erkannt funktioniert aber nicht\">Ger\u00e4t erkannt funktioniert aber nicht<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Sonstiges\" title=\"Miscellaneous\">Miscellaneous<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Einbinden_mit_dem_Handy\" title=\"Einbinden mit dem Handy\">Einbinden mit dem Handy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#ESPHome\" title=\"ESPHome\">ESPHome<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Fazit\" title=\"Conclusion\">Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Verwandte_Beitrage\" title=\"Related Posts\">Related Posts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/#Quellen\" title=\"Sources\">Sources<\/a><\/li><\/ul><\/nav><\/div>\n\n<p>The ESP32 is the successor to the successful ESP8266 controller. It features a 32-bit Tensilica Xtensa LX6 CPU with typically two cores (RISC architecture). I'm collecting interesting information here for myself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Areas of application<\/h2>\n\n\n\n<ul>\n<li>Household applications<\/li>\n\n\n\n<li>Home automation<\/li>\n\n\n\n<li>Smart sockets and lighting control<\/li>\n\n\n\n<li>WLAN Control<\/li>\n\n\n\n<li>Baby monitor<\/li>\n\n\n\n<li>IP cameras<\/li>\n\n\n\n<li>Sensor networks<\/li>\n\n\n\n<li>Wearables <\/li>\n\n\n\n<li>Bluetooth applications such as headphones\/speakers\u2026 <\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Documentation<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.espressif.com\/en\/products\/hardware\/esp32\/overview\">https:\/\/www.espressif.com\/en\/products\/hardware\/esp32\/overview<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/espressif\/arduino-esp32\">https:\/\/github.com\/espressif\/arduino-esp32<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hardware<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Packaging<\/h3>\n\n\n\n<p>The ESP32 is available as a chip or as a module with additional external memory, antennas, etc.<\/p>\n\n\n\n<p>The current versions can be found in the Espressif ordering information. Here is the link to it:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/espressif_products_ordering_information_en.pdf\"><\/a><a rel=\"noreferrer noopener\" href=\"https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/espressif_products_ordering_information_en.pdf\" target=\"_blank\">Espressif Order Information<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Designation<\/h3>\n\n\n\n<p>Every ESP comes with a label. The individual chips are marked with a code. Here is an example:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"659\" height=\"797\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-20-15_00_51.jpg\" alt=\"\" class=\"wp-image-6871\"\/><figcaption class=\"wp-element-caption\">Espressif Datasheet \u2013 Ordering Information <br>Source: https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/esp32_datasheet_en.pdf<\/figcaption><\/figure>\n\n\n\n<p>With the modules, the print is more of a reference to the respective data sheet or the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/espressif_products_ordering_information_en.pdf\" target=\"_blank\">Order information<\/a>.<\/p>\n\n\n\n<p>There are also different versions of the chips and modules, which can also differ from each other.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">inner workings<\/h3>\n\n\n\n<p>The following diagram shows the architecture of the controller.<br>In addition to various interfaces, it has:<\/p>\n\n\n\n<ul>\n<li>Wi-Fi<\/li>\n\n\n\n<li>Bluetooth<\/li>\n\n\n\n<li>A temperature sensor<\/li>\n\n\n\n<li>Crypto Routines<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/fambach.net\/wp-content\/uploads\/2018\/06\/666px-Espressif_ESP32_Function_Block_Diagram.svg_.png\"><img loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"591\" src=\"https:\/\/fambach.net\/wp-content\/uploads\/2018\/06\/666px-Espressif_ESP32_Function_Block_Diagram.svg_.png\" alt=\"\" class=\"wp-image-1024\" srcset=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2018\/06\/666px-Espressif_ESP32_Function_Block_Diagram.svg_.png 666w, https:\/\/www.fambach.net\/wp-content\/uploads\/2018\/06\/666px-Espressif_ESP32_Function_Block_Diagram.svg_-300x266.png 300w\" sizes=\"(max-width: 599px) calc(100vw - 50px), (max-width: 767px) calc(100vw - 70px), (max-width: 991px) 429px, (max-width: 1199px) 637px, 354px\" \/><\/a><figcaption class=\"wp-element-caption\">ESP32 block diagram<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Storage<\/h3>\n\n\n\n<p>The ESP comes with different memory configurations, here's a brief overview of which combinations are currently possible. The respective datasheet or the <a href=\"https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/espressif_products_ordering_information_en.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Order Information<\/a> to be taken.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">RAM<\/h4>\n\n\n\n<p>The original Esp32 has 520KB of internal memory, but also the ability to expand this externally. Currently, only PSRAM is supported for external expansion. It is possible to expand the memory up to 8MB, although currently only 4MB can be addressed simultaneously. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Flash<\/h4>\n\n\n\n<p>Depending on the configuration, the ESP comes in chip format with 0, 2, or 4 MB of internal FLASH. For modules, the FLASH can be externally fitted within the module. The original ESP can address a maximum of 16 MB of flash memory. Depending on how the flash memory is mapped and what type is used, different amounts of it can be managed.<\/p>\n\n\n\n<ul>\n<li>QSPI Flash\n<ul>\n<li>When mapping as instruction memory, up to 11MB + 248KB can be addressed. Access becomes performant above 3MB + 248KB.<\/li>\n\n\n\n<li>When mapping as read-only data storage, a maximum of 4MB can be addressed.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>External SRAM can be mapped as CPU data memory and up to 8MB is supported. However, only 4MB can be accessed at the same time. (Example OTA 2x 4MB usable) <\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">ROM<\/h4>\n\n\n\n<p>The UR-ESP has 448KB of ROM. According to the Espressif Forum, these include special internal functions and, for example, the Bluetooth stack. The externally usable functionality can be found on Git:<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/espressif\/esp-idf\/tree\/master\/components\/esp32\/include\/rom\">https:\/\/github.com\/espressif\/esp-idf\/tree\/master\/components\/esp32\/include\/rom<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">UART 1,2,3<\/h3>\n\n\n\n<p>The Esp32 has 3 UART interfaces, which can be configured independently of each other. The maximum speed is 5Mbps. This allows asynchronous communication with RS232, RS485 and IrDa support. <strong>Any GPIO pin can be used as a connection.<\/strong>. (Source: <a rel=\"noreferrer noopener\" href=\"https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/esp32_datasheet_en.pdf\" target=\"_blank\">Espressif ESP32 datasheet<\/a> Page 28, 31)<\/p>\n\n\n\n<p>Default pin assignment:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><th>UART<\/th><th>RX IO<\/th><th>TX IO<\/th><th>CTS<\/th><th>RTS<\/th><\/tr><tr><td>UART0<\/td><td>GPIO3<\/td><td>GPIO1<\/td><td>N\/A<\/td><td>N\/A<\/td><\/tr><tr><td>UART1<\/td><td>GPIO9<\/td><td>GPIO10<\/td><td>GPIO6<\/td><td>GPIO11<\/td><\/tr><tr><td>UART2<\/td><td>GPIO16<\/td><td>GPIO17<\/td><td>GPIO8<\/td><td>GPIO7<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Source: https:\/\/circuits4you.com\/2018\/12\/31\/esp32-hardware-serial2-example\/<\/figcaption><\/figure>\n\n\n\n<p>In the Arduino GUI, the following settings are available:<\/p>\n\n\n\n<ul>\n<li>Serial \u2013 Uart0 GPIO 1\/3<\/li>\n\n\n\n<li>Serial1 \u2013 Uart 1, GPIO 9\/10 already mostly occupied by flash memory<\/li>\n\n\n\n<li>Serial2 \u2013 Uart 2 GPIO 16\/17 <\/li>\n<\/ul>\n\n\n\n<p>The control is included in all common frameworks such as Arduino IDE, Espressif, Micropython\u2026.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">I\u00b2C Wire Bus<\/h3>\n\n\n\n<p>The ESP32 has two Wire buses. <strong>Any GPIO pin can be chosen for the connection.<\/strong>  It can operate at a speed of 100Kbit\/s (Standard Mode), 400Kbit\/s (Fast Mode), and up to 5MHz. Both buses support 7-bit and 10-bit addressing. (Source: <a rel=\"noreferrer noopener\" href=\"https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/esp32_datasheet_en.pdf\" target=\"_blank\">Espressif ESP32 Datasheet<\/a> Page 28,31)<\/p>\n\n\n\n<p>The control is included in all common frameworks such as Arduino IDE, Espressif, Micropython\u2026. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">ADC's<\/h3>\n\n\n\n<p>The ESP32 has two separate 12-bit ADC registers with a total of 18 channels. The 12-bit resolution results in a measurement range of 0 to 4095.<\/p>\n\n\n\n<p>The ADC1 has 8 channels, which are available on GPIOs 32-39. <\/p>\n\n\n\n<p>ADC2 has 10 channels and is connected to GPIOs 0, 2, 4, 12-15 and 25-27. Furthermore, the <strong>ADC2 cannot be used when Wi-Fi is in use<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>GPIO<\/th><th>ADC<\/th><th>Channel<\/th><th>Note <\/th><\/tr><\/thead><tbody><tr><td>36<\/td><td>1<\/td><td>0<\/td><td><\/td><\/tr><tr><td>37<\/td><td>1<\/td><td>1<\/td><td><\/td><\/tr><tr><td>38<\/td><td>1<\/td><td>2<\/td><td><\/td><\/tr><tr><td>39<\/td><td>1<\/td><td>3<\/td><td><\/td><\/tr><tr><td>32<\/td><td>1<\/td><td>4<\/td><td><\/td><\/tr><tr><td>33<\/td><td>1<\/td><td>5<\/td><td><\/td><\/tr><tr><td>34<\/td><td>1<\/td><td>6<\/td><td><\/td><\/tr><tr><td>35<\/td><td>1<\/td><td>7<\/td><td><\/td><\/tr><tr><td>4<\/td><td>2<\/td><td>0<\/td><td><\/td><\/tr><tr><td>0<\/td><td>2<\/td><td>1<\/td><td>Most often assigned to boot options<\/td><\/tr><tr><td>2<\/td><td>2<\/td><td>2<\/td><td><\/td><\/tr><tr><td>15<\/td><td>2<\/td><td>3<\/td><td><\/td><\/tr><tr><td>13<\/td><td>2<\/td><td>4<\/td><td><\/td><\/tr><tr><td>12<\/td><td>2<\/td><td>5<\/td><td><\/td><\/tr><tr><td>14<\/td><td>2<\/td><td>6<\/td><td><\/td><\/tr><tr><td>27<\/td><td>2<\/td><td>7<\/td><td><\/td><\/tr><tr><td>25<\/td><td>2<\/td><td>8<\/td><td><\/td><\/tr><tr><td>24<\/td><td>2<\/td><td>9<\/td><td><\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">ADC assignment to GPIOs<\/figcaption><\/figure>\n\n\n\n<p>Further information can be found in the article linked below from Espressif.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Programming environment<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Arduino GUI<\/h3>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-stefan-039-s-webblog wp-block-embed-stefan-039-s-webblog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"TLa0ht5EPN\"><a href=\"https:\/\/www.fambach.net\/en\/esp32-arduino-gui-einrichten\/\">Setting up ESP32 with the Arduino GUI<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u201eSetting up ESP32 with the Arduino GUI \u2013 Stefan&#039;s WebBlog\" src=\"https:\/\/www.fambach.net\/esp32-arduino-gui-einrichten\/embed\/#?secret=VZSdazLkmo#?secret=TLa0ht5EPN\" data-secret=\"TLa0ht5EPN\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Platformio<\/h3>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-stefan-039-s-webblog wp-block-embed-stefan-039-s-webblog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"fZHgiN36H3\"><a href=\"https:\/\/www.fambach.net\/en\/platform-io\/\">Platform IO<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u201ePlatform IO\u201c \u2014 Stefan&#039;s WebBlog\" src=\"https:\/\/www.fambach.net\/platform-io\/embed\/#?secret=6GHrnDniXr#?secret=fZHgiN36H3\" data-secret=\"fZHgiN36H3\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Espressif IDF<\/h3>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-stefan-039-s-webblog wp-block-embed-stefan-039-s-webblog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"GXxvR91RJH\"><a href=\"https:\/\/www.fambach.net\/en\/espressif-idf-fuer-esp32-s2-installieren\/\">Install Espressif IDF for ESP32-S2<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u201eInstalling Espressif IDF for ESP32-S2\u201c \u2014 Stefan&#039;s WebBlog\" src=\"https:\/\/www.fambach.net\/espressif-idf-fuer-esp32-s2-installieren\/embed\/#?secret=yOS7GYL9tB#?secret=GXxvR91RJH\" data-secret=\"GXxvR91RJH\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">VS Code for Espressif IDF<\/h3>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-stefan-039-s-webblog wp-block-embed-stefan-039-s-webblog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"4L1kRuSgo1\"><a href=\"https:\/\/www.fambach.net\/en\/vs-code-espressif-idf\/\">VS-Code Espressif IDF<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u201eVS-Code Espressif IDF \u2014 Stefan&#039;s WebBlog\" src=\"https:\/\/www.fambach.net\/vs-code-espressif-idf\/embed\/#?secret=CgRcHXWLJo#?secret=4L1kRuSgo1\" data-secret=\"4L1kRuSgo1\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Voltage at ESP query<\/h3>\n\n\n\n<p>The ESP8266 still has the option to measure the voltage. For the ESP32, an auxiliary circuit is required, a voltage divider with 100kOhm and 10kOhm on the ADC. <\/p>\n\n\n\n<p>More info can be found in the linked post:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.arduinoforum.de\/arduino-Thread-ESP32-Batteriestatus\">https:\/\/www.arduinoforum.de\/arduino-Thread-ESP32-Batteriestatus<\/a><\/p>\n\n\n\n<p>Formel zur Spannungsberechnung<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Uin = (100 + 10) \/ 10 ((R1 + R2) \/R2)&nbsp;<\/p>\n\n\n\n<p><\/p>\n<cite>https:\/\/www.arduinoforum.de\/arduino-Thread-ESP32-Batteriestatus<\/cite><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Software Tips<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Read hardware data<\/h3>\n\n\n\n<p>The esp.h file\/ESP class provides access to some hardware information. Such as ID, versions, free memory, etc. The complete range of functions can be viewed on GitHub. <\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/espressif\/arduino-esp32\/blob\/master\/cores\/esp32\/Esp.h\">https:\/\/github.com\/espressif\/arduino-esp32\/blob\/master\/cores\/esp32\/Esp.h<\/a><\/p>\n\n\n\n<p>The Esp.h usually doesn't need to be included as it's already part of the standard libraries. (Thanks for the tip to Andreas, see comment). Here are a few examples from the file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Trigger restart<\/h3>\n\n\n\n<p>One function is to restart the ESP. This may be necessary after a remote firmware update or with sloppy programming when memory is full ;).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">ESP.restart();<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Query storage information<\/h3>\n\n\n\n<p>Memory information is particularly useful for debugging. For example, it can be used to detect whether used memory is also being released. The following can be called for this purpose: <\/p>\n\n\n\n<p>Heap\/SPI memory size<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">uint32_t var = ESP.getHeapSize();\nuint32_t var2 = ESP.getPsramSize();<\/code><\/pre>\n\n\n\n<p>Free Heap\/PS Memory<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">uint32_t var1 = ESP.getFreeHeap();\nuint32_t var2 = ESP.getFreePsram();<\/code><\/pre>\n\n\n\n<p>Minimum Heap\/SPI memory since controller start.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">uint32_t var1 = ESP.getMinFreeHeap(); \nuint32_t var2 = ESP.getMinFreePsram();<\/code><\/pre>\n\n\n\n<p>Maximum block size of the heap\/SPI memory<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">uint32_t var1 = ESP.getMaxAllocHeap();\nuint32_t var2 = ESP.getMaxAllocPsram();<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Basic OTA<\/h3>\n\n\n\n<p>OTA \u2013 Over The Air \u2013 protocols enable microcontrollers to be flashed over the network. Since the ESP32 has Wi-Fi, flashing over the network is possible. The detailed guide can be found via the following link:<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/lastminuteengineers.com\/esp32-ota-updates-arduino-ide\/\" target=\"_blank\">Instructions for OTA<\/a><\/p>\n\n\n\n<p>Basically, the procedure is as follows:<\/p>\n\n\n\n<ul>\n<li>Install Python<\/li>\n\n\n\n<li>Select Example Project Basic OTA<\/li>\n\n\n\n<li>Enter Wi-Fi data<\/li>\n\n\n\n<li>Flash OTA firmware <\/li>\n\n\n\n<li>Integrate OTA into your own code and always flash over the network<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"594\" height=\"255\" data-id=\"6813\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-18-17_59_27.jpg\" alt=\"\" class=\"wp-image-6813\"\/><figcaption class=\"wp-element-caption\">Select project, specify network data and compile.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"448\" data-id=\"6814\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-18-17_58_59.jpg\" alt=\"\" class=\"wp-image-6814\"\/><figcaption class=\"wp-element-caption\">Programme the board once via USB.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"829\" height=\"614\" data-id=\"6812\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-18-18_03_07.jpg\" alt=\"\" class=\"wp-image-6812\"\/><figcaption class=\"wp-element-caption\">Afterwards, it can be flashed over the network.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"522\" data-id=\"6815\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-18-18_08_21.jpg\" alt=\"\" class=\"wp-image-6815\"\/><figcaption class=\"wp-element-caption\">This is what it looks like in the console.<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Problems<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">WiFi only connects every 2nd time.<\/h3>\n\n\n\n<p>To start the connection as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">  WiFi.disconnect();\n  WiFi.mode(WIFI_STA); \/\/ can also be another mode\n  while (WiFi.status() != WL_CONNECTED) {\n    WiFi.begin(SSID, PASSWORD);\n    delay(1000);\n  }<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Storage Full \/ too small<\/h3>\n\n\n\n<p>This is especially the case with graphics or the Bluetooth library, where you quickly hit the limits of the available program memory.<\/p>\n\n\n\n<p>There's a good introductory video from Andreas Spiess:<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/www.youtube.com\/watch?v=Qu-1RK4Fk7g\" target=\"_blank\">YouTube Andreas Spiess \u2013 More Memory for the ESP32\u2026<\/a><\/p>\n\n\n\n<p>Essentially, it's about setting the memory allocation correctly. To get more memory for the applications, OTA can be switched off or SPIFFS memory can be reduced.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Arduino GUI<\/h4>\n\n\n\n<p>In the Arduino GUI, the settings can be found in the Tools menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"758\" height=\"588\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-20-09_48_31.jpg\" alt=\"\" class=\"wp-image-6852\"\/><figcaption class=\"wp-element-caption\">Arduino GUI \u2013 Memory Settings<\/figcaption><\/figure>\n\n\n\n<p>Anyone needing additional options can add them in the XML configuration.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Espressif-IDF<\/h4>\n\n\n\n<p>In the Espressif IoT Development Framework (ESP-IDF), settings can be configured via Menuconfig and also through a custom partition table.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"427\" height=\"252\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-20-09_56_10.jpg\" alt=\"\" class=\"wp-image-6855\"\/><figcaption class=\"wp-element-caption\">Espressif IDF \u2013 Menuconfig, Main Menu<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"427\" height=\"176\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-20-09_55_00.jpg\" alt=\"\" class=\"wp-image-6854\"\/><figcaption class=\"wp-element-caption\">Espressif-IDF \u2013 Customising memory size and autodetect options<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"547\" height=\"106\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-20-10_01_16.jpg\" alt=\"\" class=\"wp-image-6857\"\/><figcaption class=\"wp-element-caption\">Espressif-IDF \u2013 Customising the Partition Table<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"874\" height=\"132\" src=\"https:\/\/www.fambach.net\/wp-content\/uploads\/2020-12-20-09_58_18.jpg\" alt=\"\" class=\"wp-image-6856\"\/><figcaption class=\"wp-element-caption\">Espressif-IDF \u2013 Partition table in the project directory<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Related Posts<\/h2>\n\n\n<div class=\"display-posts-listing\">\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/esp-web-serial-bibliothek\/\">ESP WEB Serial Library<\/a><\/div>\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/esp32-c3-seeed-studio-xiao\/\">ESP32-C3 Seeed Studio XIAO<\/a><\/div>\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/esp32-c3-super-mini-board\/\">ESP32-C3 Super Mini Board<\/a><\/div>\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/preview-luatos-esp32-c3-board\/\">Preview \u2013 LuatOS ESP32-C3 Board<\/a><\/div>\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/esp32-bluetooth-gamepad-2\/\">ESP32 Bluetooth Gamepad<\/a><\/div>\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/esp01-relay-platinen-2\/\">ESP01 \u2013 DHT11 Temperature and Humidity Sensor Boards<\/a><\/div>\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/esp01-relay-platinen\/\">ESP01 Relay Boards<\/a><\/div>\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/esp8266-32-wifi-manager\/\">ESP8266\/32 WiFi Manager.<\/a><\/div>\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/d1-mini-shield-prototyp-platine\/\">D1 Mini Shield \u2013 Prototype PCB<\/a><\/div>\n<div class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/preview-esp01-relais-modul\/\">ESP01 \u2013 Relay Board<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Sources<\/h2>\n\n\n\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/ESP32\">https:\/\/en.wikipedia.org\/wiki\/ESP32<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.espressif.com\/en\/products\/hardware\/esp32\/overview\">https:\/\/www.espressif.com\/en\/products\/hardware\/esp32\/overview<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/espressif\/arduino-esp32\">https:\/\/github.com\/espressif\/arduino-esp32<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/randomnerdtutorials.com\/esp32-pinout-reference-gpios\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP Wroom 32 IO Reference<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/docs.espressif.com\/projects\/esp-idf\/en\/latest\/esp32\/api-reference\/peripherals\/adc.html\" target=\"_blank\">Espressif's Contribution to the ADC<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/lastminuteengineers.com\/esp32-ota-updates-arduino-ide\/\" target=\"_blank\">Instructions for OTA<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/www.youtube.com\/watch?v=Qu-1RK4Fk7g\" target=\"_blank\">YouTube Andreas Spiess \u2013 More Memory for the ESP32\u2026<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/thingpulse.com\/esp32-how-to-use-psram\/#:~:text=Espressif%2C%20the%20manufacturer%20of%20the,lower%204MB%20in%20your%20applications.\" target=\"_blank\">ThingPulse's contribution to PSRam<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/espressif_products_ordering_information_en.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Espressif Order Information<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/esp32_datasheet_en.pdf\">https:\/\/www.espressif.com\/sites\/default\/files\/documentation\/esp32_datasheet_en.pdf<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Der ESP32 ist der Nachfolger des erfolgreichen ESP8266 Controllers. Er&nbsp;besitzt eine 32Bit Tensilica&nbsp;Xtensa LX6 CPU in der Regel mit zwei Kernen (RISC Architektur). Hier sammle ich f\u00fcr mich interessante Informationen. Anwendungsgebiete Dokumentation https:\/\/www.espressif.com\/en\/products\/hardware\/esp32\/overview https:\/\/github.com\/espressif\/arduino-esp32 Hardware Verpackung Den ESP32 gibt es als Chip oder Modul mit zus\u00e4tzlichen externen Speicher, Antennen u.\u00e4. Welche Versionen es aktuell gibt &#8230;<\/p>\n<a href=\"https:\/\/www.fambach.net\/en\/esp01-neopixel-ring\/\" class=\"read-more-link\">Continue reading <span class=\"screen-reader-text\">\"ESP01 &#8211; neoPixel Ring\"<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a>","protected":false},"author":1,"featured_media":10481,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[188],"tags":[33,148],"modified_by":"sfambach","_links":{"self":[{"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/posts\/1022"}],"collection":[{"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/comments?post=1022"}],"version-history":[{"count":37,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/posts\/1022\/revisions"}],"predecessor-version":[{"id":10023,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/posts\/1022\/revisions\/10023"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/media\/10481"}],"wp:attachment":[{"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/media?parent=1022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/categories?post=1022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/tags?post=1022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}