Compiling - qtoggle/espqtoggle GitHub Wiki


Using espQToggle Builder

espQToggle Builder is a specially crafted Docker image that contains everything needed to build espQToggle.

Requirements

  • a Linux or Unix-like machine (Windows may work but commands may need to be adjusted)
  • Docker engine
  • git

Steps

  1. Clone the source code:

    git clone https://github.com/qtoggle/espqtoggle.git /path/to/espqtoggle
    
  2. Run the espqtoggle-builder Docker container:

    docker run -it --rm -v /path/to/espqtoggle:/src qtoggle/espqtoggle-builder
    

    Always specify full path to your espqtoggle folder, when supplying arguments to -v.

  3. It should generate the following files:

    /path/to/espqtoggle/build/user{1,2}.bin
    /path/to/espqtoggle/build/firmware-${flash_mode}-${flash_freq}.bin
    

    Being built by Docker, your compiled files will be owned by root. If you don't like that, reown them:

    sudo chown -R youruser /path/to/espqtoggle/build
    

Manual Compiling

Use manual compiling if you plan to develop (on) espQToggle and will thus probably need to build the project many times.

Requirements

Steps

  1. Clone the source code:

    git clone https://github.com/qtoggle/espqtoggle.git /path/to/espqtoggle
    
  2. Ensure your PATH environment variable points to the Xtensa toolchain bin directory; you should be able to execute the xtensa-lx106-elf-gcc command.

  3. Set the environment variable SDK_BASE to point to the folder where your ESP8266 non-OS SDK lives.

    export SDK_BASE=/path/to/esp8266-nonos-sdk
    
  4. Run the espqtoggle/builder/fix-sdk.sh script to make necessary adjustments to your ESP8266 non-OS SDK:

    /path/to/espqtoggle/builder/fix-sdk.sh ${SDK_BASE}
    
  5. Run make inside the project's folder:

    cd /path/to/espqtoggle && make -j4
    
  6. It should generate the following files:

    /path/to/espqtoggle/build/user{1,2}.bin
    /path/to/espqtoggle/build/firmware.bin