Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The esp32-arduino core should bundle pyserial, so esptool works #9689

Open
1 task done
egnor opened this issue May 26, 2024 · 6 comments
Open
1 task done

The esp32-arduino core should bundle pyserial, so esptool works #9689

egnor opened this issue May 26, 2024 · 6 comments
Labels
Type: Feature request Feature request for Arduino ESP32

Comments

@egnor
Copy link
Contributor

egnor commented May 26, 2024

Related area

platform support for esptool

Hardware specification

(relevant to all)

Is your feature request related to a problem?

If pyserial is not installed on the base system, esptool can't run, and because of espressif/esptool#981 you just get a stack trace and "No module named 'serial'" which isn't the most helpful, particularly for people using the Arduino IDE not conversant with Python.

This also makes the install-on-Linux instructions a lot more complicated than they have to be. Should just be a matter of adding the board manager URL.

Describe the solution you'd like

Somehow, when installing the arduino-esp32 platform, pyserial should get installed alongside other things.

Describe alternatives you've considered

No response

Additional context

No response

I have checked existing list of Feature requests and the Contribution Guide

  • I confirm I have checked existing list of Feature requests and Contribution Guide.
@egnor egnor added the Type: Feature request Feature request for Arduino ESP32 label May 26, 2024
@Jason2866
Copy link
Collaborator

That needs major changes. You can't install just py serial. You need a Pyenv for Arduino to have all rights to install and don't disturb the system installed python. So a check for pyenv is needed and when not there it needs to be installed. To do so python for all systems needs to be provided.

@egnor
Copy link
Contributor Author

egnor commented May 27, 2024

(I assume you mean venv, not pyenv?)

You don't actually need a venv to add a bundled module, you can just edit $PYTHONPATH to point to the bundled pyserial directory (or its .whl). Even if you are using a venv, you can still use the system Python, though not relying on that would be preferred!

For making portable self contained Python based executables (that bundle Python itself and any needed modules), I hear good things about PyOxidizer; I don't know if it would be compatible with pyserial.

@Jason2866
Copy link
Collaborator

Jason2866 commented May 27, 2024

Been there. Believe me only way that will work is to have a extra venv when requirements needs to be installed. Every other try will not work on a platform. Arduino esp8266 is doing that and Platformio (for every framework) too.
If going back to "compiled" apps than using esptool as compiled binary. For example this ones. This was the way in the past and there where reasons to switch to esptool.py ;-)

@egnor
Copy link
Contributor Author

egnor commented May 27, 2024

Just seems like there should be some better way. We do bundle a full Python installation for Windows?

@Jason2866
Copy link
Collaborator

What's wrong to provide a small python package. It is around 7MB.

@egnor
Copy link
Contributor Author

egnor commented May 27, 2024

You mean the Python binary itself (along with whatever libraries are needed)? Sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature request Feature request for Arduino ESP32
Projects
Development

No branches or pull requests

2 participants