Giter VIP home page Giter VIP logo

docker-esp-sdk's Introduction

Easily compile and flash binaries for the ESP8266 and ESP8266EX

You might also be interested in the branch for the ESP32: https://github.com/T-vK/docker-esp-sdk/tree/esp32

  1. Get Docker
  • If you trust me, you can simply pull my image from the docker hub:

    sudo docker pull tavk/esp-sdk:0.1.0
  • Otherwise, if you want it to be built on your computer (takes about 30-90 minutes), run this:

    git clone https://github.com/T-vK/docker-esp-sdk.git
    cd docker-esp-sdk
    sudo docker build -t tavk/esp-sdk:0.1.0 .

Done!

How to use

Compiling binaries

sudo docker run -t -i -u esp \
-v /home/ubuntu/esp8266/esp-open-sdk/examples/blinky:/home/esp/shared_project \
-e SDK_VERSION='1.5.3' \
tavk/esp-sdk:0.1.0 \
make
  • Replace /home/ubuntu/esp8266/esp-open-sdk/examples/blinky with the absolute path to the directory of the project oyu want to compile.
  • Replace 1.5.3 with whatever version of the ESP SDK you want to compile. 1.4.0 up to 2.0.0 are supported.
  • Replace make with whatever command is necessary to compile your binary/binaries.

Flashing binaries

sudo docker run -t -i -u esp \
--device=/dev/ttyUSB0 \
-v /home/ubuntu/esp8266/esp-open-sdk/examples/blinky:/home/esp/shared_project \
tavk/esp-sdk:0.1.0 \
esptool.py --port /dev/ttyUSB0 write_flash 0x00000 blinky-0x00000.bin 0x40000 blinky-0x40000.bin
  • Replace /home/ubuntu/esp8266/esp-open-sdk/examples/blinky with the absolute path to the directory that contains the files you want to flash.
  • Replace /dev/ttyUSB0 with the COM port that your ESP is connected to.
  • Replace esptool.py --port /dev/ttyUSB0 write_flash 0x00000 blinky-0x00000.bin 0x40000 blinky-0x40000.bin with whatever command is necessary to flash your binaries.

Flashing bootloaders

sudo docker run -t -i -u esp \
--device=/dev/ttyUSB0 \
-v /home/ubuntu/projects/esp-bootloader:/home/esp/shared_project \
tavk/esp-sdk:0.1.0 \
esptool.py --port /dev/ttyUSB0 write_flash --flash_mode dio --flash_size 32m 0x0 bootloader.bin
  • Replace /home/ubuntu/projects/esp-bootloader with the absolute path to the directory that contains the files you want to flash.
  • Replace /dev/ttyUSB0 with the COM port that your ESP is connected to. -Replace esptool.py --port /dev/ttyUSB0 write_flash --flash_mode dio --flash_size 32m 0x0 bootloader.bin with whatever command is necessary to flash your binaries.

If the make file takes care of compiling AND flashing

sudo docker run -t -i -u esp \
--device=/dev/ttyUSB0 \
-v /home/debian/espusb:/home/esp/shared_project \
-e SDK_VERSION='1.5.3' \
tavk/esp-sdk:0.1.0 \
make ESP_ROOT=/home/esp/esp-open-sdk burn
  • Replace /dev/ttyUSB0 with the COM port your esp is connected to.
  • Replace /home/debian/espusb with the absolute path to directory of the project you want to compile/flash.
  • Replace 1.5.3 with whatever version of the ESP SDK you want to use for the compiling process.
  • Replace make ESP_ROOT=/home/esp/esp-open-sdk burn with the command necessary to compile and flash your project.

For more information on flashing please refer to the README of https://github.com/themadinventor/esptool

Tested

I personally tested the docker image under Ubuntu 16.04 x64 and Debian 8 Jessie x64.

Can I use this on Windows?

Yes, but docker doesn't run natively on Windows. Tools like boot2docker or docker-machine create a Linux VM using VirtualBox. So in order to grant the docker image access to your serial port and your project folder you have to pass your serial port (or usb serial adapter) through to the vm and the same applies for your project folder.
Read this for more information on that: http://stackoverflow.com/questions/30864466/whats-the-best-way-to-share-files-from-windows-to-boot2docker-vm

