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.
 
 
 
 
 
 
Damien George 7e1f580910 esp8266: Enable uerrno module, weak linked also as errno. 9 years ago
..
scripts esp8266/scripts/webrepl: Add start_foreground() method. 9 years ago
Makefile esp8266/Makefile: Be sure to pass cross-compiling AR when building axtls. 9 years ago
README.md esp8266/README: Mention WebREPL. 9 years ago
axtls_helpers.c esp8266/axtls_helpers: Helper/wrapper functions for axTLS. 9 years ago
eagle.rom.addr.v6.ld esp8266: Switch integer arith routines to BootROM. 9 years ago
esp8266.ld esp8266/esp8266.ld: Put axTLS to FlashROM. 9 years ago
esp_mphal.c esp8266/esp_mphal: Add ets_esf_free_bufs(), etc. functions. 9 years ago
esp_mphal.h esp8266/esp_mphal: Add ets_esf_free_bufs(), etc. functions. 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
esponewire.c esp8266: Separate 1-wire timing funcs from Python module to save iRAM. 9 years ago
esponewire.h esp8266: Separate 1-wire timing funcs from Python module to save iRAM. 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: Comment out debug output. 9 years ago
ets_alt_task.h esp8266: Add alternative event loop implementation. 9 years ago
etshal.h esp8266/modesp: Add malloc() and free() 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
help.c esp8266/help: Add "sta_if.active(True)" command. 9 years ago
intr.c esp8266: Add hard IRQ callbacks for pin change on GPIO0-15. 9 years ago
lexerstr32.c esp8266: Store frozen modules in FlashROM. 9 years ago
main.c esp8266/main: Bump heap size to 28K. 9 years ago
makeimg.py esp8266: Minimize gap between Inst/DataRAM segments and FlashROM segment. 9 years ago
modesp.c esp8266: Convert to use new MP_Exxx errno symbols. 9 years ago
modmachine.c py: Move call_function_*_protected() functions to py/ for reuse. 9 years ago
modnetwork.c esp8266: Convert to use new MP_Exxx errno symbols. 9 years ago
modonewire.c esp8266: Separate 1-wire timing funcs from Python module to save iRAM. 9 years ago
modpyb.c esp8266: Move pyb.info() function to esp module and remove pyb module. 9 years ago
modpyb.h esp8266: Move pyb.info() function to esp module and remove pyb module. 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
modpybpin.c esp8266/modpybpin: Make pin.irq() methods take keyword args. 9 years ago
modpybpwm.c esp8266: Remove pin_id field from C pin object. 9 years ago
modpybrtc.c esp8266: Implement basic deep-sleep capabilities. 9 years ago
modpybrtc.h esp8266: Implement basic deep-sleep capabilities. 9 years ago
modpybspi.c esp8266: Convert to use new MP_Exxx errno symbols. 9 years ago
modpybuart.c esp8266: Convert to use new MP_Exxx errno symbols. 9 years ago
moduos.c esp8266: Convert to use new MP_Exxx errno symbols. 9 years ago
modutime.c esp8266/modutime: Support float argument to time.sleep(). 9 years ago
mpconfigport.h esp8266: Enable uerrno module, weak linked also as errno. 9 years ago
qstrdefsport.h esp8266/main: Set sys.path to ["", "/", "/lib"]. 9 years ago
strtoll.c esp8266: Change bignum from mpz to longlong; move some rodata to iram. 10 years ago
uart.c esp8266/uart: Remove obsolete UART rx buffering code. 9 years ago
uart.h esp8266: Add uart_rx_wait and uart_rx_char functions. 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

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.
  • WiFi support.
  • Sockets using modlwip.
  • GPIO and bit-banging I2C, SPI support.
  • 1-Wire and WS2812 (aka Neopixel) protocols support.
  • Internal filesystem using the flash.
  • WebREPL over WiFi from a browser (clients at https://github.com/micropython/webrepl).

Work-in-progress documentation is available at http://docs.micropython.org/en/latest/esp8266/ .

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. Read esp-open-sdk's README for additional important information on toolchain setup.

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 axtls
$ make

This will produce binary images in the build/ subdirectory. If you install MicroPython to your module for the first time, or after installing any other firmware, you should erase flash completely:

esptool.py --port /dev/ttyXXX erase_flash

Erase flash also as a troubleshooting measure, if a module doesn't behave as expected.

To flash MicroPython image 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 mode, 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 image produced is firmware-combined.bin, to be flashed at 0x00000.

Troubleshooting

While the port is still in alpha, it's known to be generally stable. If you experience strange bootloops, crashes, lockups, here's a list to check against:

  • You didn't erase flash before programming MicroPython firmware.
  • Firmware can be occasionally flashed incorrectly. Just retry. Recent esptool.py versions have --verify option.
  • Power supply you use doesn't provide enough power for ESP8266 or isn't stable enough.
  • A module/flash may be defective (not unheard of for cheap modules).

Please consult dedicated ESP8266 forums/resources for hardware-related problems.