Arduino build fails under Ubuntu 20.04

CollieJim
Posts: 3
Joined: Sat May 16, 2020 7:36 am

Arduino build fails under Ubuntu 20.04

Postby CollieJim » Sat May 16, 2020 7:47 am

I have just installed Ubuntu 20.04, and learned to my dismay that Python2 is only marginally supported.

pySerial is not included, nor do I see any way to install it. It's not in the repo, and pip2 is not available either.

The boards manager URL I use is
https://dl.espressif.com/dl/package_esp32_index.json

Code: Select all

ESP $ arduino-cli compile --fqbn esp32:esp32:esp32doit-devkit-v1  ESP32_ILI9341
Traceback (most recent call last):
  File "/home/cave/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py", line 37, in <module>
    import serial
ImportError: No module named serial
Is there a version of the boards that use Python3?
Thanks

lbernstone
Posts: 827
Joined: Mon Jul 22, 2019 3:20 pm

Re: Arduino build fails under Ubuntu 20.04

Postby lbernstone » Sun May 17, 2020 4:48 pm

Your system is still running python2. I would suggest you move forward. Use update-alternatives to set your default to python3, and then use pip3 to install any missing dependencies.

Code: Select all

sudo update-alternatives --config python3

CollieJim
Posts: 3
Joined: Sat May 16, 2020 7:36 am

Re: Arduino build fails under Ubuntu 20.04

Postby CollieJim » Mon May 18, 2020 1:38 am

As can be seen in the original post, the toolchain used uses Python2. pip3 is not going to get pySerial for python2.
The way forward, ideally, is for the toolchain to be upgraded to Python3.

lbernstone
Posts: 827
Joined: Mon Jul 22, 2019 3:20 pm

Re: Arduino build fails under Ubuntu 20.04

Postby lbernstone » Wed May 20, 2020 3:04 am

esptool != toolchain. It is a utility used to upload the data to the device.
It is using your default python, which is currently python2. Use update-alternatives to modify that. You can then test by running `python ~/.arduino15/packages/esp32/hardware/esp32/1.0.4/tools/esptool.py`

CollieJim
Posts: 3
Joined: Sat May 16, 2020 7:36 am

Re: Arduino build fails under Ubuntu 20.04

Postby CollieJim » Wed May 20, 2020 12:52 pm

I realised after pressing submit that toolchain was the wrong word.
Anyway, thanks for your help. All is well now.
I think I know what I'm doing, but that's clearly an illusion...


Who is online

Users browsing this forum: No registered users and 81 guests