You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Paul Sokolovsky 2f02302e22 esp8266: Support importing modules from filesystem. 9 years ago
..
scripts esp8266: Add support for frozen modules 10 years ago
tests esp8266/tests: Add neopixel.py test. 9 years ago
Makefile esp8266: deploy: Use --flash_size=8m option to esptool.py. 9 years ago
README.md esp8266/README: Update for the current status of the port. 9 years ago
eagle.rom.addr.v6.ld esp8266: Add alternative event loop implementation. 9 years ago
esp8266.ld esp8266/esp8266.ld: Put FatFs to FlashROM. 9 years ago
esp_mphal.c esp8266: Make mp_hal_delay_us work with new event framework. 9 years ago
esp_mphal.h esp8266/esp_mphal: Add higher-level event polling function. 9 years ago
espneopixel.c esp8266: Add esp.neopixel_write function to bit-bang WS2812 data. 9 years ago
espneopixel.h esp8266: Add esp.neopixel_write function to bit-bang WS2812 data. 9 years ago
esppwm.c esp8266/esppwm.c: Fix IRQ handler prototype. 9 years ago
esppwm.h esp8266: Add PWM support. 9 years ago
ets_alt_task.c esp8266/ets_alt_task: Make FIRST_PRIO=0 to cover all task priorities. 9 years ago
ets_alt_task.h esp8266: Add alternative event loop implementation. 9 years ago
etshal.h esp8266/etshal.h: More prototypes of ESP8266 SDK/BootROM functions. 9 years ago
fatfs_port.c esp8266: Enable FatFs support. 9 years ago
gccollect.c esp8266: Don't gc-collect BSS. 9 years ago
gccollect.h esp8266: Fix garbage collector by hard-coding stack end address. 10 years ago
gchelper.s esp8266: New port of Micro Python to ESP8266 wifi module. 10 years ago
lexerstr32.c esp8266: Store frozen modules in FlashROM. 9 years ago
main.c esp8266: Support importing modules from filesystem. 9 years ago
makeimg.py esp8266: New port of Micro Python to ESP8266 wifi module. 10 years ago
modesp.c esp8266/modesp: flash_read(): Accept buffer to read to as a second argument. 9 years ago
modmachine.c esp8266: Link ADC class into machine module. 9 years ago
modnetwork.c esp8266/modnetwork: Add symbolic names for network interfaces: STA_IF & AP_IF. 9 years ago
modonewire.c esp8266: Add onewire helper functions as C module. 9 years ago
modpyb.c esp8266: Move pyb.freq to machine.freq. 9 years ago
modpyb.h esp8266: Add PWM support. 9 years ago
modpybadc.c py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*. 9 years ago
modpybi2c.c esp8266: Implement bit-bang I2C read, and add i2c.readfrom method. 9 years ago
modpybpin.c esp8266: Expose pin object as a public structure for use as C pin API. 9 years ago
modpybpwm.c esp8266: Add PWM support. 9 years ago
modpybrtc.c esp8266: Reset "virtual RTC" on power on. 9 years ago
modpybrtc.h esp8266: Add utime and pyb.RTC 10 years ago
modpybspi.c esp8266: Implement software SPI class. 9 years ago
moduos.c esp8266/moduos: Add os.remove(), proxying to VFS object. 9 years ago
modutime.c esp8266/modutime: Support float argument to time.sleep(). 9 years ago
mpconfigport.h esp8266: Enable FatFs support. 9 years ago
qstrdefsport.h esp8266: Add esp.neopixel_write function to bit-bang WS2812 data. 9 years ago
strtoll.c esp8266: Change bignum from mpz to longlong; move some rodata to iram. 10 years ago
uart.c esp8266/uart: Add uart_flush() function. 9 years ago
uart.h esp8266/uart: Add uart_flush() function. 9 years ago
uart_register.h esp8266: New port of Micro Python to ESP8266 wifi module. 10 years ago
user_config.h esp8266: New port of Micro Python to ESP8266 wifi module. 10 years ago
utils.c esp8266: Add esp.socket class, with ESP-style socket functionality. 10 years ago
utils.h esp8266: Add esp.socket class, with ESP-style socket functionality. 10 years ago

README.md

MicroPython port to ESP8266

This is a highly experimental port of MicroPython for the WiFi modules based on Espressif ESP8266 chip.

WARNING: The port is highly experimental and any APIs are subject to change.

Currently implemented features include:

  • REPL (Python prompt) over UART0.
  • Garbage collector, exceptions.
  • Unicode support.
  • Builtin modules: gc, array, collections, io, struct, sys, esp, network, many more.
  • Arbitrary-precision long integers and 30-bit precision floats.
  • Basic WiFi support.
  • Sockets using modlwip.
  • GPIO and bit-banging I2C, SPI support.
  • 1-Wire and WS2812 (aka Neopixel) protocols support.

On the TODO list:

  • Full wifi support.
  • Internal filesystem using the flash.
  • ...

Build instructions

The tool chain required for the build is the OpenSource ESP SDK, which can be found at https://github.com/pfalcon/esp-open-sdk. Clone this repository and run make in its directory to build and install the SDK locally. Make sure to add toolchain bin directory to your PATH.

Add the external dependencies to the MicroPython repository checkout:

$ git submodule update --init

See the README in the repository root for more information about external dependencies.

Then, to build MicroPython for the ESP8266, just run:

$ cd esp8266
$ make

This should produce binary images in the build/ subdirectory. To flash them to your ESP8266, use:

$ make deploy

This will use the esptool.py script to download the images. You must have your ESP module in the bootloader, and connected to a serial port on your PC. The default serial port is /dev/ttyACM0. To specify another, use, eg:

$ make PORT=/dev/ttyUSB0 deploy

The images that are built are:

  • firmware.elf-0x00000.bin: to be flashed at 0x00000
  • firmware.elf-0x10000.bin: to be flashed at 0x10000

There is also a combined image, made up of the above 2 binary files with the appropriate padding:

  • firmware-combined.bin: to be flashed at 0x00000