{"id":187575,"date":"2026-03-04T18:49:58","date_gmt":"2026-03-04T18:49:58","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=187575"},"modified":"2026-03-04T18:50:00","modified_gmt":"2026-03-04T18:50:00","slug":"esp-idf-esp32-wi-fi-scanner","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp-idf-esp32-wi-fi-scanner\/","title":{"rendered":"ESP-IDF: ESP32 Wi-Fi Scanner (Scan Nearby Networks RSSI)"},"content":{"rendered":"\n<p>In this guide, you&#8217;ll learn how to setup an ESP32 as a Wi-Fi scanner with ESP-IDF (Espressif IoT Development Framework). The Wi-Fi scanner code allows you to find nearby network access points that your ESP can establish a Wi-Fi connection.<\/p>\n\n\n\n<p>It collects some information about each network, such as RSSI (Received Signal Strength Indicator) to indicate if the ESP32 can establish a connection with a good signal strength. It also returns the Wi-Fi channel, authentication mode (like WPA2\/WPA3), and encryption cipher types.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP32-Scan-Networks.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Wi-Fi Scanner Scan Nearby Networks RSSI\" class=\"wp-image-189776\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP32-Scan-Networks.jpg?w=1920&amp;quality=100&amp;strip=all&amp;ssl=1 1920w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP32-Scan-Networks.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP32-Scan-Networks.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP32-Scan-Networks.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP32-Scan-Networks.jpg?resize=1536%2C864&amp;quality=100&amp;strip=all&amp;ssl=1 1536w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before following this guide, you need to install the ESP-IDF extension on VS Code IDE (Microsoft Visual Studio Code). Follow the next guide to install it, if you haven&#8217;t already:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/programming-esp32-esp-idf-vs-code\/\"><strong>Getting Started Guide:<\/strong> Programming ESP32 with ESP-IDF using VS Code<\/a><\/li>\n<\/ul>\n\n\n\n<p>You will also need an <a href=\"https:\/\/makeradvisor.com\/tools\/esp32-dev-board-wi-fi-bluetooth\/\" target=\"_blank\" rel=\"noopener\" title=\"\">ESP32 development board<\/a> model of your choice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating an ESP-IDF Template App Project for the ESP32<\/h2>\n\n\n\n<p>The ESP-IDF extension provides an easy way to create a project from scratch with all the required files and configurations generated automatically.<\/p>\n\n\n\n<p>To create a new ESP-IDF project on VS Code, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the ESP-IDF Espressif extension<\/li>\n\n\n\n<li>Expand the &#8220;<strong>Advanced<\/strong>&#8221; menu<\/li>\n\n\n\n<li>Click the &#8220;<strong>New Project Wizard<\/strong>&#8221; option<\/li>\n\n\n\n<li>Choose the &#8220;<strong>Use ESP-IDF v5.4.1<\/strong>&#8221; to select the framework version<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"937\" height=\"742\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Create-Open-New-Project-Wizard-Menu.png?resize=937%2C742&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Create Open New Project Wizard Menu\" class=\"wp-image-170511\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Create-Open-New-Project-Wizard-Menu.png?w=937&amp;quality=100&amp;strip=all&amp;ssl=1 937w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Create-Open-New-Project-Wizard-Menu.png?resize=300%2C238&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Create-Open-New-Project-Wizard-Menu.png?resize=768%2C608&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 937px) 100vw, 937px\" \/><\/figure><\/div>\n\n\n<p>A new window opens, you need to fill in these fields:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Project Name:<\/strong> type the desired project name;<\/li>\n\n\n\n<li><strong>Enter Project Directory:<\/strong> click the folder icon and select the target folder to save all your project files. You can use any directory. <strong>Note:<\/strong> <u>do NOT use a Google Drive \/ One Drive \/ Dropbox folder<\/u>, because it will write\/create many files during the building process\u2014if it&#8217;s on a cloud folder, this process might be extremely slow;<\/li>\n\n\n\n<li><strong>ESP-IDF Target:<\/strong> select the target device chip, I&#8217;m using an ESP32 with the <strong>esp32s3<\/strong> chip;<\/li>\n\n\n\n<li><strong>ESP-IDF Board:<\/strong> for the esp32s3 chip, I also need to select the configuration: ESP32-S chip (via builtin USB-JTAG);<\/li>\n\n\n\n<li><strong>Serial Port:<\/strong> while having your ESP32 board connected to your computer, select the correct COM port number that refers to your ESP32;<\/li>\n\n\n\n<li><strong>Choose Template:<\/strong> click the blue button to create a new project using a template.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"983\" height=\"856\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Create-Open-New-Project-Wizard-Menu-Select-Directory-Board-Template.png?resize=983%2C856&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Create Open New Project Wizard Menu Select Directory Board Template\" class=\"wp-image-170512\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Create-Open-New-Project-Wizard-Menu-Select-Directory-Board-Template.png?w=983&amp;quality=100&amp;strip=all&amp;ssl=1 983w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Create-Open-New-Project-Wizard-Menu-Select-Directory-Board-Template.png?resize=300%2C261&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Create-Open-New-Project-Wizard-Menu-Select-Directory-Board-Template.png?resize=768%2C669&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 983px) 100vw, 983px\" \/><\/figure><\/div>\n\n\n<p>In the menu, select the &#8220;<strong>ESP-IDF<\/strong>&#8220;, scroll down to the &#8220;<strong>wifi<\/strong>&#8221; section and open the &#8220;<strong>scan<\/strong>&#8221; example. Finally, press the &#8220;<strong>Create project using template sample project<\/strong>&#8221; button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1008\" height=\"720\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner.png?resize=1008%2C720&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Wi-Fi-Scanner Example code\" class=\"wp-image-187579\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner.png?w=1008&amp;quality=100&amp;strip=all&amp;ssl=1 1008w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner.png?resize=300%2C214&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner.png?resize=768%2C549&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1008px) 100vw, 1008px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Opening the ESP-IDF Project on VS Code<\/h3>\n\n\n\n<p>After a few seconds, a notification will appear on a new window on VS Code. You can click &#8220;<strong>Open Project<\/strong>&#8221; to open the newly created ESP-IDF sample project template.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"503\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Open-New-Project-Sample.png?resize=1024%2C503&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Open New Project Sample\" class=\"wp-image-187416\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Open-New-Project-Sample.png?resize=1024%2C503&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Open-New-Project-Sample.png?resize=300%2C147&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Open-New-Project-Sample.png?resize=768%2C377&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Open-New-Project-Sample.png?w=1231&amp;quality=100&amp;strip=all&amp;ssl=1 1231w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p><strong>IMPORTANT:<\/strong> if you didn&#8217;t see the notification that allows you to automatically open the ESP-IDF project on VS Code, you can easily do it by following these instructions:<\/p>\n\n\n\n<p>Go to <strong>File <\/strong>&gt; <strong>Open Folder&#8230;<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"396\" height=\"315\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Open-Project-Folder-VS-Code-File-Menu.png?resize=396%2C315&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Open Project Folder VS Code File Menu\" class=\"wp-image-170518\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Open-Project-Folder-VS-Code-File-Menu.png?w=396&amp;quality=100&amp;strip=all&amp;ssl=1 396w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Open-Project-Folder-VS-Code-File-Menu.png?resize=300%2C239&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 396px) 100vw, 396px\" \/><\/figure><\/div>\n\n\n<p>Browse on your computer for the <em>esp-idf-project folder<\/em> (your project folder name that you&#8217;ve previously defined) and &#8220;<strong>Select Folder<\/strong>&#8220;.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"366\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Open-Project-VS-Code-Select-Folder.png?resize=667%2C366&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Open Project VS Code Select Folder\" class=\"wp-image-170517\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Open-Project-VS-Code-Select-Folder.png?w=667&amp;quality=100&amp;strip=all&amp;ssl=1 667w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/ESP-IDF-ESP32-Open-Project-VS-Code-Select-Folder.png?resize=300%2C165&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 667px) 100vw, 667px\" \/><\/figure><\/div>\n\n\n<p>That&#8217;s it! Your new ESP-IDF project example has been successfully created and opened.<\/p>\n\n\n\n<p>The scanner code is in the <em>scan.c<\/em> file. To open it, follow these instructions:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the project explorer by clicking the first icon on the left sidebar and select your project.<\/li>\n\n\n\n<li>Expand the &#8220;<strong>main<\/strong>&#8221; folder.<\/li>\n\n\n\n<li>Open the &#8220;<strong><em>scan.c<\/em><\/strong>&#8221; file.<\/li>\n\n\n\n<li>Your main.c file should load<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"887\" height=\"609\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-Open-scan-c-file-VS-Code.png?resize=887%2C609&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Wi-Fi Scanner Open scan.c file VS Code\" class=\"wp-image-187581\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-Open-scan-c-file-VS-Code.png?w=887&amp;quality=100&amp;strip=all&amp;ssl=1 887w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-Open-scan-c-file-VS-Code.png?resize=300%2C206&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-Open-scan-c-file-VS-Code.png?resize=768%2C527&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 887px) 100vw, 887px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Code: ESP32 Wi-Fi Scanner using ESP-IDF<\/h2>\n\n\n\n<p>The ESP32 can scan nearby Wi-Fi networks within its Wi-Fi range. This can be useful to check if the Wi-Fi network you\u2019re trying to connect is within the range of your board or other applications. Your Wi-Fi project may not often work because it may not be able to connect to your router due to insufficient Wi-Fi strength.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"397\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/02\/ESP32-WiFi-Scan-Networks_Wi-Fi-Scan.png?resize=750%2C397&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 Scan WiFi Networks\" class=\"wp-image-101872\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/02\/ESP32-WiFi-Scan-Networks_Wi-Fi-Scan.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/02\/ESP32-WiFi-Scan-Networks_Wi-Fi-Scan.png?resize=300%2C159&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>Copy the following code to the <em>main.c<\/em> file. This code scans for all nearby Wi-Fi networks and indicates their corresponding RSSI.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/* \n    Rui Santos &amp; Sara Santos - Random Nerd Tutorials\n    https:\/\/RandomNerdTutorials.com\/esp-idf-esp32-wi-fi-scanner\/\n    \n    This example code is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n*\/\n#include &lt;string.h&gt;\n#include &quot;freertos\/FreeRTOS.h&quot;\n#include &quot;freertos\/event_groups.h&quot;\n#include &quot;esp_wifi.h&quot;\n#include &quot;esp_log.h&quot;\n#include &quot;esp_event.h&quot;\n#include &quot;nvs_flash.h&quot;\n#include &quot;regex.h&quot;\n\n#define DEFAULT_SCAN_LIST_SIZE CONFIG_EXAMPLE_SCAN_LIST_SIZE\n\n#ifdef CONFIG_EXAMPLE_USE_SCAN_CHANNEL_BITMAP\n#define USE_CHANNEL_BITMAP 1\n#define CHANNEL_LIST_SIZE 3\nstatic uint8_t channel_list[CHANNEL_LIST_SIZE] = {1, 6, 11};\n#endif \/*CONFIG_EXAMPLE_USE_SCAN_CHANNEL_BITMAP*\/\n\nstatic const char *TAG = &quot;scan&quot;;\n\nstatic void print_auth_mode(int authmode)\n{\n    switch (authmode) {\n    case WIFI_AUTH_OPEN:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_OPEN&quot;);\n        break;\n    case WIFI_AUTH_OWE:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_OWE&quot;);\n        break;\n    case WIFI_AUTH_WEP:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_WEP&quot;);\n        break;\n    case WIFI_AUTH_WPA_PSK:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_WPA_PSK&quot;);\n        break;\n    case WIFI_AUTH_WPA2_PSK:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_WPA2_PSK&quot;);\n        break;\n    case WIFI_AUTH_WPA_WPA2_PSK:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_WPA_WPA2_PSK&quot;);\n        break;\n    case WIFI_AUTH_ENTERPRISE:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_ENTERPRISE&quot;);\n        break;\n    case WIFI_AUTH_WPA3_PSK:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_WPA3_PSK&quot;);\n        break;\n    case WIFI_AUTH_WPA2_WPA3_PSK:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_WPA2_WPA3_PSK&quot;);\n        break;\n    case WIFI_AUTH_WPA3_ENTERPRISE:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_WPA3_ENTERPRISE&quot;);\n        break;\n    case WIFI_AUTH_WPA2_WPA3_ENTERPRISE:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_WPA2_WPA3_ENTERPRISE&quot;);\n        break;\n    case WIFI_AUTH_WPA3_ENT_192:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_WPA3_ENT_192&quot;);\n        break;\n    default:\n        ESP_LOGI(TAG, &quot;Authmode \\tWIFI_AUTH_UNKNOWN&quot;);\n        break;\n    }\n}\n\nstatic void print_cipher_type(int pairwise_cipher, int group_cipher)\n{\n    switch (pairwise_cipher) {\n    case WIFI_CIPHER_TYPE_NONE:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_NONE&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_WEP40:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_WEP40&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_WEP104:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_WEP104&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_TKIP:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_TKIP&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_CCMP:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_CCMP&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_TKIP_CCMP:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_TKIP_CCMP&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_AES_CMAC128:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_AES_CMAC128&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_SMS4:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_SMS4&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_GCMP:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_GCMP&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_GCMP256:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_GCMP256&quot;);\n        break;\n    default:\n        ESP_LOGI(TAG, &quot;Pairwise Cipher \\tWIFI_CIPHER_TYPE_UNKNOWN&quot;);\n        break;\n    }\n\n    switch (group_cipher) {\n    case WIFI_CIPHER_TYPE_NONE:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_NONE&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_WEP40:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_WEP40&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_WEP104:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_WEP104&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_TKIP:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_TKIP&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_CCMP:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_CCMP&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_TKIP_CCMP:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_TKIP_CCMP&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_SMS4:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_SMS4&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_GCMP:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_GCMP&quot;);\n        break;\n    case WIFI_CIPHER_TYPE_GCMP256:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_GCMP256&quot;);\n        break;\n    default:\n        ESP_LOGI(TAG, &quot;Group Cipher \\tWIFI_CIPHER_TYPE_UNKNOWN&quot;);\n        break;\n    }\n}\n\n#ifdef USE_CHANNEL_BITMAP\nstatic void array_2_channel_bitmap(const uint8_t channel_list[], const uint8_t channel_list_size, wifi_scan_config_t *scan_config) {\n\n    for(uint8_t i = 0; i &lt; channel_list_size; i++) {\n        uint8_t channel = channel_list[i];\n        scan_config-&gt;channel_bitmap.ghz_2_channels |= (1 &lt;&lt; channel);\n    }\n}\n#endif \/*USE_CHANNEL_BITMAP*\/\n\n\n\/* Initialize Wi-Fi as sta and set scan method *\/\nstatic void wifi_scan(void)\n{\n    ESP_ERROR_CHECK(esp_netif_init());\n    ESP_ERROR_CHECK(esp_event_loop_create_default());\n    esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta();\n    assert(sta_netif);\n\n    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();\n    ESP_ERROR_CHECK(esp_wifi_init(&amp;cfg));\n\n    uint16_t number = DEFAULT_SCAN_LIST_SIZE;\n    wifi_ap_record_t ap_info[DEFAULT_SCAN_LIST_SIZE];\n    uint16_t ap_count = 0;\n    memset(ap_info, 0, sizeof(ap_info));\n\n\n    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));\n    ESP_ERROR_CHECK(esp_wifi_start());\n\n#ifdef USE_CHANNEL_BITMAP\n    wifi_scan_config_t *scan_config = (wifi_scan_config_t *)calloc(1,sizeof(wifi_scan_config_t));\n    if (!scan_config) {\n        ESP_LOGE(TAG, &quot;Memory Allocation for scan config failed!&quot;);\n        return;\n    }\n    array_2_channel_bitmap(channel_list, CHANNEL_LIST_SIZE, scan_config);\n    esp_wifi_scan_start(scan_config, true);\n    free(scan_config);\n\n#else\n    esp_wifi_scan_start(NULL, true);\n#endif \/*USE_CHANNEL_BITMAP*\/\n\n    ESP_LOGI(TAG, &quot;Max AP number ap_info can hold = %u&quot;, number);\n    ESP_ERROR_CHECK(esp_wifi_scan_get_ap_num(&amp;ap_count));\n    ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&amp;number, ap_info));\n    ESP_LOGI(TAG, &quot;Total APs scanned = %u, actual AP number ap_info holds = %u&quot;, ap_count, number);\n    for (int i = 0; i &lt; number; i++) {\n        ESP_LOGI(TAG, &quot;SSID \\t\\t%s&quot;, ap_info[i].ssid);\n        ESP_LOGI(TAG, &quot;RSSI \\t\\t%d&quot;, ap_info[i].rssi);\n        print_auth_mode(ap_info[i].authmode);\n        if (ap_info[i].authmode != WIFI_AUTH_WEP) {\n            print_cipher_type(ap_info[i].pairwise_cipher, ap_info[i].group_cipher);\n        }\n        ESP_LOGI(TAG, &quot;Channel \\t\\t%d&quot;, ap_info[i].primary);\n    }\n}\n\nvoid app_main(void)\n{\n    \/\/ Initialize NVS\n    esp_err_t ret = nvs_flash_init();\n    if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {\n        ESP_ERROR_CHECK(nvs_flash_erase());\n        ret = nvs_flash_init();\n    }\n    ESP_ERROR_CHECK( ret );\n\n    wifi_scan();\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP-IDF\/wifi\/wifi_network_scanner.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Change the Scan List Size<\/h3>\n\n\n\n<p>By default, the scan example tries to find a maximum of 10 networks. Follow these steps to change it:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Click the <strong>gear icon<\/strong> to open the SDK Configuration Editor (menu config)<\/li>\n\n\n\n<li>Search for &#8220;<strong>Max size of scan list<\/strong>&#8220;<\/li>\n\n\n\n<li>You can edit max size of scan list with another number to show more\/less results<\/li>\n\n\n\n<li>Press the &#8220;<strong>Save<\/strong>&#8221; button to apply the changes<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"573\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-change-max-size-of-scan-list-configs.png?resize=745%2C573&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Wi-Fi Scanner change max size of scan list configs\" class=\"wp-image-187593\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-change-max-size-of-scan-list-configs.png?w=745&amp;quality=100&amp;strip=all&amp;ssl=1 745w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-change-max-size-of-scan-list-configs.png?resize=300%2C231&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 745px) 100vw, 745px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">How the Code Works<\/h3>\n\n\n\n<p>In this section, we&#8217;ll do a quick breakdown of the ESP-IDF Wi-Fi scanner code.<\/p>\n\n\n\n<p><strong>Header Includes and Global Configuration Variables<\/strong><\/p>\n\n\n\n<p>Starting by including the necessary libraries and global configuration variables. As described in the previous section, you can change the <span class=\"rnthl rntliteral\">DEFAULT_SCAN_LIST_SIZE<\/span> in the SDK Configuration Editor.<\/p>\n\n\n\n<p><strong>print_auth_mode() and print_cipher_type<\/strong><\/p>\n\n\n\n<p>There are two helper functions that print info in a readable format:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span class=\"rnthl rntliteral\">print_auth_mode(int authmode)<\/span>: uses a switch statement to map to values to the authentication mode used by the access point (example: <span class=\"rnthl rntliteral\">WIFI_AUTH_OPEN<\/span>, <span class=\"rnthl rntliteral\">WIFI_AUTH_WPA3_PSK<\/span>, etc&#8230;);<\/li>\n\n\n\n<li><span class=\"rnthl rntliteral\">print_cipher_type(int pairwise_cipher, int group_cipher)<\/span>: displays both pairwise and group cipher suites used by the access point (example: <span class=\"rnthl rntliteral\">WIFI_CIPHER_TYPE_CCMP<\/span> for <span class=\"rnthl rntliteral\">TKIP<\/span>).<\/li>\n<\/ul>\n\n\n\n<p><strong>wifi_scan()<\/strong><\/p>\n\n\n\n<p>The <span class=\"rnthl rntliteral\">wifi_scan()<\/span> function runs once and it&#8217;s called in the <span class=\"rnthl rntliteral\">app_main<\/span>. It initializes the network interface, default event loop, creates a station interface, and starts the Wi-Fi driver with default configuration.<\/p>\n\n\n\n<p>It uses the <span class=\"rnthl rntliteral\">ESP_ERROR_CHECK()<\/span> when executing each function to check for potential errors during the Wi-Fi interface initialization and scan process:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>ESP_ERROR_CHECK(esp_wifi_start());<\/code><\/pre>\n\n\n\n<p>Finally, it loops and logs all the key information in the Terminal window: how many Access Points (APs) were scanned, their SSID, RRSI, authentication mode, encryption cipher types, and Wi-Fi channel.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>ESP_LOGI(TAG, \"Max AP number ap_info can hold = %u\", number);\nESP_ERROR_CHECK(esp_wifi_scan_get_ap_num(&amp;ap_count));\nESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&amp;number, ap_info));\nESP_LOGI(TAG, \"Total APs scanned = %u, actual AP number ap_info holds = %u\", ap_count, number);\nfor (int i = 0; i &lt; number; i++) {\n    ESP_LOGI(TAG, \"SSID \\t\\t%s\", ap_info&#091;i].ssid);\n    ESP_LOGI(TAG, \"RSSI \\t\\t%d\", ap_info&#091;i].rssi);\n    print_auth_mode(ap_info&#091;i].authmode);\n    if (ap_info&#091;i].authmode != WIFI_AUTH_WEP) {\n        print_cipher_type(ap_info&#091;i].pairwise_cipher, ap_info&#091;i].group_cipher);\n    }\n    ESP_LOGI(TAG, \"Channel \\t\\t%d\", ap_info&#091;i].primary);\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Build and Flash Code to the ESP32 Board<\/h2>\n\n\n\n<p>To build and flash ESP-IDF code to the ESP32, you always need to follow this procedure. You need to select the flash method (UART), the COM port number, the target device (ESP32), build the code, and finally, flash it to the board. All these commands are available in the bottom menu bar of VS Code.<\/p>\n\n\n\n<p>Make sure all your options are correct (they may already be properly configured if you used the project wizard).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"28\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Check-All-the-Configured-Settings-UART-COM-Port-Target-Board.png?resize=498%2C28&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code ESP-IDF Check All the Configured Settings UART COM Port Target Board\" class=\"wp-image-170147\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Check-All-the-Configured-Settings-UART-COM-Port-Target-Board.png?w=498&amp;quality=100&amp;strip=all&amp;ssl=1 498w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Check-All-the-Configured-Settings-UART-COM-Port-Target-Board.png?resize=300%2C17&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 498px) 100vw, 498px\" \/><\/figure><\/div>\n\n\n<p>However, if your setup is not correct, follow the next instructions to ensure everything is set up correctly. First, click the &#8220;<strong>Star<\/strong>&#8221; icon and select the flash method as <strong>UART<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"584\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-Flash-UART-Option-to-Program-Flash-ESP32-1024x584.png?resize=1024%2C584&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code ESP-IDF Select Flash UART Option to Program Flash ESP32\" class=\"wp-image-170161\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-Flash-UART-Option-to-Program-Flash-ESP32.png?resize=1024%2C584&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-Flash-UART-Option-to-Program-Flash-ESP32.png?resize=300%2C171&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-Flash-UART-Option-to-Program-Flash-ESP32.png?resize=768%2C438&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-Flash-UART-Option-to-Program-Flash-ESP32.png?w=1030&amp;quality=100&amp;strip=all&amp;ssl=1 1030w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>While the ESP32 board is connected to your computer, click the COM Port (plug icon) and select the correct port number that refers to your ESP32.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"582\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Programming-ESP32-Board-Select-Correct-COM-Port-Number.png?resize=1024%2C582&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code ESP-IDF Programming ESP32 Board Select Correct COM Port Number\" class=\"wp-image-170160\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Programming-ESP32-Board-Select-Correct-COM-Port-Number.png?resize=1024%2C582&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Programming-ESP32-Board-Select-Correct-COM-Port-Number.png?resize=300%2C171&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Programming-ESP32-Board-Select-Correct-COM-Port-Number.png?resize=768%2C437&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Programming-ESP32-Board-Select-Correct-COM-Port-Number.png?w=1032&amp;quality=100&amp;strip=all&amp;ssl=1 1032w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>You also need to select the target device. Click on the chip icon at the bottom bar. In my case, I have an ESP32 with the <strong>esp32s3<\/strong> chip.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"579\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-the-ESP32-S3-or-Correct-Target-Device.png?resize=1024%2C579&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Select the ESP32 S3 or Correct Target Device ESP-IDF\" class=\"wp-image-170163\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-the-ESP32-S3-or-Correct-Target-Device.png?resize=1024%2C579&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-the-ESP32-S3-or-Correct-Target-Device.png?resize=300%2C170&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-the-ESP32-S3-or-Correct-Target-Device.png?resize=768%2C434&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-the-ESP32-S3-or-Correct-Target-Device.png?w=1031&amp;quality=100&amp;strip=all&amp;ssl=1 1031w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>For this board, I also need to select the configuration: <strong>ESP32-S chip (via builtin USB-JTAG)<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"757\" height=\"579\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-the-ESP32-S3-chip-via-built-in-USB-JTAG-Target-Device.png?resize=757%2C579&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code ESP-IDF Select the ESP32 S3 chip via built in USB JTAG Target Device\" class=\"wp-image-170162\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-the-ESP32-S3-chip-via-built-in-USB-JTAG-Target-Device.png?w=757&amp;quality=100&amp;strip=all&amp;ssl=1 757w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Select-the-ESP32-S3-chip-via-built-in-USB-JTAG-Target-Device.png?resize=300%2C229&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 757px) 100vw, 757px\" \/><\/figure><\/div>\n\n\n<p>Finally, your command bar on the bottom of VS Code should have similar options selected.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"28\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Check-All-the-Configured-Settings-UART-COM-Port-Target-Board.png?resize=498%2C28&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code ESP-IDF Check All the Configured Settings UART COM Port Target Board\" class=\"wp-image-170147\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Check-All-the-Configured-Settings-UART-COM-Port-Target-Board.png?w=498&amp;quality=100&amp;strip=all&amp;ssl=1 498w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Check-All-the-Configured-Settings-UART-COM-Port-Target-Board.png?resize=300%2C17&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 498px) 100vw, 498px\" \/><\/figure><\/div>\n\n\n<p>Now, you can build the project by clicking the wrench icon (<strong>Build Project<\/strong>) as shown in the image below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"581\" height=\"359\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/06\/VS-Code-Build-Project-Example-Code-ESP32-ESP-IDF.png?resize=581%2C359&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Build Project Example Code ESP32 ESP-IDF\" class=\"wp-image-170743\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/06\/VS-Code-Build-Project-Example-Code-ESP32-ESP-IDF.png?w=581&amp;quality=100&amp;strip=all&amp;ssl=1 581w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/06\/VS-Code-Build-Project-Example-Code-ESP32-ESP-IDF.png?resize=300%2C185&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 581px) 100vw, 581px\" \/><\/figure><\/div>\n\n\n<p>The first time you build a project, it usually takes a bit more time. Once completed, it should print a similar message in the <strong>Terminal<\/strong> menu and show a &#8220;<strong>Build Successfully<\/strong>&#8221; message.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"468\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/06\/VS-Code-Build-Example-Project-ESP32-ESP-IDF-Success-Message.jpg?resize=648%2C468&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Build Example Project ESP32 ESP-IDF Success Message\" class=\"wp-image-170742\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/06\/VS-Code-Build-Example-Project-ESP32-ESP-IDF-Success-Message.jpg?w=648&amp;quality=100&amp;strip=all&amp;ssl=1 648w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/06\/VS-Code-Build-Example-Project-ESP32-ESP-IDF-Success-Message.jpg?resize=300%2C217&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 648px) 100vw, 648px\" \/><\/figure><\/div>\n\n\n<p>This is the final step. You can now flash the ESP-IDF project to the ESP32 by clicking the &#8220;<strong>Flash Device<\/strong>&#8221; button (thunder icon).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"848\" height=\"170\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Flash-Hello-World-Code-Project-to-ESP32-ESP-IDF.png?resize=848%2C170&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Flash Hello World Code Project to ESP32 ESP-IDF\" class=\"wp-image-170294\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Flash-Hello-World-Code-Project-to-ESP32-ESP-IDF.png?w=848&amp;quality=100&amp;strip=all&amp;ssl=1 848w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Flash-Hello-World-Code-Project-to-ESP32-ESP-IDF.png?resize=300%2C60&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Flash-Hello-World-Code-Project-to-ESP32-ESP-IDF.png?resize=768%2C154&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 848px) 100vw, 848px\" \/><\/figure><\/div>\n\n\n<p>Depending on your board, you might need to hold down the on-board BOOT button on your ESP32 to put into flashing mode. Once the process is completed, it will pop-up a info message saying &#8220;<strong>Flash Done<\/strong>&#8220;.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"575\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Flash-Hello-Wolrd-Project-to-ESP32-ESP-IDF-Done-Success-Message.png?resize=1024%2C575&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Flash Hello World Project to ESP32 ESP-IDF Done Success Message\" class=\"wp-image-170155\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Flash-Hello-Wolrd-Project-to-ESP32-ESP-IDF-Done-Success-Message.png?resize=1024%2C575&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Flash-Hello-Wolrd-Project-to-ESP32-ESP-IDF-Done-Success-Message.png?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Flash-Hello-Wolrd-Project-to-ESP32-ESP-IDF-Done-Success-Message.png?resize=768%2C431&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Flash-Hello-Wolrd-Project-to-ESP32-ESP-IDF-Done-Success-Message.png?w=1039&amp;quality=100&amp;strip=all&amp;ssl=1 1039w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Demonstration<\/h2>\n\n\n\n<p>If you followed all the steps, the Wi-Fi scanner example should be running successfully on your board. Open your Terminal window \u2014 click the &#8220;<strong>Monitor Device<\/strong>&#8221; tool that is illustrated with a screen icon.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"77\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Open-Terminal-Window-Monitor-Device-ESP32-ESP-IDF.png?resize=780%2C77&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Open Terminal Window Monitor Device ESP32 ESP-IDF\" class=\"wp-image-170157\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Open-Terminal-Window-Monitor-Device-ESP32-ESP-IDF.png?w=780&amp;quality=100&amp;strip=all&amp;ssl=1 780w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Open-Terminal-Window-Monitor-Device-ESP32-ESP-IDF.png?resize=300%2C30&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2025\/05\/VS-Code-Open-Terminal-Window-Monitor-Device-ESP32-ESP-IDF.png?resize=768%2C76&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 780px) 100vw, 780px\" \/><\/figure><\/div>\n\n\n<p>The terminal should be printing some information regarding each network nearby:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>I (3033) scan: SSID             MEO-20------\nI (3033) scan: RSSI             -52\nI (3033) scan: Authmode         WIFI_AUTH_WPA2_PSK\nI (3033) scan: Pairwise Cipher  WIFI_CIPHER_TYPE_CCMP\nI (3043) scan: Group Cipher     WIFI_CIPHER_TYPE_CCMP\nI (3043) scan: Channel          11<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"756\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-Terminal-Serial-Monitor-Demonstration-VS-Code.png?resize=734%2C756&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP-IDF ESP32 Wi-Fi Scanner Terminal Serial Monitor Demonstration VS Code\" class=\"wp-image-187583\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-Terminal-Serial-Monitor-Demonstration-VS-Code.png?w=734&amp;quality=100&amp;strip=all&amp;ssl=1 734w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP-IDF-ESP32-Wi-Fi-Scanner-Terminal-Serial-Monitor-Demonstration-VS-Code.png?resize=291%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 291w\" sizes=\"(max-width: 734px) 100vw, 734px\" \/><\/figure><\/div>\n\n\n<p>You can press the ESP32 on-board RESET button to restart and see new scan results.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial, you learned how to setup the ESP32 as a Wi-Fi scanner with the ESP-IDF framework using VS Code to find nearby networks and their corresponding signal strenght.<\/p>\n\n\n\n<p>You might find helpful reading other ESP-IDF guides:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/programming-esp32-esp-idf-vs-code\/\">Programming ESP32 with ESP-IDF using VS Code \u2013 Getting Started Guide<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp-idf-esp32-blink-led\/\">ESP-IDF: ESP32 Blink LED Example (VS Code)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp-idf-esp32-gpio-pwm-ledc\/\">ESP-IDF: ESP32 GPIO PWM with LEDC (Control LED Brightness)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp-idf-esp32-gpio-analog-adc\/\">ESP-IDF: ESP32 GPIO \u2013 Read Analog Input (ADC \u2013 Analog to Digital Converter)<\/a><\/li>\n<\/ul>\n\n\n\n<p>Meanwhile, you can check our ESP32 resources (with Arduino IDE) to learn more about the ESP32 board:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\">Learn ESP32 with Arduino IDE (eBook)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/projects-esp32\/\">More ESP32 Projects and Tutorials\u2026<\/a><\/li>\n<\/ul>\n\n\n\n<p>Thanks for reading.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you&#8217;ll learn how to setup an ESP32 as a Wi-Fi scanner with ESP-IDF (Espressif IoT Development Framework). The Wi-Fi scanner code allows you to find nearby network &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ESP-IDF: ESP32 Wi-Fi Scanner (Scan Nearby Networks RSSI)\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp-idf-esp32-wi-fi-scanner\/#more-187575\" aria-label=\"Read more about ESP-IDF: ESP32 Wi-Fi Scanner (Scan Nearby Networks RSSI)\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":189776,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[327,328,264],"tags":[],"class_list":["post-187575","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp-idf","category-esp32-esp-idf","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2026\/01\/ESP32-Scan-Networks.jpg?fit=1920%2C1080&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/187575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=187575"}],"version-history":[{"count":7,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/187575\/revisions"}],"predecessor-version":[{"id":190569,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/187575\/revisions\/190569"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/189776"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=187575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=187575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=187575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}