<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ ESP8266 - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ ESP8266 - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sun, 26 Jul 2026 16:39:00 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/esp8266/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to get started with FreeRTOS and ESP8266 ]]>
                </title>
                <description>
                    <![CDATA[ By Denis Nuțiu Recently, I purchased a NodeMCU from AliExpress for about $4. The reason I did this was to find out what all the fuss is about with ESP8266. NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi S... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-get-started-with-freertos-and-esp8266-7a16035ddd71/</link>
                <guid isPermaLink="false">66c35249bc39b1419091be4b</guid>
                
                    <category>
                        <![CDATA[ Electronics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ESP8266 ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ wifi ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sat, 03 Feb 2018 15:57:54 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*2fa1eXR1ZEeWUA54bbY3Ag.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Denis Nuțiu</p>
<p>Recently, I purchased a NodeMCU from AliExpress for about $4. The reason I did this was to find out what all the fuss is about with ESP8266.</p>
<p>NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP-12 module.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/WWQgoFxzsaqMPtrLF33j93TOcM5hBstHKqON" alt="Image" width="800" height="414" loading="lazy">
<em>Source: ESP8266 Datasheet</em></p>
<p>Compared to the Arduino UNO, my ESP8266 totally knocks it out of the park when it comes to CPU power and price.</p>
<p>The ESP8266 is 500% faster and 82% cheaper than the Arduino. The ESP8266 also has WiFi connectivity.</p>
<p>I was very surprised when I visited the <a target="_blank" href="https://www.espressif.com/en/products/hardware/esp8266ex/overview">Espressif website</a> for the ESP8266. There’s lots of documentation and resources that you can use. For example, there’s an Android application which tells your ESP8266 to connect to your WiFi. The app sends the SSID and password as packets, the ESP8266 sniffs them, and then it connects to your WiFi. This is called SmartConfig, and was invented by Texas Instruments.</p>
<p>In this article, I will guide you to setup and run the Smart Config example from the Espressif RTOS SDK.</p>
<h4 id="heading-heres-the-things-youll-need">Here’s the things you’ll need:</h4>
<ul>
<li>A modern computer.</li>
<li>A NodeMCU board with ESP12-E</li>
<li>VirtualBox (<a target="_blank" href="https://www.virtualbox.org/wiki/Downloads">https://www.virtualbox.org/wiki/Downloads</a>)</li>
<li>Ubuntu Server LTS (<a target="_blank" href="https://www.ubuntu.com/download/server">https://www.ubuntu.com/download/server</a>)</li>
</ul>
<h3 id="heading-configuring-virtualbox-for-development">Configuring VirtualBox for development</h3>
<ol>
<li>Download VirtualBox and install Ubuntu Server. This should be easy to do, but if you don’t know how, Google it or have a look at this graphic <a target="_blank" href="https://dalanzg.github.io/tips-tutorials/ubuntu/2016/04/15/install-ubuntu-server-on-virtualbox/">step by step guide</a>. Installing an OS is a nice skill to have. <em>(Tip: When VirtualBox prompts you to select the disk, make it dynamically allocated and at least 50GB in size. This will save you some headaches further down the line.)</em></li>
<li>Make sure that you can access the internet from within the virtual machine and configure the DNS server:</li>
</ol>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1VXQI9xykHzqgT9nDFIjTeUU5M0GasTMjVkS" alt="Image" width="800" height="562" loading="lazy">
<em>Right click the machine then Settings -&gt; Network</em></p>
<p>To configure the DNS server, have a look at this <a target="_blank" href="https://askubuntu.com/questions/346838/how-do-i-configure-my-dns-settings-in-ubuntu-server">example</a>.</p>
<blockquote>
<p>Example: <code>dns-nameservers 8.8.8.8 8.8.4.4</code> If you can ping Google, then you’re good to go!</p>
</blockquote>
<ol start="3">
<li><p>(Optional) Install <a target="_blank" href="https://help.ubuntu.com/lts/serverguide/openssh-server.html">OpenSSH</a> and <a target="_blank" href="https://help.ubuntu.com/lts/serverguide/samba-fileserver.html">Samba</a> server. This will make your life much easier.</p>
</li>
<li><p><strong>(Optional)</strong> Enable port forwarding. In order to SSH directly into your virtual machine, you need to enable port forwarding. For example, to map the <strong>port 2222</strong> on your <strong>host machine</strong> to the <strong>port 22</strong> of your <strong>virtual machine</strong>.</p>
</li>
</ol>
<p><img src="https://cdn-media-1.freecodecamp.org/images/vxD8ttK0h7T3Rqr9-wsA0dEXaizQ84Zdc9CX" alt="Image" width="800" height="621" loading="lazy">
<em>Enable Port forwarding: Settings -&gt; Network <strong>-&gt; Port Forw</strong>arding</em></p>
<p>If you have enabled port forwarding, you can now SSH into your virtual machine from your Host machine as in the figure below.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/iZh3PIg0ZdEnaSqoCvfa8us076gknELpRYRX" alt="Image" width="800" height="631" loading="lazy">
<em>FIG1: ssh -p 2020 denis@localhost</em></p>
<p>Note: If you’re on Windows, you need <strong>Putty</strong> in order to SSH into the virtual machine.</p>
<ol start="5">
<li>Plug in your NodeMCU and execute the following command:</li>
</ol>
<p><code>tail -f /var/log/kern.log</code></p>
<p>This should reveal to you that the device has been identified as /dev/ttyUSB0. If nothing happens, then you need to add the USB to the virtual machine. After adding the USB, unplug and plug your device in again.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/rBbsqsBd84y-dgnFeS6phDTXlM-tOCaXyPiU" alt="Image" width="800" height="583" loading="lazy">
<em>Adding USB: Settings -&gt; Ports -&gt; USB</em></p>
<p>If you’ve reached this point and every thing is working, <strong>congratulations</strong>! You’re now ready to compile the SDK and run the SmartConfig example. You can even shoot me a tweet at <a target="_blank" href="https://twitter.com/metonymyqt">https://twitter.com/metonymyqt</a></p>
<h3 id="heading-compiling-the-sdk-and-flashing-the-board"><strong>Compiling the SDK and flashing the board</strong></h3>
<ol>
<li>Install the required packages (as below). This info is also available on the SDK’s readme.md.</li>
</ol>
<pre><code>sudo apt-get install make unrar-free autoconf automake libtool gcc g++ gperf flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial sed git unzip bash help2man wget bzip2 libtool-bin
</code></pre><ol start="2">
<li><p>Create a new folder and navigate into it: <code>mkdir Development &amp;&amp; cd Development</code></p>
</li>
<li><p>Clone the Open SDK: <a target="_blank" href="https://github.com/pfalcon/esp-open-sdk">https://github.com/pfalcon/esp-open-sdk</a></p>
</li>
</ol>
<p><code>git clone --recursive https://github.com/pfalcon/esp-open-sdk.git</code></p>
<ol start="3">
<li>Run make: <code>make</code></li>
</ol>
<p><strong>Warning: This step will take a while to finish so please be patient.</strong> On my virtual machine it completed after 50 minutes. On yours it might take more or less, but before you run, make make sure that you’re <strong>connected to the internet</strong> and <strong>DNS is properly configured</strong>. The best way to check this is to execute a ping to Google or some other site if Google is blocked in your region.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/rqBC76LdfeK2PStc1YiC1RCFArzHF4IjXXdi" alt="Image" width="800" height="637" loading="lazy">
<em>Successful ping command: $ ping medium.com</em></p>
<p>If your ping is successful, you can minimize the windows and watch an episode of your favorite TV show. Come back after about 40 minutes (but make sure your computer doesn’t go to sleep).</p>
<p>After the SDK has been built successfully, you’ll see a message telling you to put something in your path. To do so, execute the following:</p>
<pre><code>echo <span class="hljs-string">'export PATH=/home/denis/Development/esp-open-sdk/xtensa-lx106-elf/bin:$PATH'</span> &gt;&gt; ~/.profile
</code></pre><p>The command will append the string to the <strong>~/.profile</strong> file. Now please run the following command:</p>
<p><code>xtensa-lx106-elf-gcc --version</code></p>
<p>If the command executes successfully, then you’re good to go!</p>
<ol start="4">
<li>Test your board</li>
</ol>
<p>Plug your NodeMCU and run <strong>lsusb</strong> to verify that your device is connected. After that, run <strong>esptool.py chip_id</strong>. You should now see the board’s chip id.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/lf0BJC2bys9XbFPVEzc0B9LsUGtw6dbJtoOl" alt="Image" width="800" height="467" loading="lazy">
_esptool.py chip<em>id</em></p>
<ol start="5">
<li>Clone <a target="_blank" href="https://github.com/espressif/ESP8266_RTOS_SDK">ESP8266_RTOS_SDK</a></li>
</ol>
<pre><code>git clone https:<span class="hljs-comment">//github.com/espressif/ESP8266_RTOS_SDK.git</span>
</code></pre><ol start="6">
<li>Export the SDK path and SDK/BIN path using the commands below.</li>
</ol>
<pre><code>echo <span class="hljs-string">'export SDK_PATH=/home/denis/Development/ESP8266_RTOS_SDK'</span> &gt;&gt; ~/.profile
</code></pre><pre><code>echo <span class="hljs-string">'export BIN_PATH=/home/denis/Development/ESP8266_RTOS_SDK/bin'</span> &gt;&gt; ~/.profile
</code></pre><ol start="7">
<li>Compile the SmartConfig example</li>
</ol>
<pre><code>cd /home/denis/Development/ESP8266_RTOS_SDK/examples/smart_config/
</code></pre><pre><code>chmod +x ./gen_misc.sh
</code></pre><pre><code>./gen_misc.sh
</code></pre><p>Now accept the default values until you’re asked for <strong>SPI_SIZE_MAP.</strong> This is where you select <strong>4</strong> because the NodeMCU has a flash size of 32Mbit and this translates to 4MB. _You can also select SPI<em>SPEED 3=80Mhz</em></p>
<p>You’ll see something like this:</p>
<pre><code>!!!SDK_PATH: <span class="hljs-regexp">/home/</span>denis/Development/ESP8266_RTOS_SDKBIN_PATH: <span class="hljs-regexp">/home/</span>denis/Development/ESP8266_RTOS_SDK/bin
</code></pre><pre><code>No boot needed.Generate eagle.flash.bin and eagle.irom0text.bin successully <span class="hljs-keyword">in</span> BIN_PATHeagle.flash.bin — — — →<span class="hljs-number">0x00000ea</span>gle.irom0text.bin — →<span class="hljs-number">0x20000</span>!!!
</code></pre><ol start="8">
<li>Flash the board</li>
</ol>
<pre><code>cd $BIN_PATH
</code></pre><pre><code>esptool.py erase_flash
</code></pre><pre><code>esptool.py write_flash <span class="hljs-number">0x00000</span> $BIN_PATH/eagle.flash.bin <span class="hljs-number">0x20000</span> $BIN_PATH/eagle.irom0text.bin <span class="hljs-number">0x3FC000</span> $BIN_PATH/esp_init_data_default.bin
</code></pre><p>Now, if you reset the board, you should see no LED blinking.</p>
<ol start="9">
<li><p>Use the Phone Application</p>
</li>
<li><p><a target="_blank" href="https://play.google.com/store/apps/details?id=com.cmmakerclub.iot.esptouch&amp;hl=en">Android Application</a></p>
</li>
<li><a target="_blank" href="https://itunes.apple.com/us/app/ti-wifi-smartconfig/id580969322?mt=8">iPhone Application</a></li>
</ol>
<p><img src="https://cdn-media-1.freecodecamp.org/images/xoDqT7zXJ7toeEl8Jm-ymdZQvmg7YnzeGwBM" alt="Image" width="800" height="1422" loading="lazy">
<em>ScreenShot from my Android Device</em></p>
<p>Open the Application, make sure that you’re connected to a WiFi AP, enter your password, and press confirm. After a few seconds the ESP8266 should connect to your AP. That’s it. Congratulations for reaching the end!</p>
<p>If you want to develop more using the ESP8266-RTOS-SDK, please visit the official websites. You’ll find a lot of resources and documentation there. Also, please take a look at the other examples found in the SDK folder.</p>
<p>Thank you very much for your time reading this. If you want to reach out to me, you can do so on Twitter: <a target="_blank" href="https://twitter.com/metonymyqt">MetonymyQT</a></p>
<h4 id="heading-resources">Resources</h4>
<ul>
<li><a target="_blank" href="https://www.espressif.com/en/products/hardware/esp8266ex/overview">ESP8266 Overview</a></li>
<li><a target="_blank" href="https://www.espressif.com/en/products/hardware/esp8266ex/resources">ESP8266 Resources</a></li>
<li><a target="_blank" href="https://www.freertos.org/">FreeRTOS Website</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
