Robots-For-All (IEEE - HI)

MicroPython Programming

Useful Links

Building ESP32 IDF on Ubuntu Linux

  1. Get the tools:
    sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 minicom
  2. Create the ESP32 IDF diretory:
    mkdir -p ~/esp
  3. Get the ESP32 IDF:
    cd ~/esp
    git clone --recursive https://github.com/espressif/esp-idf.git
  4. Install the IDF:
    cd ~/esp/esp-idf
    ./install.sh all
  5. Export the IDF symbols:
    . ./export.sh
  6. Add the following to ~/.bashrc:
    alias get_idf='. $HOME/esp/esp-idf/export.sh'
  7. Create ~/esp/flash.sh with the following lines:
    idf.py -p /dev/ttyUSB0 flash
    sudo minicom -b 115200 -8 -D /dev/ttyUSB0 < /dev/tty
  8. Enable execution of flash.sh
    chmod +x ~/etc/flash.sh
  9. Build Hello World:
    cd ~/esp
    cp -r $IDF_PATH/examples/get-started/hello_world .
    cd ~/esp/hello_world
    idf.py set-target esp32
    idf.py menuconfig
    idf.py build
  10. Download Hello World into Flash:
    ~/esp/flash.sh

Building MicroPython on Ubuntu Linux

  1. Build the ESP32 IDF, see previous sectio
  2. :
    make -C mpy-cross
  3. :
    cd ports/esp32
    make submodules
    make
  4. :

Building MicroPython C++ Extensions on Ubuntu Linux

  1. Set example directory:
    cd micropython/examples/usercmodule/cppexample
  2. Build the ESP32 IDF, see previous sectio
  3. :
    make -C mpy-cross
  4. :
    cd ports/esp32
    make submodules
    make
  5. :