Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Fix input/output error#152

Merged
scottjenson merged 2 commits into
google:masterfrom
Bytewalkers:master
Jun 12, 2016
Merged

Fix input/output error#152
scottjenson merged 2 commits into
google:masterfrom
Bytewalkers:master

Conversation

@PrabhanshuAttri

Copy link
Copy Markdown
Contributor

hcitool lescan creates an error if the bluez is already running. The solution I found was
hciconfig hci0 down
hciconfig hci0 up

screenshot

@googlebot

Copy link
Copy Markdown

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!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@PrabhanshuAttri

Copy link
Copy Markdown
Contributor Author

I signed it!

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Jun 1, 2016
@scottjenson

Copy link
Copy Markdown
Contributor

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?

@perja12

perja12 commented Jun 1, 2016

Copy link
Copy Markdown

@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?

@PrabhanshuAttri

Copy link
Copy Markdown
Contributor Author

@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.

@tolson2000

Copy link
Copy Markdown

Bringing hci0 down and and back up will loose other bluetooth connections that might already being used.

@PrabhanshuAttri

Copy link
Copy Markdown
Contributor Author

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?

@scottjenson

Copy link
Copy Markdown
Contributor

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 ;-)

@tolson2000

Copy link
Copy Markdown

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.
If the former, then who cares. If the latter, then something else might hiccup during the restart.
If this is just a script for experimenting with, I don't have a problem either while one figures out why the lescan seems to be misbehaving. It should just work.

@PrabhanshuAttri

Copy link
Copy Markdown
Contributor Author

@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.

@PrabhanshuAttri

Copy link
Copy Markdown
Contributor Author

@scottjenson what do you think about resetting it?

@scottjenson scottjenson merged commit 994b6c6 into google:master Jun 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants