Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebBluetooth #261

Closed
daviddias opened this issue Oct 18, 2018 · 7 comments
Closed

WebBluetooth #261

daviddias opened this issue Oct 18, 2018 · 7 comments
Labels
effort/weeks Estimated to take multiple weeks exp/intermediate Prior experience is likely helpful good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/discussion Topical discussion; usually not changes to codebase kind/enhancement A net-new feature or improvement to an existing feature need/community-input Needs input from the wider community status/ready Ready to be worked

Comments

@daviddias
Copy link
Member

daviddias commented Oct 18, 2018

WebBluetooth now works in the Browser! *1, *2, *3

https://developers.google.com/web/updates/2018/10/nic70

*1 Only on Chrome
*2 Only on Windows
*3 It is a great start \o/

@victorb
Copy link
Member

victorb commented Oct 18, 2018

I think it works on macOS and Linux (tested chrome + linux a week ago and was working).

Implementing this will be tricky though. It requires the user to interact with the page (onClick event triggered or similar) before device selection can happen and the user has to explicitly select device. I think we could probably make it work anyway by providing some was of triggering bluetooth-discovery from the developers side though.

@lidel
Copy link
Member

lidel commented Oct 18, 2018

User Gesture Required

As a security feature, discovering Bluetooth devices with navigator.bluetooth.requestDevice must be triggered by a user gesture such as a touch or a mouse click. We're talking about listening to pointerup, click, and touchend events.
https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web#user_gesture_required

In the future UX could be much better: in WebExtension context the above requirement could be replaced by a "bluetooth" permission added to the manifest of IPFS Companion :trollface:

This is potentially huge: gives us alternative Local Discovery and Transport that do not depend on existence of any local network.

@lidel
Copy link
Member

lidel commented Aug 29, 2019

@vasco-santos
Copy link
Member

@lidel, did you have the opportunity to check libp2p/notes#6#issuecomment-458975204?

@holmesworcester
Copy link

Any update on this?

@marcus-pousette
Copy link
Contributor

marcus-pousette commented Jan 19, 2023

In https://github.com/WebBluetoothCG/web-bluetooth/blob/main/rationale.md

The key/value structure of GATT is believed to reduce the risk of device exploits compared to the unstructured byte-stream of other protocols. When the Characteristic Aggregate Format and Characteristic Presentation Format Descriptors are provided for a Characteristic, the UA can further validate any data passed to the device

If one is to do a libp2p connection around this, one needs to write a wrapper around GATT so that it behaves like a byte stream anyway? I would be surprised to see good throughput coming from that. However, not all applications require huge throughput. Simple messaging would be great for this

@lidel, did you have the opportunity to check libp2p/notes#6 (comment)?

Web NFC seems much more suitable

@tinytb tinytb added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue good first issue Good issue for new contributors kind/discussion Topical discussion; usually not changes to codebase need/community-input Needs input from the wider community exp/intermediate Prior experience is likely helpful effort/weeks Estimated to take multiple weeks labels Jan 31, 2023
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
Bumps [it-pipe](https://github.com/alanshaw/it-pipe) from 2.0.5 to 3.0.1.
- [Release notes](https://github.com/alanshaw/it-pipe/releases)
- [Changelog](https://github.com/alanshaw/it-pipe/blob/master/CHANGELOG.md)
- [Commits](alanshaw/it-pipe@v2.0.5...v3.0.1)

---
updated-dependencies:
- dependency-name: it-pipe
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
## [6.2.2](libp2p/js-libp2p-tcp@v6.2.1...v6.2.2) (2023-04-17)

### Dependencies

* **dev:** bump it-pipe from 2.0.5 to 3.0.1 ([libp2p#261](libp2p/js-libp2p-tcp#261)) ([f8b4bf7](libp2p/js-libp2p-tcp@f8b4bf7))
@Download
Copy link
Contributor

Download commented Feb 9, 2024

I was really hoping to connect two phones directly to each other using Web Bluetooth, but, AFAIK, this is not actually possible with Web Bluetooth as one can only connect to 'GATT Servers', but not actually have the web app create such a GATT Server itself. So yes you can connect to a heartrate-monitor and read some interesting data, but it cannot be used to create a server on one device and then connect to it from another device.

Maybe if we explain our use case to Google they would consider adding support for creating a GATT server but I am not holding my breath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/weeks Estimated to take multiple weeks exp/intermediate Prior experience is likely helpful good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/discussion Topical discussion; usually not changes to codebase kind/enhancement A net-new feature or improvement to an existing feature need/community-input Needs input from the wider community status/ready Ready to be worked
Projects
Archived in project
Development

No branches or pull requests

8 participants