-
Notifications
You must be signed in to change notification settings - Fork 315
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
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS in Docker (VSC-1263) #1100
Comments
For the python part, just update About openOCD, have you configured the USB drivers ? |
The debugging works in the Windows environment so I assumend the drivers are ok. Do i need to manually add the udev rules in the docker container or adjust any drivers for USB debugging? I assumed, reading the tutorial, that the container is prepared and no configuration is needed. Thanks for your reply |
When connecting as root to the running container (started using vs code devcontainer) I can start the I adjusted the default When I switch to the The Is anyone facing a similar problem, or has any idea what I am missing? |
I am one step further to getting this to work. I can't work using I can start
I saw that one should just execute
Should this command execute normally inside the container? The only thing I changed from the generated |
Normally this command runs in the Dockerfile to install extension debug adapter dependencies. Seems like a write permission is necessary for the current user. |
I adjusted the permissions and I could debug successfully. The following changes to the Add the container user to the root group:
Set permissions to install python packages:
|
I think there was a use case from some users they didn't want to add the container user as root user. Adding the chmod -R 775 makes sense. I also just realize we don't install python packages in Dockerfile directly. We could add it in the Dockerfile but the problem is that extension path changes with extension version. For now I think we need to update docs to let user know to install with command you used before. |
Thanks for your response. So if you do not add the user to root group, which I can understand is no perfect solution, the chmod in your commit (6104cb8) will not work as expected. |
I couldn't also find a workaround this so I just update the docker file as you did. please take a look and let me know what you think. |
OS
Windows
Operating System version
Windows 11 Build 22621
Visual Studio Code version
1.85.1
ESP-IDF version
5.1.2
Python version
3.8.10
Doctor command output
---------------------------------------------- ESP-IDF Extension for Visual Studio Code report ---------------------------------------------
OS linux x64 5.15.133.1-microsoft-standard-WSL2
System environment variable IDF_PYTHON_ENV_PATH
/opt/esp/python_env/idf5.1_py3.8_env
System environment variable PATH
/vscode/vscode-server/bin/linux-x64/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/bin/remote-cli:/opt/esp/idf/components/espcoredump:/opt/esp/idf/components/partition_table:/opt/esp/idf/components/app_update:/opt/esp/tools/xtensa-esp-elf-gdb/12.1_20221002/xtensa-esp-elf-gdb/bin:/opt/esp/tools/riscv32-esp-elf-gdb/12.1_20221002/riscv32-esp-elf-gdb/bin:/opt/esp/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/opt/esp/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/opt/esp/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/opt/esp/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/opt/esp/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/opt/esp/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/opt/esp/python_env/idf5.1_py3.8_env/bin:/opt/esp/idf/tools:/opt/qemu/bin:/opt/qemu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
System environment variable PYTHON
undefined
Visual Studio Code version 1.85.1
Visual Studio Code language en
Visual Studio Code shell /usr/bin/bash
ESP-IDF Extension version 1.6.5
Workspace folder /workspaces/blink
---------------------------------------------------- Extension configuration settings ------------------------------------------------------
ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH}
ESP-IDF Path (idf.espIdfPath) /opt/esp/idf
ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH}
ESP-Matter Path (idf.espMatterPath) ${env:ESP_MATTER_PATH}
Custom extra paths (idf.customExtraPaths)
Custom extra vars (idf.customExtraVars)
OPENOCD_SCRIPTS: d:\Tools\esp_idf_tools\tools\openocd-esp32\v0.12.0-esp32-20230921/openocd-esp32/share/openocd/scripts
IDF_CCACHE_ENABLE: 1
ESP_ROM_ELF_DIR: d:\Tools\esp_idf_tools\tools\esp-rom-elfs\20230320/
Virtual env Python Path (idf.pythonBinPath) /opt/esp/python_env/idf5.1_py3.8_env/bin/python
Serial port (idf.port) /dev/ttyACM0
OpenOCD Configs (idf.openOcdConfigs) board/esp32c6-builtin.cfg
ESP-IDF Tools Path (idf.toolsPath) /opt/esp
Git Path (idf.gitPath) /usr/bin/git
-------------------------------------------------------- Configurations access -------------------------------------------------------------
Access to ESP-ADF Path (idf.espAdfPath) false
Access to ESP-IDF Path (idf.espIdfPath) true
Access to ESP-MDF Path (idf.espMdfPath) false
Access to ESP-Matter Path (idf.espMatterPath) false
Access to ESP-IDF Custom extra paths
Access to Virtual env Python Path (idf.pythonBinPath) true
Access to CMake in environment PATH true
Access to Ninja in environment PATH true
Access to ESP-IDF Tools Path (idf.toolsPath) true
-------------------------------------------------------- Configurations has spaces -------------------------------------------------------------
Spaces in system environment Path false
Spaces in ESP-ADF Path (idf.espAdfPath) false
Spaces in ESP-IDF Path (idf.espIdfPath) false
Spaces in ESP-MDF Path (idf.espMdfPath) false
Spaces in ESP-Matter Path (idf.espMatterPath) false
Spaces in ESP-IDF Custom extra paths
Spaces in Virtual env Python Path (idf.pythonBinPath) false
Spaces in ESP-IDF Tools Path (idf.toolsPath) false
----------------------------------------------------------- Executables Versions -----------------------------------------------------------
Git version 2.25.1
ESP-IDF version 5.1.2
Python version 3.8.10
Python's pip version 23.3.1
-------------------------------------------------- Project configuration settings ----------------------------------------------------------
-------------------------------------------------- Python packages in idf.pythonBinPath ----------------------------------------------------
bitarray version: 2.8.3
bitstring version: 4.1.2
CacheControl version: 0.13.1
certifi version: 2023.7.22
cffi version: 1.16.0
charset-normalizer version: 3.3.2
click version: 8.0.4
colorama version: 0.4.6
construct version: 2.10.69
contextlib2 version: 21.6.0
cryptography version: 39.0.2
ecdsa version: 0.18.0
esp-coredump version: 1.7.0
esp-idf-kconfig version: 1.4.0
esp-idf-monitor version: 1.3.3
esp-idf-panic-decoder version: 0.2.0
esp-idf-size version: 0.4.3
esptool version: 4.7.dev3
filelock version: 3.13.1
freertos-gdb version: 1.0.2
idf-component-manager version: 1.4.1
idna version: 3.4
intelhex version: 2.3.0
kconfiglib version: 14.1.0
msgpack version: 1.0.7
packaging version: 23.2
pip version: 23.3.1
pkg_resources version: 0.0.0
pycparser version: 2.21
pyelftools version: 0.29
pygdbmi version: 0.9.0.2
pyparsing version: 3.0.9
pyserial version: 3.5
PyYAML version: 6.0.1
reedsolo version: 1.7.0
requests version: 2.31.0
requests-file version: 1.5.1
requests-toolbelt version: 1.0.0
schema version: 0.7.5
setuptools version: 68.2.2
six version: 1.16.0
tqdm version: 4.66.1
urllib3 version: 1.26.18
---------------------------------------------------- Check ESP-IDF python requirements.txt -------------------------------------------------
Check ESP-IDF Python packages Python requirements are satisfied.
---------------------------------------------------- Check extension requirements.txt ------------------------------------------------------
Check Extension Python packages Error
---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------
Check Debug AdapterPython packages Error
---------------------------------------------------- Visual Studio Code launch.json --------------------------------------------------------
{
"version": "0.2.0",
"configurations": [
{
"type": "espidf",
"name": "Launch",
"request": "launch"
}
]
}
---------------------------------------------------- Visual Studio Code c_cpp_properties.json ----------------------------------------------
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "${config:idf.toolsPath}\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin\riscv32-esp-elf-gcc.exe",
"includePath": [
"${config:idf.espIdfPath}/components/",
"${config:idf.espIdfPathWin}/components/",
"${config:idf.espAdfPath}/components/",
"${config:idf.espAdfPathWin}/components/",
"${workspaceFolder}/"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${config:idf.espAdfPath}/components/",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": false
},
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
----------------------------------------------------------- Latest error -----------------------------------------------------------------
Latest error at Unknown error in ESP-IDF doctor command
Extension
No response
Description
I am using the generated
.devcontainer
files to build/flash and debug using docker.I followed the Tutorial in the Repository: Tutorial
I adjusted the
Dockerfile
to useespressif/idf:v5.1.2
as base image instead ofespressif/idf
. There was a problem with the installed python version and thepythonBinPath
of the generated files. I want to use v5.1.2 anyways so that should not be a problem.I can build and flash via USB without a problem. (Using usbipd as described in the tutorial)
I can't debug, respectively start the openOCD server as the following error occurs:
I am grateful for any help.
Regards
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: