MicroPython on ESP8266
This is an example post, extracted from my
OneNote Notebook with specifics on getting micropython working on
Please excuse any typos below… there
are my notes after all, and I only am publishing them as an example of
what is possible with OneNote.
on Esp8266 Tutorial
Wemos D1 with esp8266MOD
WROOM v2 (aka ESP-13, aka ESP8266MOD
With 4MB SPI flash
wemos d1 pro
module, 16M SPI flash
Install / load / reinstall micropython on
the Wemos D1
Install the driver-
The wemos d1 uses a cheap
installing python on pc, need to install python and then use the
ESPtool to install or reflash / update the firmware to the wemos d1. it
may ship with NODEMCU or AT commands.
help using python pip install and packages
This guide uses 2.7 as of the writing of this install. This is
installed on the PC you are using. Do not use python 3 .
Make sure that it installs / registers itself in the local path so that
you can use the reguar “cmd” prompt. Else it might cause issues.
If things don’t work restart.
open the python command line
esptool from the python command line.
If this command does not work, then you need to figure out how to get
are the esptool github details if you need to do it manually, or refer
hex dump file using a hex capable editor (notepad++ with hex edit
method… use the GUI for esp8266
use nodemcu-flasher (https://github.com/nodemcu/nodemcu-flasher)
the esp8266, install image.
From windows Cmd prompt
(optional… dum it again and verify the memory is all ff ff ff ff)
to see if it installed.
Check device manager for com port – Open com port
Open Putty (serial / console software) settings
Connect using (usb) serial console
115200 / 8 / no parity /1 stop/no flow ctl
show up on wifi. Don’t connect yet.
will now be using the Putty Terminal to type commands.
This is called the REPL (Read Execute Python Language)
Once you open the connection:
Hit the Enter key at the cursor and wait for the prompt >>>
Try the hello world program
If the last output value is True, the firmware is OK. Otherwise, it’s
lets set up WEBREPL so that we can do this from a browser
After a fresh install and boot the device configures itself as a WiFi
Wifi connection of the device is
There is no webpage. It will go nowhere. You can only connect by
we install the webrepl client on your Computer.
Here is an example of what it would look like once installed. You could
use this if your computer is hard wired or connected to the same wifi.
Otherwise, we will install this on your local machine.
Install it locally using this link
Extract the files to a folder
Open the html file
Click the connect button
Enter the password you setup earlier of the serial console
with the simple LED on the board
cannot simply copy and paste code into the repl console. It will throw
To enter a special “paste mode” hit
This will allow you to paste in chunks of text.
Use CTRL D
to exit this mode and execute the code as entered
code you enter at the REPL does not persist past reboot unless you save
it to a file. Say for example the entered the led toggle code above.
After unplugging and re-pugging in the code, you cant call the toggle
function. If you have your board connected over serial and hot the
reset button, you will see it reload in the console window.
To have your code persist, you would need to start creating files to
make the code permanent.
To view the files on the esp8266 , type the following:
Additionally, you can upload a file from your computer using the
all available commands