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

查看:419
本文介绍了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天全站免登陆