hcitool lescan 显示 I/O 错误 [英] hcitool lescan shows I/O error

查看:36
本文介绍了hcitool lescan 显示 I/O 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在树莓派上使用 hcitool 进行 lescan.

I'm trying to do a lescan using hcitool on the raspberry pi.

命令打印出来

Set scan parameters failed: Input/output error. 

我不确定,这里到底发生了什么.我的 iPhone 在这里打广告.

I'm not sure, what exactly happens here. My iPhone is advertising here.

我使用的是 IOGear 的 BLE 加密狗.

I'm using a BLE dongle from IOGear.

但是,如果我重新启动机器,它会在我发出 lescan 命令后显示 MAC 地址,并在我多次发出 lescan 命令后开始显示相同的错误.是不是不能多次发出 lescan 命令?

However, if I restart my machine, it shows the a MAC address after I issue the lescan command, and starts showing the same error after I issue the lescan command a couple of more times. Is it like, the lescan command cannot be issued more than once?

推荐答案

这种情况经常发生在我身上.我正在开发它,它只是不时发生.我还能够在 5 分钟内重现您的错误;-) 我正在运行 bluez v.5.17.但是,我可以多次运行 lescan 而不会出现此错误.

That happens often really often to me. I'm developing with it and it just happens from time to time. I was also able to reproduce your error within 5 minutes ;-) I'm running bluez v.5.17. However i can run lescan more than one time without this error.

hcitool lescan
Set scan parameters failed: Input/output error

试试:

hciconfig hci0 down
hciconfig hci0 up

并检查状态后记.

如果这不起作用或它挂在 DOWN 状态,请尝试:

if this doesn't work or it hangs in DOWN status, try:

service bluetooth restart
service dbus restart

(所有命令都是超级用户)

(all commands as superuser)

并关闭所有可能访问蓝牙的应用程序.例如 hcidump.

And close all application that may access bluetooth. For example hcidump.

如果这不起作用,您通常必须拔掉它.但是还有另一个肮脏的黑客可以做到这一点.它的工作原理是将授权设置为 0,然后再次设置为 1.这会强制 USB 加密狗进行初始化.

If that doesn't work you normally have to unplug it. But there is another dirty hack to do this. It works by setting the authorized to 0 and than 1 again. This forces the usb dongle to init.

lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0a5c:21e8 Broadcom Corp. 


cd /sys/bus/usb/devices/

grep -i -s -r 0a5c *
…
1-1.2/idVendor:0a5c
…

cd 1-1.2

echo 0 > authorized
echo 1 > authorized

这篇关于hcitool lescan 显示 I/O 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