daphtdazz / webble Goto Github PK
View Code? Open in Web Editor NEWThis project forked from pauljt/blebrowser
iOS WebBluetooth Polyfill
License: Other
This project forked from pauljt/blebrowser
iOS WebBluetooth Polyfill
License: Other
As per apple's docs iOS does in principle allow bluetooth low energy apps to run in the background to handle bluetooth events, and it would be nice if WebBLE could make use of this.
As per: https://webbluetoothcg.github.io/web-bluetooth/#permission-api-integration
Basically as I understand it this would allow web pages not to need to re-ask for permission to access devices they've requested permission to access before, making for a better experience for the user.
Using writeValue on a BluetoothRemoteGATTCharacteristic always tries to use the writeWithoutResponse method, even if characteristic.properties.writeWithoutResponse is set to false, causing the write operation to fail.
Here's the error message received:
[CoreBluetooth] WARNING: Characteristic <CBCharacteristic: 0x1c80a8820, UUID = 2345, properties = 0xA, value = , notifying = NO> does not specify the "Write Without Response" property - ignoring response-less write
I have a BLE app that generates downloadable data in the browser. The download links I generate do not work (they do nothing) in WebBLE like they do in Safari.
Sample code is available at:
https://jsfiddle.net/Lk3tgxmy/
Either form is acceptable, but blob URL support would be best to handler larger files.
When trying to use a Samsung Gear VR controller with WebBLE the device disconnects after 2 or 3 seconds. On Chrome on the Mac it doesn't.
Perhaps there's some bit of the spec not implemented that is designed to handle this, or perhaps there's some part of the Core Bluetooth APIs that can be configured to avoid this. Needs some more research.
With iOS 15 adding support for Safari extensions, it would be really nice if it was possible to put the functionality of an app into an extension that just gave Safari itself WebBluetooth functionality.
I have no idea if this is possible, or if it would even be allowed by Apple, but it would be a bit more useful than just having a dedicated app.
Once notifications are enabled, and a 'characteristicvaluechanged' callback has been set, it doesn't seem to be triggered. This issue has been noted with this application that works perfectly with Google Chrome on Android and Windows 10 (with this implementation). The same issue is also noted with a personal code. Any idea of what's going on ?
Value of optional type 'CBService?' must be unwrapped to refer to member 'uuid' of wrapped base type 'CBService'
Fix: Chain the optional using '?' to access member 'uuid' only for non-'nil' base values
Fix: Force-unwrap using '!' to abort execution if the optional value contains 'nil'
It seems that gatt.connect() call is not possible after gatt.disconnect(). I'm getting following error:
No known device for device transaction Transaction(id: 33, key: device:connectGATT),
where the 33 is some internal number of the request.
The same code works on both chrome and edge on Windows.
Is this a bug or a missing feature?
With Bangle.js you can now enable ANCS and AMS, which allows it to grab notifications and music playback info direct from iOS without an app installed (iOS stays connected to the Bangle). You may also have a HID bluetooth device connected to iOS that you also want to control with WebBLE.
However, when iOS is connected to the device, you don't see it listed in WebBLE and can't connect to it.
However on Android/other OSes you generally can do this.
I believe this should be possible on iOS too, and the BlueFruit app seems able to do it (if that's any help to see how they manage it?) https://github.com/adafruit/Bluefruit_LE_Connect_v2
I have to do multiple BLE device testing on a single page but it is not working. I implemented an iframe for test multiple devices on single page at the same time but it is not working but it is working for a single device.
So anyone please give me a solution.
Thanks.
Hi guys,
I downloaded the latest source yesterday and tried to build it "out-of-the-box" with Xcode (11.3.1) but the build failed.
It turns out the WBCore/Polyfill/WBRemoteGATTServer.js is missing from the project. However, there is a WBBluetoothRemoteGATTServer.js in the Polyfill directory, so I removed WBRemoteGATTServer.js from the project and added WBBluetoothRemoteGATTServer.js which then allowed the project to build successfully.
I hope this helps!
In WebBLE when sending, for example, writeValue(2000), the received value is 208 (which is 2000&0xff). This is not the case with Chrome from a desktop computer, nor from Chrome from an android phone, using exactly the same code.
const data = new Int32Array([2000]);
myCharacteristic.writeValue(data);
It seems to me that it is not possible to write and notify from the same chatacteristic. Can someone please check that?
Hello,
We are using this browser to test BLE in IOS devices but when characteristic.writeValue comes into a role at that time it is stuck on this statement and does not work.
Anyone, Can you give me a solution.
Thanks.
To safe battery in my gadget, I wanted to change to advertising instead of a connection that has to be kept alive.
It seems that WebBLE did not implement advertising support yet.
So instead I tried to opt for a polling reconnect instead (shifting the battery burden to the phone instead). But this does not seem to work in WebBLE. I tried one of the examples from the Web Bluetooth examples.
https://googlechrome.github.io/samples/web-bluetooth/automatic-reconnect.html
On my PC and under android this works, even on the Iphone under the other app (B...F..) the example works, but not on WebBLE.
Edit: I just noticed another ticket, probably the same issue:
#48
It would be great to have Physical Web Eddystone beacon support enabled by the app as well.
Enabling users to discover and connect to devices around them broadcasting physical web urls and accepting ble connections. 🌈
Change light UI to dark UI if wanted
And probably some other console methods.
Hello first thanks for this great app.
I Wrote application for reading serial data from my BLE device. According to debug console it seems there is some problem with connection but if I continue with reading I can see all my data in console without problem. Unfortunately these data are not forwarded to my application, I can see them only in console.
So my problem is that I didn't get the data to my application but they are readable only in console.
Need to check spec, but Chrome does it.
Hi @daphtdazz , large parts of the code have an apache 2.0 license header on them, but others have only a basic copyright header.
Could you please clarify what the overall license is? Thank you :)
looks like it's something that is not added by default in a webview, here is the documentation.
I need to generate iframes dynamically. When the iframe src is from blob and starts with blob:https://something
it is not displayed in WebBLE. It works correctly on mobile Safari.
Here is a very basic example:
https://codepen.io/jan_osch/pen/XWJEeBX
We are building a Web IDE for working with programmable BLE devices:
https://ide.estimote.com/
It probably gets in the way of the UI
I had to replace all of my oncharacteristicvaluechanged handlers as the title describes, otherwise they never fire.
(FYI--Exact same thing in Carta Browser)
It would be really nice if there was a special URL that could be linked to that would open a web clip version of the app while navigating to the URL given
Only a few of the Web Bluetooth constructor functions are exported in WebBLE however my application attempts to use those constructor functions to perform instanceof
checks for validating parameters in some cases.
This results in the error:
Can't find variable: BluetoothRemoteGATTService
A link to the published page can be found using githack.
Because google chrome can’t meet my needs
From email:
There is one bizarre behavior that happens with your browser that doesn't happen in safari or chrome on iOS. THREE.js and other WebVR solutions use a hack of playing a 1second movie in the browser to prevent the screen from going to sleep. In your browser it automatically full-screens which then requires it to be closed which defeats the whole purpose of displaying it to begin with. Is this something that you can fix? This link further explains the technique used: https://davidwalsh.name/wake-lock-shim
Specifically
navigator.bluetooth.requestDevice({
filters:
[
{ name: 'BT05' },
{ services: [0xFFE0] },
]
})
Didn't return the expected devices
If I run the following page served from githack, click the Connect to Puck.js
button, and then click Toggle LED
you can see a connected Puck.js have the LED turn full white and then get the title error message:
Device disconnected: The connection has timed out unexpectedly
Looking at the writeValue function in my application I am aware that the value that is passed in is a Uint8Array TypedArray that is a view on a much larger buffer from a WebAssembly module's memory.
If I create a copy of the Uint8Array so that it has it's own much smaller buffer before passing it to WebBLE's implementation of writeValue then no error occurs and the buffer passes through correctly.
My guess is that passing a TypedArray view to the underlying WebAssembly modules memory is not behaving well in the WebBluetooth polyfill implementation.
The following change shows the change to a copy of the buffer that avoids the error: rajsite/webvi-experiments@95fce84
Should be possible to hide the nav bar and the URL search field so that the current webpage can use the whole screen.
This is particularly useful for devices where you don't know the service UUID in advance.
Straightforward bug.
First of all, great browser thank you ! I need to use the function getCharacteristics() to get all the characteristic from a specified service. But only getCharacteristic is supported.
thanks
This is likely a big task so it is unlikely that I will get round to it unless anyone can help sponsor it.
Currently geolocation doesn't work, hopefully just need to add a privacy request for it so people can allow WebBLE to access the location services.
So that you can use a webcam using normal javascript APIs from within WebBLE.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.