Arduino-cli ESP32 problem om linux

I have a small problem, I have two linux computers (debian last edition) a desktop and a laptop,
have installed Arduino-cli on both, and work fine with compiling for arduino board,
but for ESP32 I managed to get it to act on the stationary.
But that's a long time ago and it's tight with my memory I can remember how,
but i remember though that the problem was around python
hope there is someone who can just recognize the problem. 
receives the following error message,
Traceback (most recent call last):
 File "/home/carsten/.arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool.py", line 38, in <module>
 import serial
ImportError: No module named serial

Error during build: exit status 1

In the Arduino world, we're accustomed to having the entire toolchain installed when you install a boards platform via Boards Manager (i.e., arduino-cli core install esp32:esp32), so you can just immediately start using your board after that installation process. But the ESP32 boards platform is different in that it has a dependency on the serial Python module, but does not install this for the user during the Boards Manager installation process.

So if you don't already happen to have the serial module installed, there is one additional step to the process, which is installing the pyserial package:

pip3 install pyserial

Depending on your system, your Python 3 pip might have a different name, such as pip, so you might need to adjust the command above accordingly, for example:

pip install pyserial

After that, you should no longer get this error.

1 Like
thank you very much. 
It was the magic that made things work. :D
1 Like

You're welcome. I'm glad to hear it's working now. Enjoy!
Per

i use debian and needed to install python2.7 before. Worked well

1 Like

The fix is really easy. In the platform.txt file, replace all occurrences of python to python3.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.