Scanning not working on Windows

1,079 views
Skip to first unread message

gadj...@gmail.com

unread,
Mar 25, 2018, 5:52:39 PM3/25/18
to web-bluetooth
I cannot get Chrome to scan for devices on my Windows 10 PC (Windows surface book). However my application is working on an Andriod phone using Chrome. In Windows I have enabled the Experimental Web Platform features in Chrome on the Windows PC and Bluetooth is enabled on my laptop. The BLE device (ESP-32) is discoverable through the Windows "Add a device" function so I know the PC can see my device. When my application calls the requestDevice function there is a popup in Chrome that comes up with "xyz website wants to pair" and there is a "Pair" and "Cancel" button at the bottom but no devices ever appear in the list and it times out after 60 seconds. I get the same results using the chrome://bluetooth-internals/#devices scan.

Any ideas what I could try next?




Application code:

$(function(){
var requestDeviceParms = {
filters: [
{
name: ["MyESP32"]
}
],
optionalServices: ["4fafc201-1fb5-459e-8fcc-c5c9c331914b"]
};
const options = { acceptAllDevices: true };
$("#test").click(() => {
console.log("Running VLE Code");
$("#notifiedValue").text("Connecting");
navigator.bluetooth.requestDevice(options).then(device => {
$("#notifiedValue").text("Requesting connections...");
device.gatt.connect().then(gattServer=>{
gattServer.getPrimaryService("4fafc201-1fb5-459e-8fcc-c5c9c331914b").then(gattService=>{
gattService.getCharacteristic("beb5483e-36e1-4688-b7f5-ea07361b26a8").then(gattCharacteristic=>{
gattCharacteristic.startNotifications().then(gattCharacteristic=>{
gattCharacteristic.addEventListener("characteristicvaluechanged", event=>{
var value = event.target.value.getUint8(0);
$("#notifiedValue").text("" + value);
});
})
.catch(error => { $("#notifiedValue").text(error); });
})
.catch(error => { $("#notifiedValue").text(error); });
})
.catch(error => { $("#notifiedValue").text(error); });
})
.catch(error => { $("#notifiedValue").text(error); });
})
.catch(error => { $("#notifiedValue").text(error); });
});
});


Giovanni Ortuño

unread,
Mar 25, 2018, 6:18:04 PM3/25/18
to gadj...@gmail.com, web-bluetooth

Hi!

Our implementation of Web Bluetooth on Windows is currently based on the Windows 8 APIs. There was no API for scanning on Windows 8 so we can't initiate the scanning ourselves. To interact with the device from Chrome, you first have to pair with the device using the Windows pairing menu. After that, Chrome will be able to find the device.

Hope that helps,

Gio

--
You received this message because you are subscribed to the Google Groups "web-bluetooth" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-bluetoot...@chromium.org.
To post to this group, send email to web-bl...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/web-bluetooth/91b5623b-9730-4fc0-8acd-a1d5ace257be%40chromium.org.
Message has been deleted
Message has been deleted
Message has been deleted

Conley Owens

unread,
Mar 28, 2018, 6:21:48 PM3/28/18
to gadj...@gmail.com, web-bluetooth


On Mon, Mar 26, 2018 at 2:58 PM, <gadj...@gmail.com> wrote:
Are you saying it wont work on Windows 10...only Windows 8?

No, it should also work on Windows 10.
 

I paired the device using the Windows Bluetooth menu (no problems there), but Chrome still pops up the "xyz website wants to pair" popup and scans forever.

The appearance of scanning is not surprising.  We are essentially continually asking Windows for newly paired devices...which, admittedly isn't well-communicated by the word "scanning".

However, the fact that your device isn't being listed is surprising if you are paired through the Windows Bluetooth settings menu and your device is being listed on other platforms.  What version of Chrome are you running?
 
If scanning doesn't work on Windows 8 api then why is Chrome trying to scan? Shouldn't it just connect directly to the device specified in my deviceRequest parameters?
To unsubscribe from this group and stop receiving emails from it, send an email to web-bluetooth+unsubscribe@chromium.org.

To post to this group, send email to web-bl...@chromium.org.

Gadjet Nut

unread,
Mar 28, 2018, 7:19:06 PM3/28/18
to web-bluetooth, gadj...@gmail.com
>>  What version of Chrome are you running?

My Chrome Version:  Version 65.0.3325.181 (Official Build) (64-bit)

Conley Owens

unread,
Mar 28, 2018, 7:27:15 PM3/28/18
to Gadjet Nut, web-bluetooth
65 should be fine.  Is there another device you could try to pair with through Windows Bluetooth settings and then scan with chrome://bluetooth-internals/#devices?  I'm curious if something we (or Windows) is doing is specific to the device.

