1.  Install CP201x drivers (Links to an external site.)Links to an external site. for your machine.
  2.  pip install pyserial
  3.  pip install esptool
  4. The MicroPython firmware (Links to an external site.)Links to an external site. Get version esp8266-20170612-v1.9.1.bin.
  5. Clone  the MicroPython WebREPL (Links to an external site.)Links to an external site.
  6. A micro USB cable.

If you get a permission error while running `pip install …` then try `sudo pip install …` if you’re on Linux or Mac.

Instructions

Not shown: connect the board to your computer using the micro USB cable.

Also note:

  1. The WiFi password when you connect to the MicroPython access point is “micropythoN”.
  2. The password for the WebREPL is “password”, or whatever you chose during the “import webrepl_setup” sequence.
  3. When you connect to the MicroPython access point, your computer may complain that it is unable to access the internet through this connection. On Windows this is represented by a yellow triangle exclamation mark. This is expected: you aren’t able to access the internet while connected to the board because the board isn’t connected to the internet.
  4. The address that is automatically provided in the WebREPL page (ws://192.168.4.1:8266) is correct.

 

My Steps

$ python -m serial.tools.list_ports
……..
/dev/cu.SLAB_USBtoUART
3 ports found

$ esptool.py –port /dev/cu.SLAB_USBtoUART erase_flash
esptool.py v2.3.1
Connecting…….._
Detecting chip type… ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub…
Running stub…
Stub running…
Erasing flash (this may take a while)…
Chip erase completed successfully in 7.7s
Hard resetting via RTS pin…

$ esptool.py –port /dev/cu.SLAB_USBtoUART –baud 460800 write_flash –flash_size=detect -fm dio 0 esp8266-20170612-v1.9.1.bin
esptool.py v2.3.1
Connecting…….._
Detecting chip type… ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub…
Running stub…
Stub running…
Changing baud rate to 460800
Changed.
Configuring flash size…
Auto-detected Flash size: 4MB
Flash params set to 0x0240
Compressed 598432 bytes to 390605…
Wrote 598432 bytes (390605 compressed) at 0x00000000 in 9.0 seconds (effective 529.1 kbit/s)…
Hash of data verified.

Leaving…
Hard resetting via RTS pin…

$ screen /dev/tty.SLAB_USBtoUART 115200

>>> import webrepl_setup
WebREPL daemon auto-start status: disabled

Would you like to (E)nable or (D)isable it running on boot?
(Empty line to quit)
>>> e
To enable WebREPL, you must set password for it
New password: *************
Confirm password:*************
Changes will be activated after reboot
Would you like to reboot now? (y/n) y

>>> ……
WebREPL daemon started on ws://192.168.4.1:8266/
Started webrepl in normal mode
…..

MicroPython v1.9.1-8-g7213e78d on 2017-06-12; ESP module with ESP8266
Type “help()” for more information.

  1. connect to micropython wifi
    micropython-0f1b83
    micropythoN
  2. go to webrepl.html – ws://192.168.4.1:8266/

In the browser (make the light blink !!!)

Welcome to MicroPython!
>>> Password:
WebREPL connected
>>> import machine
>>> pin = machine.Pin(16, machine.Pin.OUT)
>>> pin.value(0)
>>> pin.value(1)