{"id":103070,"date":"2021-04-16T11:18:40","date_gmt":"2021-04-16T11:18:40","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=103070"},"modified":"2021-04-16T11:35:21","modified_gmt":"2021-04-16T11:35:21","slug":"micropython-esp32-esp8266-vs-code-pymakr","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/micropython-esp32-esp8266-vs-code-pymakr\/","title":{"rendered":"MicroPython: Program ESP32\/ESP8266 using VS Code and Pymakr"},"content":{"rendered":"\n<p>In this guide, you&#8217;ll learn how to program your ESP32 and ESP8266 boards with MicroPython using VS Code Editor (Visual Studio Code) with the Pymakr extension. <\/p>\n\n\n\n<p>If you&#8217;re used to programming the ESP32 and ESP8266 boards using <a href=\"https:\/\/randomnerdtutorials.com\/vs-code-platformio-ide-esp32-esp8266-arduino\/\">VS Code with PlatformIO IDE<\/a> (Arduino core), and you also want to program them with MicroPython, using the Pymakr extension might be a good alternative.<\/p>\n\n\n\n<div class=\"wp-block-image\"><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\/2021\/04\/Program-ESP32-ESP8266-Boards-MicroPython-using-VS-Code-Pymakr.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Program ESP32\/ESP8266 Boards with MicroPython using VS Code and Pymakr\" class=\"wp-image-103099\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Program-ESP32-ESP8266-Boards-MicroPython-using-VS-Code-Pymakr.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Program-ESP32-ESP8266-Boards-MicroPython-using-VS-Code-Pymakr.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Program-ESP32-ESP8266-Boards-MicroPython-using-VS-Code-Pymakr.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Program-ESP32-ESP8266-Boards-MicroPython-using-VS-Code-Pymakr.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n\n<p>We&#8217;ve experimented with several IDEs to program the ESP32 and ESP8266 boards with MicroPython. All IDES have advantages and disadvantages. In our opinion, this option works the best with fewer bugs when compared to other IDEs. However, it might be an overwhelming task getting used to VS Code.<\/p>\n\n\n\n<p>If you&#8217;ve never used VS Code, it might be a little difficult getting started. If you find that this option is very advanced, you might consider using simpler IDEs like <a href=\"https:\/\/randomnerdtutorials.com\/getting-started-thonny-micropython-python-ide-esp32-esp8266\/\">Thonny IDE<\/a> and <a href=\"https:\/\/randomnerdtutorials.com\/install-upycraft-ide-windows-pc-instructions\/\">uPyCraft IDE<\/a> to program your boards with MicroPython:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/getting-started-thonny-micropython-python-ide-esp32-esp8266\/\">Getting Started with Thonny MicroPython (Python) IDE for ESP32 and ESP8266<\/a><\/li><li>Install and Getting Started with uPyCraft IDE:<ul><li><a href=\"https:\/\/randomnerdtutorials.com\/install-upycraft-ide-windows-pc-instructions\/\">Windows PC Instructions<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/install-upycraft-ide-mac-os-x-instructions\/\">Mac OS X Instructions<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/install-upycraft-ide-linux-ubuntu-instructions\/\">Linux Ubuntu Instructions<\/a><\/li><\/ul><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Getting Started<\/h2>\n\n\n\n<p><strong>1)<\/strong> To properly follow this tutorial, <strong>you need a device with micropython firmware<\/strong>. Follow one of the next tutorials to flash micropython firmware on the ESP32 or ESP8266 boards:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/flashing-micropython-firmware-esptool-py-esp32-esp8266\/\">Flashing MicroPython Firmware with esptool.py on ESP32 and ESP8266<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/install-upycraft-ide-windows-pc-instructions\/\" target=\"_blank\" rel=\"noreferrer noopener\">Flash\/Upload MicroPython Firmware to ESP32 and ESP8266 (using uPyCraft IDE) *<\/a><\/li><\/ul>\n\n\n\n<p class=\"rntbox rntclgray\">* this option is easier, but requires that you install uPyCraft IDE software.<\/p>\n\n\n\n<p><strong>2)<\/strong> You need to install VS Code on your computer. Follow one of the next sections if you need to install VS Code:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"#1a\">A) Installing VS Code on Windows (Visual Studio Code)<\/a><\/li><li><a href=\"#1b\">B) Installing VS Code on Mac OS X (Visual Studio Code)<\/a><\/li><li><a href=\"#1c\">C) Installing VS Code on Linux Ubuntu (Visual Studio Code)<\/a><\/li><\/ul>\n\n\n\n<p><strong>3)<\/strong> Then, follow the instructions to set up Pymakr, connect a MicroPython device and run your first project:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"#pymakr\">Installing Pymakr Extension on VS Code<\/a><\/li><li><a href=\"#connecting\" title=\"#connecting\">Connecting a MicroPython device to Pymakr<\/a><\/li><li><a href=\"http:\/\/Creating a MicroPython Project on VS Code + Pymakr\">Creating a MicroPython Project on VS Code + Pymakr<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1a\">A) Installing VS Code on Windows (Visual Studio Code)<\/h2>\n\n\n\n<p>Go to <a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/code.visualstudio.com\/<\/a> and download the stable build for your operating system (Windows).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1012\" height=\"682\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/1-Download-VS-Studio-Code.jpg?resize=1012%2C682&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Download Page for Windows PC\" class=\"wp-image-99205\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/1-Download-VS-Studio-Code.jpg?w=1012&amp;quality=100&amp;strip=all&amp;ssl=1 1012w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/1-Download-VS-Studio-Code.jpg?resize=300%2C202&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/1-Download-VS-Studio-Code.jpg?resize=768%2C518&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1012px) 100vw, 1012px\" \/><\/figure><\/div>\n\n\n\n<p>Click on the installation wizard to start the installation and follow all the steps to complete the installation. Accept the agreement and press the <strong>Next <\/strong>button.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"598\" height=\"464\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/2-Install-VS-Code.png?resize=598%2C464&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard\" class=\"wp-image-99206\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/2-Install-VS-Code.png?w=598&amp;quality=100&amp;strip=all&amp;ssl=1 598w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/2-Install-VS-Code.png?resize=300%2C233&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/figure><\/div>\n\n\n\n<p>Select the following options and click <strong>Next<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"464\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Install-VS-Code.png?resize=598%2C464&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard step 2\" class=\"wp-image-99207\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Install-VS-Code.png?w=598&amp;quality=100&amp;strip=all&amp;ssl=1 598w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Install-VS-Code.png?resize=300%2C233&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/figure><\/div>\n\n\n\n<p>Press the <strong>Install <\/strong>button.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"464\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Install-VS-Code.png?resize=598%2C464&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard step 3\" class=\"wp-image-99208\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Install-VS-Code.png?w=598&amp;quality=100&amp;strip=all&amp;ssl=1 598w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Install-VS-Code.png?resize=300%2C233&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/figure><\/div>\n\n\n\n<p>Finally, click <strong>Finish <\/strong>to finish the installation.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"464\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Install-VS-Code.png?resize=598%2C464&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard final step\" class=\"wp-image-99204\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Install-VS-Code.png?w=598&amp;quality=100&amp;strip=all&amp;ssl=1 598w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Install-VS-Code.png?resize=300%2C233&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/figure><\/div>\n\n\n\n<p>Open VS Code and you\u2019ll be greeted by a Welcome tab with the released notes of the newest version.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1033\" height=\"770\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?resize=1033%2C770&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard welcome screen on a Windows PC\" class=\"wp-image-99216\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?w=1033&amp;quality=100&amp;strip=all&amp;ssl=1 1033w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?resize=300%2C224&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?resize=1024%2C763&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?resize=768%2C572&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1033px) 100vw, 1033px\" \/><\/figure><\/div>\n\n\n\n<p>That\u2019s it. Visual Studio Code was successfully installed.<\/p>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1b\">B) Installing VS Code on Mac OS X (Visual Studio Code)<\/h2>\n\n\n\n<p>Go to <a href=\"https:\/\/code.visualstudio.com\/\">https:\/\/code.visualstudio.com\/<\/a> and download the stable build for your operating system (Mac OS X).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1167\" height=\"592\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?resize=1167%2C592&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Download Page for Mac OS X\" class=\"wp-image-99336\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?w=1167&amp;quality=100&amp;strip=all&amp;ssl=1 1167w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?resize=300%2C152&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?resize=1024%2C519&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?resize=768%2C390&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1167px) 100vw, 1167px\" \/><\/figure><\/div>\n\n\n\n<p>After downloading the Visual Studio Code application file, you&#8217;ll be prompted with the following message. Press the &#8220;<strong>Open<\/strong>&#8221; button.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"158\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-save-file.png?resize=487%2C158&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Downloading application file for Mac OS X\" class=\"wp-image-99338\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-save-file.png?w=487&amp;quality=100&amp;strip=all&amp;ssl=1 487w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-save-file.png?resize=300%2C97&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 487px) 100vw, 487px\" \/><\/figure><\/div>\n\n\n\n<p>Or open your Downloads folder and open Visual Studio Code.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"214\" height=\"140\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-file-downloaded-Mac-OS-X.png?resize=214%2C140&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Downloading application file for Mac OS X\" class=\"wp-image-99337\"\/><\/figure><\/div>\n\n\n\n<p>After that, you\u2019ll be greeted by a Welcome tab with the released notes of the newest version.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"767\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?resize=1024%2C767&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard welcome screen on Max OS X\" class=\"wp-image-99339\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?w=1024&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?resize=300%2C225&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?resize=768%2C575&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>That\u2019s it. Visual Studio Code was successfully installed.<\/p>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1c\">C) Installing VS Code on Linux Ubuntu (Visual Studio Code)<\/h2>\n\n\n\n<p>Go to <a href=\"https:\/\/code.visualstudio.com\/\">https:\/\/code.visualstudio.com\/<\/a> and download the stable build for your operating system (Linux Ubuntu).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"438\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=961%2C438&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Download Page for Linux Ubuntu\" class=\"wp-image-99324\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?w=961&amp;quality=100&amp;strip=all&amp;ssl=1 961w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=300%2C137&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=768%2C350&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 961px) 100vw, 961px\" \/><\/figure><\/div>\n\n\n\n<p>Save the installation file:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"350\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=495%2C350&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Save installation file for Linux Ubuntu\" class=\"wp-image-99325\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?w=495&amp;quality=100&amp;strip=all&amp;ssl=1 495w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=300%2C212&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 495px) 100vw, 495px\" \/><\/figure><\/div>\n\n\n\n<p>To install it, open a Terminal windows, navigate to your Downloads folder and run the following command to install VS Code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ cd Downloads\n~\/Downloads $ sudo apt install .\/code_1.49.1-1600299189_amd64.deb<\/code><\/pre>\n\n\n\n<p>When the installation is finished, VS Code should be available in your applications menu.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"516\" height=\"326\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-run-VS-Code-Linux-Ubuntu.png?resize=516%2C326&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Open application Linux Ubuntu\" class=\"wp-image-99326\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-run-VS-Code-Linux-Ubuntu.png?w=516&amp;quality=100&amp;strip=all&amp;ssl=1 516w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-run-VS-Code-Linux-Ubuntu.png?resize=300%2C190&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 516px) 100vw, 516px\" \/><\/figure><\/div>\n\n\n\n<p>Open VS Code and you\u2019ll be greeted by a Welcome tab with the released notes of the newest version.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"632\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu-Testing.png?resize=1024%2C632&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard welcome screen on Linux Ubuntu\" class=\"wp-image-99327\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu-Testing.png?w=1024&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu-Testing.png?resize=300%2C185&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu-Testing.png?resize=768%2C474&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>That\u2019s it. Visual Studio Code was successfully installed.<\/p>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"pymakr\">Installing Pymakr Extension on VS Code<\/h2>\n\n\n\n<p>In this section, we&#8217;ll install the Pymakr extension on VS Code. This extension allows you to communicate to your MicroPython devices using the build-in command-line REPL. It provides a UI with buttons to run a single file to your board, sync your entire project or directly type and execute commands.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p>To use Pymakr extension on VS Code, you need node.js installed on your computer.<\/p>\n\n\n\n<p>Go to the node.js website <a href=\"https:\/\/nodejs.org\/en\/\" target=\"_blank\" rel=\"noreferrer noopener\">Home<\/a> or <a href=\"https:\/\/nodejs.org\/en\/download\/\" target=\"_blank\" rel=\"noreferrer noopener\">Downloads<\/a> page and install node.js on your operating system.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"387\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/install-node-js-windows.png?resize=495%2C387&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Installing node.js setup windows\" class=\"wp-image-103072\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/install-node-js-windows.png?w=495&amp;quality=100&amp;strip=all&amp;ssl=1 495w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/install-node-js-windows.png?resize=300%2C235&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 495px) 100vw, 495px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Pymakr Plugin<\/h3>\n\n\n\n<p><strong>1)<\/strong> Open VS Code. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"767\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?resize=1024%2C767&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Homepage welcome screen Visual Studio\" class=\"wp-image-99339\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?w=1024&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?resize=300%2C225&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?resize=768%2C575&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p><strong>2)<\/strong> Click on the <strong>Extensions <\/strong>icon to navigate to the <strong>Extensions <\/strong>page. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"47\" height=\"49\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/VS-Code-Extensions.png?resize=47%2C49&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Vs Code Extensions plugins icon Visual Studio\" class=\"wp-image-103090\"\/><\/figure><\/div>\n\n\n\n<p><strong>3)<\/strong> Search for <span class=\"rnthl rntliteral\">Pymakr<\/span> and install it.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"429\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Install-Pymakr-VS-Code-Micropython.png?resize=957%2C429&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Install Pymakr VS Code Micropython Visual Studio Code\" class=\"wp-image-103075\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Install-Pymakr-VS-Code-Micropython.png?w=957&amp;quality=100&amp;strip=all&amp;ssl=1 957w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Install-Pymakr-VS-Code-Micropython.png?resize=300%2C134&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Install-Pymakr-VS-Code-Micropython.png?resize=768%2C344&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 957px) 100vw, 957px\" \/><\/figure><\/div>\n\n\n\n<p>The Pymakr extension is now installed on VS Code. The Pymakr Console will open, and you should have new commands at the bottom bar.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"650\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-VS-Code-Installing-PyMakr-extension-settings-file-terminal.png?resize=1200%2C650&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Install Pymakr json config file VS Code Micropython\" class=\"wp-image-103076\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-VS-Code-Installing-PyMakr-extension-settings-file-terminal.png?w=1920&amp;quality=100&amp;strip=all&amp;ssl=1 1920w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-VS-Code-Installing-PyMakr-extension-settings-file-terminal.png?resize=300%2C163&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-VS-Code-Installing-PyMakr-extension-settings-file-terminal.png?resize=1024%2C555&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-VS-Code-Installing-PyMakr-extension-settings-file-terminal.png?resize=768%2C416&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-VS-Code-Installing-PyMakr-extension-settings-file-terminal.png?resize=1536%2C832&amp;quality=100&amp;strip=all&amp;ssl=1 1536w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n\n<p>These are the new commands:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"66\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Pymakr-commands-VS-Code.png?resize=576%2C66&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Install PymakrVS Code Micropython Commands\" class=\"wp-image-103077\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Pymakr-commands-VS-Code.png?w=576&amp;quality=100&amp;strip=all&amp;ssl=1 576w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Pymakr-commands-VS-Code.png?resize=300%2C34&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Pymakr Console:<\/strong> toggle board connection\u2014connect\/disconnect the board<\/li><li><strong>Run:<\/strong> run currently open file on the board<\/li><li><strong>Upload:<\/strong> upload project to your board<\/li><li><strong>Download:<\/strong> download project from your board<\/li><li><strong>All commands:<\/strong> list all available Pymakr commands<\/li><\/ul>\n\n\n\n<p>Select <strong>All commands:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"540\" height=\"32\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-all-commands-open.png?resize=540%2C32&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Pymakr open all commands menu\" class=\"wp-image-103270\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-all-commands-open.png?w=540&amp;quality=100&amp;strip=all&amp;ssl=1 540w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-all-commands-open.png?resize=300%2C18&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 540px) 100vw, 540px\" \/><\/figure><\/div>\n\n\n\n<p>This menu opens:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"408\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/all-commands-pymakr.png?resize=760%2C408&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Install Pymakr VS Code Micropython Commands actions\" class=\"wp-image-103091\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/all-commands-pymakr.png?w=760&amp;quality=100&amp;strip=all&amp;ssl=1 760w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/all-commands-pymakr.png?resize=300%2C161&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 760px) 100vw, 760px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"connecting\">Connecting a MicroPython Device to Pymakr<\/h3>\n\n\n\n<p>At the same time, Pymakr will automatically open the <span class=\"rnthl rntliteral\">pymakr.json<\/span> file. You should edit that file to connect a MicroPython device (for example: your ESP32 or ESP8266 with the MicroPython firmware flashed).<\/p>\n\n\n\n<p class=\"rntbox rntclgray\"><strong>Note: <\/strong> if the <span class=\"rnthl rntliteral\">pymakr.json<\/span> file doesn&#8217;t open automatically, go to <strong>All Commands<\/strong> (at the bottom bar) and then select <strong>Pymakr <\/strong>&gt; <strong>Global Settings<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"393\" height=\"358\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-global-settings.png?resize=393%2C358&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"pymakr global settings file\" class=\"wp-image-103271\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-global-settings.png?w=393&amp;quality=100&amp;strip=all&amp;ssl=1 393w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-global-settings.png?resize=300%2C273&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure><\/div>\n\n\n\n<p class=\"rntbox rntclgray\">This opens the <span class=\"rnthl rntliteral\">pymakr.json<\/span> file.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"665\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-configuration-file.png?resize=900%2C665&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Connecting a MicroPython Device to Pymakr pymark.json config file\" class=\"wp-image-103081\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-configuration-file.png?w=900&amp;quality=100&amp;strip=all&amp;ssl=1 900w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-configuration-file.png?resize=300%2C222&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-configuration-file.png?resize=768%2C567&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure><\/div>\n\n\n\n<p>Pymakr has a list of USB devices that it will connect to. You need to make sure that your device is on the list in the <span class=\"rnthl rntliteral\">pymakr.json<\/span> configuration file. You need to add the USB Manufacturer that the device uses to connect to the PC. In our case, both the ESP32 and ESP8266 use the <strong>Silicon Labs USB<\/strong> drivers.<\/p>\n\n\n\n<p>To find which drivers your board uses, open your computer&#8217;s Devices Manager (with the board connected to your computer) and search for connected USB devices.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"408\" height=\"455\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Device-Manager-USB-Drivers-ESP32.png?resize=408%2C455&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 or ESP8266 NodeMCU board drivers\" class=\"wp-image-103080\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Device-Manager-USB-Drivers-ESP32.png?w=408&amp;quality=100&amp;strip=all&amp;ssl=1 408w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Device-Manager-USB-Drivers-ESP32.png?resize=269%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 269w\" sizes=\"(max-width: 408px) 100vw, 408px\" \/><\/figure><\/div>\n\n\n\n<p>On the Device Manager, you can also check which COM port is being used by the device. In our case, it is <strong>COM3<\/strong>.<\/p>\n\n\n\n<p>Now, edit the file to add the <strong>Silicon Labs<\/strong> manufacturer (or other) to the <span class=\"rnthl rntliteral\">autoconnect_comport_manufacturers<\/span> section. Then, save the file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"autoconnect_comport_manufacturers\": &#091;\n  \"Pycom\",\n  \"Pycom Ltd.\",\n  \"FTDI\",\n  \"Microsoft\",\n  \"Microchip Technology, Inc.\",\n<strong>  \"Silicon Labs\"\n<\/strong>]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Selecting the COM port<\/h3>\n\n\n\n<p>After saving the file with the previous settings, you also need to set the COM port your board is connected to. Pymakr has the ability to automatically find your COM port (it may not work for some users).<\/p>\n\n\n\n<p>For automatic connect, let the <span class=\"rnthl rntliteral\">address<\/span> setting empty, and set the <span class=\"rnthl rntliteral\">auto_connect<\/span> to <span class=\"rnthl rntliteral\">true<\/span>. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"address\": \"\",<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\"auto_connect\": true,<\/code><\/pre>\n\n\n\n<p>In my case, it was able to detect the COM port automatically (a \u2713 shows up next to the Pymakr Console button).<\/p>\n\n\n\n<p>If your board doesn&#8217;t connect automatically, you need to change the <span class=\"rnthl rntliteral\">address<\/span> section with the COM port of your board. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"address\": \"<strong>COM3<\/strong>\",<\/code><\/pre>\n\n\n\n<p>To find the board COM port, you can click on <strong>All Commands<\/strong> and select <strong>Pymakr <\/strong>&gt; <strong>Extra <\/strong>&gt; <strong>List Serial Ports<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"417\" height=\"351\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-extra-list-serial-ports.png?resize=417%2C351&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"pymakr extra list serial ports\" class=\"wp-image-103272\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-extra-list-serial-ports.png?w=417&amp;quality=100&amp;strip=all&amp;ssl=1 417w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-extra-list-serial-ports.png?resize=300%2C253&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 417px) 100vw, 417px\" \/><\/figure><\/div>\n\n\n\n<p>To use a predefined COM port, you also need to set the <span class=\"rnthl rntliteral\">auto_connect<\/span> parameter to <span class=\"rnthl rntliteral\">false<\/span>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"auto_connect\": <strong>false<\/strong>,<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"582\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-configuration-file-connection-settings-select-com-port.png?resize=490%2C582&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Edit configure Micrpython Pymakr pymark.json config file\" class=\"wp-image-103097\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-configuration-file-connection-settings-select-com-port.png?w=490&amp;quality=100&amp;strip=all&amp;ssl=1 490w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-configuration-file-connection-settings-select-com-port.png?resize=253%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 253w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure><\/div>\n\n\n\n<p>Save the <span class=\"rnthl rntliteral\">pymakr.json<\/span> configuration file (<strong>CTRL<\/strong>+<strong>S<\/strong>).<\/p>\n\n\n\n<p>After saving the file, Pymakr will automatically detect your board (a \u2713 will show up next to the Pymakr Console button). If that doesn&#8217;t happen, toggle the <strong>Pymakr Console<\/strong> button to try to do it manually. If nothing happens, we recommend restarting VS Code.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"145\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/board-connected-Pymakr-micropython-vs-code.png?resize=782%2C145&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Pymakr pymark.json console window terminal connecting\" class=\"wp-image-103085\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/board-connected-Pymakr-micropython-vs-code.png?w=782&amp;quality=100&amp;strip=all&amp;ssl=1 782w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/board-connected-Pymakr-micropython-vs-code.png?resize=300%2C56&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/board-connected-Pymakr-micropython-vs-code.png?resize=768%2C142&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 782px) 100vw, 782px\" \/><\/figure><\/div>\n\n\n\n<p>Type <span class=\"rnthl rntliteral\">help()<\/span> on the Terminal window after the prompt (<span class=\"rnthl rntliteral\">&gt;&gt;&gt;<\/span>) and see your board responding:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>help()<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"837\" height=\"715\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-ESP32-help-command-terminal.png?resize=837%2C715&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Pymakr pymark.json console window terminal help run commands\" class=\"wp-image-103086\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-ESP32-help-command-terminal.png?w=837&amp;quality=100&amp;strip=all&amp;ssl=1 837w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-ESP32-help-command-terminal.png?resize=300%2C256&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/pymakr-ESP32-help-command-terminal.png?resize=768%2C656&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 837px) 100vw, 837px\" \/><\/figure><\/div>\n\n\n\n<p>That&#8217;s it! Pymakr was successfully installed on VS Code and you successfully connected a MicroPython device. Follow the next section to learn how to create, save and upload a project to your board.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"project\">ESP32\/ESP8266 Creating a MicroPython Project on VS Code + Pymakr<\/h2>\n\n\n\n<p>Follow this section to learn how to create a MicroPython Project on VS Code using Pymakr to program your ESP32 and ESP8266 boards. As an example, we&#8217;ll upload a code to blink the on-board LED (GPIO 2).<\/p>\n\n\n\n<p>1) First, connect an ESP32 or ESP8266 board with micropython firmware installed to your computer.<\/p>\n\n\n\n<p>2) Create a folder for your project. For example: <span class=\"rnthl rntliteral\"><em>blink<\/em><\/span>.<\/p>\n\n\n\n<p>3) Open VS Code. Pymakr will automatically try to connect to your board. If it doesn&#8217;t do that, go to the <strong>Extensions <\/strong>menu and open the Pymakr extension. Additionally, double-check that you&#8217;ve edited the <span class=\"rnthl rntliteral\">pymakr.json<\/span> file with the right configurations to connect to your board. See <a href=\"#connecting\" title=\"#connecting\">Connecting a MicroPython Device to Pymakr<\/a>.<\/p>\n\n\n\n<p>4) Then, go to <strong>File <\/strong>&gt; <strong>Open Folder<\/strong> and select the folder you&#8217;ve just created. Every MicroPython project should have two files: <em>main.py<\/em> and <em>boot.py<\/em>. Create those files in the project folder:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"530\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-project-pymakr-boot-main.png?resize=825%2C530&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Visual Studio editor edit files\" class=\"wp-image-103093\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-project-pymakr-boot-main.png?w=825&amp;quality=100&amp;strip=all&amp;ssl=1 825w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-project-pymakr-boot-main.png?resize=300%2C193&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/MicroPython-project-pymakr-boot-main.png?resize=768%2C493&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>boot.py<\/strong>: runs when the device starts and sets up several configuration options;<\/li><li><strong>main.py<\/strong>: this is the main script that contains your code. It is executed immediately after the<em>&nbsp;boot.py<\/em>.<\/li><\/ul>\n\n\n\n<p>In this section, we&#8217;ll upload a simple code that blinks the on-board LED. For this reason, you don&#8217;t need to copy anything to the <em>boot.py<\/em> file.<\/p>\n\n\n\n<p>Copy the following code to the <em>main.py<\/em> file. It blinks the on-board LED every half a second.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-python\"># Complete project details at https:\/\/RandomNerdTutorials.com\/micropython-programming-with-esp32-and-esp8266\/\n\nfrom machine import Pin\nfrom time import sleep\n\nled = Pin(2, Pin.OUT)\n\nwhile True:\n  led.value(not led.value())\n  sleep(0.5)\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/ESP-MicroPython\/raw\/master\/code\/Blink_LED\/Blink_LED.py\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>Save the file (<strong>CTRL<\/strong>+<strong>S<\/strong>).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"530\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/blink-LED-pymakr-vs-code-esp32-esp8266.png?resize=825%2C530&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Visual Studio editor edit main file\" class=\"wp-image-103095\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/blink-LED-pymakr-vs-code-esp32-esp8266.png?w=825&amp;quality=100&amp;strip=all&amp;ssl=1 825w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/blink-LED-pymakr-vs-code-esp32-esp8266.png?resize=300%2C193&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/blink-LED-pymakr-vs-code-esp32-esp8266.png?resize=768%2C493&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/figure><\/div>\n\n\n\n<p>Then, click on the <strong>Upload <\/strong>button. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"82\" height=\"25\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Pymakr-upload-command.png?resize=82%2C25&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code Visual Studio Upload files\" class=\"wp-image-103088\"\/><\/figure><\/div>\n\n\n\n<p>It will upload the code to the board and automatically restart the board to start running the code. <\/p>\n\n\n\n<p>The ESP32 or ESP8266 on-board LED should be blinking.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/04\/ESP32-board-Built_in-LED-turned-on-HIGH.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 board Built in LED turned on HIGH\" class=\"wp-image-96167\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/04\/ESP32-board-Built_in-LED-turned-on-HIGH.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/04\/ESP32-board-Built_in-LED-turned-on-HIGH.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p class=\"rntbox rntcred\"><strong>Important: <\/strong> the <strong>Run <\/strong>command runs the code without uploading the code to the board. This means that the code will only run as long as it is connected to the computer. To upload code to the board, you should select the <strong>Upload <\/strong>option.<\/p>\n\n\n\n<p>To make further changes (uploading a new code), press <strong>CTRL<\/strong>+<strong>C<\/strong> to stop any running code. You won&#8217;t be able to upload new code if the ESP is running another code. <\/p>\n\n\n\n<p>You also won&#8217;t be able to execute any other commands while the board is running a code. If the prompt (<span class=\"rnthl rntliteral\">&gt;&gt;&gt;<\/span>) is not displayed, it means the board is running a code. Press CTRL+C to stop running the code, and the prompt (<span class=\"rnthl rntliteral\">&gt;&gt;&gt;<\/span>) will show up. After that, you can execute commands.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Disable\/Hide Pymakr Extension<\/h2>\n\n\n\n<p>When you&#8217;re not using Pymakr, it can be useful to disable\/hide the Pymakr commands at the bottom bar. This is especially useful if you&#8217;re programming the ESP boards using the PlatformIO extension. Having both extensions enabled at the same time can cause issues uploading the code and connecting to the board.<\/p>\n\n\n\n<p>To hide the Pymakr commands, you need to go <strong>Extensions<\/strong> and search for the <strong>Pymakr<\/strong> extension on the installed extensions. Then, click on <strong>Disable<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"536\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/disable-pymakr-extension-vs-code.jpg?resize=900%2C536&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Disable Pymakr extension plugin VS Code\" class=\"wp-image-103257\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/disable-pymakr-extension-vs-code.jpg?w=900&amp;quality=100&amp;strip=all&amp;ssl=1 900w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/disable-pymakr-extension-vs-code.jpg?resize=300%2C179&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/disable-pymakr-extension-vs-code.jpg?resize=768%2C457&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure><\/div>\n\n\n\n<p>Restart VS Code for the changes to take effect. The next time you want to use the Pymakr extension, you need to enable the extension again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial, you&#8217;ve learned how to use VS Code with the Pymakr extension to program your ESP32 and ESP8266 using MicroPython. This is a great option, especially for those already used to program the ESP boards using VS Code. We also recommend reading the official notes and instructions of the Pymakr extension <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=pycom.Pymakr\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>We hope you found this tutorial useful. What&#8217;s next? To get started programming with MicroPython, we recommend the following tutorials:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/micropython-programming-basics-esp32-esp8266\/\">MicroPython Programming Basics with ESP32 and ESP8266<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/micropython-gpios-esp32-esp8266\/\">MicroPython with ESP32 and ESP8266: Interacting with GPIOs<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-esp8266-micropython-web-server\/\">ESP32\/ESP8266 MicroPython Web Server<\/a><\/li><\/ul>\n\n\n\n<p>Learn more about MicroPython with our resources:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/micropython-programming-with-esp32-and-esp8266\/\">MicroPython Programming with ESP32 and ESP8266 eBook<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/projects-esp32-esp8266-micropython\/\">More MicroPython projects&#8230;<\/a><\/li><\/ul>\n\n\n\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you&#8217;ll learn how to program your ESP32 and ESP8266 boards with MicroPython using VS Code Editor (Visual Studio Code) with the Pymakr extension. If you&#8217;re used to &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"MicroPython: Program ESP32\/ESP8266 using VS Code and Pymakr\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/micropython-esp32-esp8266-vs-code-pymakr\/#more-103070\" aria-label=\"Read more about MicroPython: Program ESP32\/ESP8266 using VS Code and Pymakr\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":103099,"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":[310,309,264],"tags":[],"class_list":["post-103070","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-micropython","category-0-esp32-micropython","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/Program-ESP32-ESP8266-Boards-MicroPython-using-VS-Code-Pymakr.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/103070","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=103070"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/103070\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/103099"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=103070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=103070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=103070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}