# Debian/ubuntu
$ sudo apt-get install build-essential libreadline-dev libffi-dev git pkg-config
$ cd $HOME
$ wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
$ tar -xzf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
$ export PATH=$PATH:$HOME/xtensa-esp32-elf/bin
$ git clone https://github.com/espressif/esp-idf
$ git clone --recurse-submodules https://github.com/micropython/micropython.git
# Set paths and varibles
$ export IDF_PATH=$HOME/workspace/esp-idf
$ export PATH=$PATH:$HOME/workspace/xtensa-esp32-elf/bin
Check for supported ESP IDF git tag
$ cd ports/esp32
Get supported branch for `esp-idf`:
$ make idf-version
Or chack inisde Make file and find ESPIDF_SUPHASH
# Example
ESPIDF_SUPHASH := 30545f4cccec7460634b656d278782dd7151098e
Inside esp-idf source directory run:
git checkout -b <HASH from Makefile>
git submodule update --init --recursive
$ cd micropython
$ make -C mpy-cross
Source: https://github.com/rcludwick/Lora_driver_for_MicroPython_on_ttgo
- Link src/examples and src/sx127x directories into the ports/esp32/modules directory.
- Also link drivers/display (from micropython) into the ports/esp32/modules directory.
$ cd ports/esp32/modules
$ ln -s ../../../../LoRa_Driver_MicroPython_esp32/src/examples .
$ ln -s ../../../../LoRa_Driver_MicroPython_esp32/src/sx127x .
$ ln -s ../../../drivers/display .
Follow the micropython instructions for building the esp32 port.
$ cd ports/esp32
$ make -j4
$ make erase
$ make deploy
# Flash to a TTGO Module
# Connect to REPL for the TTGO and run examples.duplex.test.main()
Debug:
cd esp-idf/components/esptool_py/esptool
python espefuse.py --port /dev/ttyUSB0 summary
python espefuse.py --port /dev/ttyUSB0 dump