Page 1 of 1

Portable and cross platform ESP IDF

Posted: Wed Apr 08, 2020 11:48 pm
by evlquaker
I am building a program that needs to compile and upload to the ESP-32. I am trying to find a solution that is portable, with no installation required and no external dependencies. I also want this to be both Windows and Macintosh compatible. I have been trying for quite some time to find a solution. Does anyone know a way to do this? Help would be much appreciated.

Re: Portable and cross platform ESP IDF

Posted: Thu Apr 09, 2020 3:16 am
by chegewara

Re: Portable and cross platform ESP IDF

Posted: Thu Apr 09, 2020 3:34 am
by evlquaker
Yes, that is my listing.

Re: Portable and cross platform ESP IDF

Posted: Thu Apr 09, 2020 4:53 am
by ESP_Sprite
*Compile* and upload, right? That effectively would involve packaging the entirety of esp-idf plus its dependencies... perhaps the fastest way would be to just ship a VM with a Linux install with that in it.

However, what exactly is the reason you need the compilation step? Even if it were just linking and flashing, the job would be a lot easier.

Re: Portable and cross platform ESP IDF

Posted: Sat Apr 11, 2020 8:12 pm
by chegewara
Virtualbox with environment or docker.

Re: Portable and cross platform ESP IDF

Posted: Sun Apr 12, 2020 10:07 am
by ESP_igrr
(I assume that Docker and virtual machines don't qualify due to "no external dependencies" and "no installation" requirements, so we need something that can be simply extracted onto the user's disk and will work with no extra steps; Without these requirements, Docker is indeed a good option, as long as you don't need to interact with the serial port.)

At the moment with IDF 4.0 and above there not too many dependencies left which can not be encapsulated in a "portable" (no installation on Windows, no symlinks on Linux/Mac) package:

- Python interpreter
- Git

Once these are available, everything else can be placed into a redistributable archive:

- a copy of IDF repository, along with any submodules
- "IDF Tools" directory (by default $HOME/.espressif or %USERPROFILE%\.espressif, but can be anywhere else, as long as IDF_TOOLS_PATH environment variable points to that location)
- under "IDF Tools" directory: distribution archives of all required compilers/tools, extracted version of these tools, and the Python virtual environment.

I think Git on Windows can also be supplied as a "portable" installation. Which leaves us with the problem of packaging a "portable" copy of Python (with setuptools, pip included). There are a few projects which aim to solve this problem. Also you will need to package the wheels required by IDF dependencies, and copy them into Pip cache so that the packages can be installed with no Internet access.

On macOS the problem of bundling a Python interpreter with an app seems to be a fairly common one, so you might find a solution there as well.