Can I use this on Mac OS X?

Probably yes. If docker runs natively on Mac OS X, then there is no need to do anything special. Otherwise follow the same steps that are required for Windows as described above.

docker-esp-sdk's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-esp-sdk's Issues

Tag latest not found in repository docker.io/tavk/esp-sdk

I'm a Docker noob, but the pull command did not work for me.

$ sudo docker pull tavk/esp-sdk
Using default tag: latest
Pulling repository docker.io/tavk/esp-sdk
Tag latest not found in repository docker.io/tavk/esp-sdk

After that I used:

sudo docker pull tavk/esp-sdk:0.1.0

That was working for me.

Build no longer works due to missling files

The process to build the sdk in docker as described here no longer works.
The command sudo docker build -t tavk/esp-sdk:0.1.0 .

fails with this output.

[04:43] / ct-ng:152: recipe for target 'build' failed
make[2]: *** [build] Error 1
make[2]: Leaving directory '/home/esp/esp-open-sdk/crosstool-NG'
../Makefile:135: recipe for target '_toolchain' failed
make[1]: *** [_toolchain] Error 2
make[1]: Leaving directory '/home/esp/esp-open-sdk/crosstool-NG'
Makefile:130: recipe for target 'crosstool-NG/.built' failed
make: *** [crosstool-NG/.built] Error 2
The command '/bin/sh -c cd esp-open-sdk && make STANDALONE=n' returned a non-zero code: 2

Inside the container, build.log contains:

[DEBUG]    ==> Executing: 'wget' '--passive-ftp' '--tries=3' '-nc' '--progress=dot:binary' '-T' '10' '-O' '/home/esp/esp-open-sdk/crosstool-NG/.build/tarballs/cloog-0.18.4.tar.xz.tmp-dl' 'http://www.bastoul.net/cloog/pages/download/cloog-0.18.4.tar.xz' 
[ALL  ]    --2016-10-25 08:57:42--  http://www.bastoul.net/cloog/pages/download/cloog-0.18.4.tar.xz
[ALL  ]    Resolving www.bastoul.net (www.bastoul.net)... 62.210.16.62
[ALL  ]    Connecting to www.bastoul.net (www.bastoul.net)|62.210.16.62|:80... connected.
[ALL  ]    HTTP request sent, awaiting response... 404 Not Found
[ALL  ]    2016-10-25 08:57:43 ERROR 404: Not Found.

and


[DEBUG]    ==> Executing: 'wget' '--passive-ftp' '--tries=3' '-nc' '--progress=dot:binary' '-T' '10' '-O' '/home/esp/esp-open-sdk/crosstool-NG/.build/tarballs/binutils-2.25.1.tar.xz.tmp-dl' 'http://ftp.gnu.org/gnu/binutils/binutils-2.25.1.tar.xz' 
[ALL  ]    URL transformed to HTTPS due to an HSTS policy
[ALL  ]    --2016-10-25 08:58:00--  https://ftp.gnu.org/gnu/binutils/binutils-2.25.1.tar.xz
[ALL  ]    Resolving ftp.gnu.org (ftp.gnu.org)... 208.118.235.20, 2001:4830:134:3::b
[ALL  ]    Connecting to ftp.gnu.org (ftp.gnu.org)|208.118.235.20|:443... connected.
[ALL  ]    HTTP request sent, awaiting response... 404 Not Found
[ALL  ]    2016-10-25 08:58:01 ERROR 404: Not Found.

as well as 404 errors for

http://ftp.kernel.org/pub/linux/devel/binutils/binutils-2.25.1.tar.lzma
https://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.xz
http://mirrors.kernel.org/sourceware/gdb/gdb-7.10.tar.xz
http://mirrors.kernel.org/sources.redhat.com/newlib/newlib-2.0.0.tar.bz2

Are there recommendations for locating the missing sources?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.