Skip to content

Install_Esp8266

mateoGC edited this page Sep 8, 2021 · 13 revisions

  1. Configure properly your toolchain

    1. Linux
    2. Windows
    3. Mac OS
  2. Download the ESPSDK

       mkdir -p ~/esp
       cd ~/esp
       git clone --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git
    
  3. Define IDF_PATH in ~/.profile by adding the following lines to the end of the file:

      export IDF_PATH=$HOME/esp/ESP8266_RTOS_SDK
      export IDF_TOOL_PATH=$HOME/esp/xtensa-lx106-elf/bin:$IDF_PATH/tools
    
    
  4. Set up the environment variables by creating an aliias in ~/.bashrc file by adding the following line to the end of the file:

      alias get_idf='. $HOME/esp/ESP8266_RTOS_SDK/export.sh'
    
    
  5. Get python requirements:

     sudo apt-get install pip
     python3 -m pip install --user -r $IDF_PATH/requirements.txt
    
  6. Set up the tools:

    1. Linux and Mac OS

        ~/esp/ESP8266_RTOS_SDK/install.sh
      

      NOTE: if you get this error /usr/bin/env: <<python>>: No such file or directoryrun the following command and try it again:

        sudo ln -s /usr/bin/python3 /usr/bin/python
      

      Install cmake by running the following command:

        sudo apt install cmake
      
    2. Windows

      
      

Configure

  make menuconfig CONFIG_SDK_PYTHON=python3
  xtensa-lx106-elf
  xtensa-esp32-elf
  (python3 ) python2 as interpreter

Build

  In order to build a project, first set up the environment variables by running `get_idf` command. Then, run the command `idf.py build` 

Flash

  Before you flash the device, you need to give permissions to the USB port by running:
  ```
    sudo usermod -a -G dialout $USER 
    sudo chmod -R 777 /dev/ttyUSBx
  ```
  Then you can flash the device by running ```idf.py flash``` command.
 `NOTE:` Remember to set your desired bitrate on the MONITOR_BAUD, if not defaults to 74880

Clone this wiki locally