To unsubscribe from this group and stop receiving emails from it, send an email to web-bluetooth+unsubscribe@chromium.org.

To post to this group, send email to web-bl...@chromium.org.

Gadjet Nut

unread,
Mar 28, 2018, 9:28:58 PM3/28/18
to web-bluetooth, gadj...@gmail.com, cc...@google.com
Good idea. I paired with my FitBit and did the scan but nothing shows up. I recorded a video of it:

Conley Owens

unread,
Mar 29, 2018, 12:46:35 PM3/29/18
to Gadjet Nut, web-bluetooth
Thanks for the video!
Are you sure that you have the flag enabled?
chrome://flags/#enable-experimental-web-platform-features

I wouldn't expect the chooser to come up if you didn't, but worth checking anyway.

Gadjet Nut

unread,
Mar 29, 2018, 7:36:57 PM3/29/18
to web-bluetooth, gadj...@gmail.com, cc...@google.com
Yes, it's enabled, see attached pic. Let me know if there are any other settings or logs I can share.

Conley Owens

unread,
Apr 2, 2018, 5:44:08 PM4/2/18
to Gadjet Nut, web-bluetooth
Thank you.  Sorry this issue keeps persisting.

Can you try running with --enable-logging --v=1?  Why have some logging in place that may provide helpful.  I'd be looking for any repeated warning when scanning.

I'm also interested in knowing what Bluetooth Internals reports about your adapter: 
chrome://bluetooth-internals/#adapter

Gadjet Nut

unread,
Apr 7, 2018, 9:30:46 AM4/7/18
to web-bluetooth, gadj...@gmail.com, cc...@google.com
Here is the logging for both tests:

My Web Bluetooth application:

extension://fahmaaghhglfmonjliepjlchgpgfmobi/background.js (33)
[17232:4736:0407/092226.958:WARNING:syncer_proto_util.cc(338)] Error posting from syncer: Response Code (bogus on error): -1 Content-Length (bogus on error): -1 Server Status: SYNC_AUTH_ERROR
[17232:14736:0407/092227.744:INFO:CONSOLE(0)] "End of init", source: chrome-extension://fahmaaghhglfmonjliepjlchgpgfmobi/_generated_background_page.html (0)
[17232:14736:0407/092228.881:INFO:CONSOLE(0)] "Starting AccountSession", source: chrome-extension://fahmaaghhglfmonjliepjlchgpgfmobi/_generated_background_page.html (0)
[17232:4904:0407/092230.148:WARNING:spdy_session.cc(2991)] Received HEADERS for invalid stream 25
[17232:14736:0407/092237.162:INFO:CONSOLE(14)] "Running VLE Code", source: https://www.deletedthisurl.com/esp32/notify.js (14)
[17232:14736:0407/092237.163:INFO:CONSOLE(16)] "Uncaught TypeError: Cannot read property 'requestDevice' of undefined", source: https://www.deletedthisurl.com/esp32/notify.js (16)

Results from chrome://bluetooth-internals/#adapter:

[17232:15788:0407/092730.073:WARNING:bluetooth_task_manager_win.cc(345)] FILE_ERROR_FAILED
[17232:14736:0407/092730.093:ERROR:bluetooth_adapter_win.cc(93)] NOT IMPLEMENTED
[17232:15788:0407/092730.648:WARNING:bluetooth_task_manager_win.cc(345)] FILE_ERROR_FAILED
[17232:15788:0407/092731.198:WARNING:bluetooth_task_manager_win.cc(345)] FILE_ERROR_FAILED
[17232:15788:0407/092731.763:WARNING:bluetooth_task_manager_win.cc(345)] FILE_ERROR_FAILED
[17232:15788:0407/092732.310:WARNING:bluetooth_task_manager_win.cc(345)] FILE_ERROR_FAILED
[17232:15788:0407/092732.884:WARNING:bluetooth_task_manager_win.cc(345)] FILE_ERROR_FAILED
[17232:15788:0407/092733.438:WARNING:bluetooth_task_manager_win.cc(345)] FILE_ERROR_FAILED
[17232:15788:0407/092733.983:WARNING:bluetooth_task_manager_win.cc(345)] FILE_ERROR_FAILED

Conley Owens

unread,
Apr 19, 2018, 1:07:26 PM4/19/18
to Gadjet Nut, web-bluetooth
Thank you for the logs.  Unfortunately, they don't tell me as much as I'd like.  I've added more logging which should be available in a canary build of chrome.
Reply all
Reply to author
Forward
0 new messages