Fix input/output error#152
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it! |
|
CLAs look good, thanks! |
|
Thanks @PrabhanshuAttri for this. I'm not that familiar with this aspect of hciconfig. Does this mean that your fix resets the BLE connection? How often does this happen? Just once on startup or each time the command is invoked? |
|
@PrabhanshuAttri: this can be caused by the Bluetooth daemon running. Can you first try to stop the daemon with "sudo systemctl stop bluetooth" or "sudo /etc/init.d/bluetooth stop" to see if that resolves the issue? |
|
@scottjenson every time we do a 'lescan' and if hci0 was 'up' then it throws this error. @perja12 I think this would be a better fix for this. If the hci0 was already down then running these commands won't create any issue. It's just a minor fix. |
|
Bringing hci0 down and and back up will loose other bluetooth connections that might already being used. |
|
I think we are already putting it on non-connectable mode while advertising the link. Resetting hci0 was the only solution I found. Do we need to advertise and scanning URL, simultaneously? |
|
I'm actually ok with this solution. I just wanted a bit of review to make sure there wasn't something I was missing. Unless anyone else has strong feelings, I'd like to approve this tomorrow. Speak up (with solutions) or forever hold your peace ;-) |
|
I guess I am missing the use case. Is this on a dedicated embedded Linux just being used as a beacon. Or is it a full blown Linux workstation / laptop where other bluetooth devices may be connected as in keyboads, mice, receiving data from other beacons, etc. |
|
@tolson2000 Yes, unfortunately, that will happen, if we reset it. This fix stops the advertising-url. I think it's a low-cost solution to test and use Eddystone beacons. For production uses, the user must buy the real beacons. |
|
@scottjenson what do you think about resetting it? |
hcitool lescan creates an error if the bluez is already running. The solution I found was
hciconfig hci0 downhciconfig hci0 up