-
Notifications
You must be signed in to change notification settings - Fork 39
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
Can't init hci #25
Comments
this tool uses so called "user channel" to access HCI interface and that requires CAP_NET_ADMIN privilege |
So how do i give myself CAP_NET_ADMIN privilege at the user level |
When i tried the example 'mcumgr --conntype ble --connstring peer_name=Zephyr echo hello' i encountered an error that 'Error: [hci0]: can't init hci: can't down device: operation not permitted'. Using the command with sudo gave 'sudo: mcumgr: command not found' error. So how can i make it work? |
depends on where you put your mcumgr binary, you may try with sudo -E which preserves your local user environment variables (ie PATH), or you may provide full path to mcumgr binary |
I have just come across the same error two years later: "Error: [hci0]: can't init hci: can't down device: operation not permitted". Giving the utility the CAP_NET_ADMIN capability worked for me; once you do so, the user does not need to be in sudoers when running the utility. To do so, I did the following under debian Bookworm. You'll need to run these commands as root, replacing the path with your installation location.
Could this capability be granted by the installer, or a warning given if a non-root user installs it? The error message alone does not make obvious what the solution should be, and I spent a lot of time trying to add my user to various groups for instance, under the assumption it was a permissions issue. Thanks. |
Hi, Yeah, I guess we could make error message more descriptive and also update web documentation... |
I was trying to run the mcumgr cli via the ble and encounter this error. I managed to circumvent this using sudo. Is there any other method without using sudo.
The text was updated successfully, but these errors were encountered: