go-ble / ble

Bluetooth Low Energy for Linux / macOS
BSD 3-Clause "New" or "Revised" License
302 stars 108 forks source link

can't init hci: no devices available: #106

Closed hson08 closed 1 year ago

hson08 commented 1 year ago

I'm getting an error running the scanner example app as root on debian: pls little bit of help? Thx!

package main

import (
    "fmt"
    "github.com/go-ble/ble/examples/lib/dev"
)

func main() {
    d, err := dev.DefaultDevice()
    if err != nil {
        fmt.Println("Failed to open BLE device:", err)
        return
    }
    defer d.Stop()
    // ...
}