GithubHelp home page GithubHelp logo

aseivane / idfx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abobija/idfx

0.0 0.0 0.0 1.86 MB

Tool for flash/monitor ESP-IDF and ESP8266_SDK apps on the WSL2 :zap:

License: MIT License

Shell 100.00%

idfx's Introduction

idfx โšก

While there is no support for USB devices on WSL2 for now, this tool comes to help you to flash and monitor ESP-IDF and ESP8266_SDK applications on the WSL2.

Info:
Tested on Ubuntu 20.04 LTS and Debian distributions.

Note:
As a prerequisite for using this tool, Python ๐Ÿ needs to be installed on the Windows.

Supported ESP-IDF versions

idfx supports:

Intro

WSL2 still does not support USB devices, but with a little effort we can make possible to flash and monitor ESP device from WSL2.

Info:
Tested on Ubuntu 20.04 LTS and Debian distributions.

For flashing and monitoring over the serial COM port, I've wrote this compact idfx shell script.

Note:
As a prerequisite for using idfx, Python ๐Ÿ needs to be installed on the Windows.

More about idfx you can find in official repository.

Installation ๐Ÿš€

  • Update Linux
    sudo apt update && sudo apt upgrade -y

  • Install tools required for esp-idf
    sudo apt install -y git wget curl flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0

  • Make python3 as default python
    sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1

  • Make pip3 as default pip
    sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1

  • Make esp directory and go inside
    cd ~ && mkdir esp && cd esp

  • Clone esp-idf repository
    git clone --recursive https://github.com/espressif/esp-idf.git

  • Modify esp-idf installation script to work with WSL
    cd esp-idf && ! grep -q "dirname --" install.sh; [ $? -eq 0 ] && sed -i 's/dirname/dirname --/g' install.sh

  • Run esp-idf installation script
    . ./install.sh || true

  • Add esp-idf export script to the user profile script in order to make isp-idf tools visible on the PATH for every session
    echo -e '\n\n. $HOME/esp/esp-idf/export.sh > /dev/null 2>&1 || true' >> ~/.profile

  • Install idfx ( ? )
    curl https://git.io/JyBgj --create-dirs -L -o $HOME/bin/idfx && chmod u+x $HOME/bin/idfx

  • Source profile script to add all necessary tools to the PATH
    . ~/.profile || true

Create (a copy of hello_world) project ๐Ÿ“„

  • Make a copy of hello_world example project in home directory
    cd ~ && cp -r $IDF_PATH/examples/get-started/hello_world .

Usage

Signature:

idfx COMMAND [PORT]

Where the PORT is serial COM Port on the Windows (use the Device Manager to find your port).

For the full usage please execute next command:

idfx help

Build, flash and monitor โšก

  • Go inside of project
    cd hello_world

  • Set target
    idf.py set-target esp32

  • Configure
    idf.py menuconfig

  • Build
    idf.py build

  • Flash
    (open Device Manager on Windows to find COM port of your ESP, mine is COM2)
    idfx flash COM2

  • Monitor
    (change COM2 with your port)
    idfx monitor COM2
    (To exit monitor press CTRL+] or CTRL+T,X)

Tip:
Flash and monitor with single command:
idfx flash COM2 monitor


That's it.
Happy coding and flashing! โšก

idfx preview

Examples

For most of the cases (when you edit the code of your application) you can use idfx all COM2 because this command will build, flash and monitor your app, at once. Of course, you need to change COM2 (in previous command) with correct COM port.

Command Description
idfx all COM2 Build project, flash and monitor serial output, using port COM2
idfx build Build project
idfx flash COM2 Flashing project using port COM2
idfx monitor COM2 Display serial output of port COM2
idfx flash COM2 monitor Flash project and display serial output, using port COM2
idfx erase-flash COM2 Erase the entire flash, using port COM2
idfx help Show the idfx usage

Author

abobija - abobija.com

License

MIT

idfx's People

Contributors

abobija avatar aseivane avatar

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.