espsetup

simplified setup up for esp8266 / esp32 device


Keywords
micropython, utility, shell, setup, esp, esp32, esp8266, automation, esptool, esptool-wrapper, installation, iot, tool
License
MIT
Install
pip install espsetup==0.0.6

Documentation

Code style: black

esp-setup

simplified setup for esp8266 / esp32 device

how it works

the tool discovers first the connected device type with esptool.py and searches then the available firmware bin files in your download folder. the search follows the naming convention of the micropython release (alphabetical sort).

after that it ask which to install.

optional you can erase flash before installing

cmd line

display all available cmd line options with

python3 -m espsetup.py --help
    
usage: espsetup [options]. 
            it's possible to pass custom parameters to esptool, such as
            "-fs 1MB -fm dout 0x0" (e.g. for a esp8266 board).
            the defaults are:
                esp8266: "-z 0x1000", and
                esp32: "--flash_size=detect 0".
            a single '-' will set this to ""
            any custom parameter at the end of the cmd-line
            will be passed over to esptool as specified.

setup an esp32/esp8266 device

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show version info and exit
  -s, --dry             simulate /dry run, only show cmd information
  -port PORT, -p PORT   port/device to use (default: /dev/ttyUSB0)
  -baud BAUD, -b BAUD   baud rate to use (default: 115200)
  -c {ask,y,yes,n,no}, -erase_flash {ask,y,yes,n,no}
                        erase_flash before installing (default: ['ask'])
  -r {ask,y,yes,n,no}, -run_cmd {ask,y,yes,n,no}
                        run final install cmd (default: ['ask'])
  -image IMAGE, -i IMAGE
                        image to install, use 'latest' to install the last
                        version available in your folder(default: show list of
                        available images '*.bin')
  -dir IMAGE_DIR, -d IMAGE_DIR
                        image search directory (default: ~/Downloads)
  -regex IMAGE_PATTERN, -e IMAGE_PATTERN
                        file pattern (default: 'esp[32|8266]*.bin')