Getting started with NodeMCU ESP8266 using Micropython on Windows 10.

nodemcu Oct 02, 2019

The NodeMCU is a development board featuring the popular ESP8266 WiFi chip. As it turns out, you can program the ESP8266 just like any other microcontroller. Its obvious advantage over the Arduino or PIC is that it can readily connect to the Internet via WiFi.

MicroPython is a re-implementation of Python 3 targeted for microcontrollers and embedded systems. MicroPython is very similar with regular Python. So, if you already know how to program in Python, you also know how to program in MicroPython.

PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language.

PuTTY  is a free and open-source terminal emulator, serial console and network file transfer application. It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. It can also connect to a serial port.

MicroPython Board Supports

Boards supported by MicroPython
  • ESP32 , ESP8266, PyBoard, Micro:Bit, Teensy 3.X, WiPy – Pycom, Adafruit, Circuit Playground Express
  • Other ESP32/ESP8266 based boards

Steps to be followed in sequence on windows devices

1. Install Python On windows 10

 Visit https://www.python.org/ and download the latest version of python for       windows and install it on your machine.

Note:  1. Do not forget to check the add to path button while installing on you                   machine

 2. Install only Python Version 3 on your machine.

2. Install ESPTool

Use your Windows Powershell to complete this step and using the command below.

pip install esptool

3. Download ESP8266 firmware

Visit https://micropython.org/download  and download the latest version of ESP8266 bin file for windows and install it on your machine.

4. Plug in Device

Now plug in your NodeMCU 8266 device using a USB wire in to your machine and go to the next step after confirming that its properly plugged in by visiting     windows device manager.

Remember the port number mentioned , it will be used in next steps.

Note:- If your USB device does not have been assigned any port number  then try to update the driver of your device attached.

5. Erase Flash

Use the command below to erase flash in your powershell.

esptool.py -p com3 -c esp8266 -b 460800 erase_flash

6. Execute upload command

Use the command below to upload bin file in your powershell.

esptool.py -p com3 -c esp8266 -b 460800 write_flash --flash_size=detect 0 '..\..\Users\Deep Narayan Tandan\Desktop\esp8266-20190529-v1.11.bin'

7. Test with Putty

Go to https://www.putty.org/ and download the windows version and install it.

Now install it and open the program and follow these steps.

Click on Open button or press Enter and you will be given access to MicroPython Terminal.


Voila, you are set and ready to go and explore the MicroPython World.

Happy Coding :)


Note:

Please do let us know if we are missing any topic or you want us to elaborate any topic, comment below and subscribe to be updated.