Web Bluetooth on Chrome for Android is not finding any devices - javascript

I'm trying to use the new navigator.bluetooth Web Bluetooth APIs to connect to an older Bluetooth device, however using the requestDevice({acceptAllDevices: true}) method seems to not working.
According to the docs, it should show all of the bluetooth devices without any filters, but the Chrome beta on Android is not picking up any devices whatsoever, as seen in the picture.
I'm using the Web Bluetooth Terminal with the modified mentioned method above, and getting zero luck in listing any devices.
My device is not BLE, and I'm trying to use the SerialPort "SPP" profile similar to this question, which I believe has the UUID of 0x1101 or 00001101-0000-1000-8000-00805f9b34fb.
How do I list the nearby or paired Bluetooth devices on Chrome mobile for Android?(Additional Info: Chrome 56 on Android 6.0, the Bluetooth device is a HC-05 module - tested and confirmed working correctly with a dozen of Android Bluetooth terminal apps.)

Web Bluetooth supports only Bluetooth Low Energy devices for now. You won't be able to connect to Bluetooth Classic devices with this Web API.

Related

How to check if any bluetooth device is connected in react native

I've been attempting to detect whether a bluetooth device is connected to an android phone once a button is clicked. If detected, I would like to interact with this device from within my app. The device I'm talking about is http://www.senanetworks.com/sd1000-01.html .
I've used the example code of https://www.npmjs.com/package/react-native-ble-manager to test it out, but unfortunately, it's not picking up this device even though the regular settings app does. Additionally, checking for already connected peripherals does not work if I connected to the device outside of the app. Any tips on how to do this?
The device you are using, the Parani-SD1000 Bluetooth Serial Adapter, does state in its specs that it uses Bluetooth 2.0. You are using a library for Bluetooth Low Energy devices, but BLE was only introduced with Bluetooth 4.0.
Your devices definitely uses Bluetooth Classic (also nown as Bluetooth Serial), thats also the reason why it shows up in the settings of your mobile phone. You need to use a library like react-native-bluetooth-serial. You can use the isConnected() method to detect wether or not it is connected.

Web Bluetooth cannot detect my Mobile phone (Galaxy Note 9)

I am testing web blue tooth through
https://whatwebcando.today/bluetooth.html
one of the use cases there is from the browser, it should be able to detect BLE devices and extract the battery service, which should provide a facility to determine battery level of bluetooth connected device,
However during scanning, the site cannot detect my mobile phone, I have read that Web bluetooth only supports BLE
is this compatibility issues? Upon reading i see that Blue tooth 5 of galaxy note9 is supports BLE or am i wrong?
As far as I know, Galaxy Note 9 supports BLE. As per to the documentation, even though the Web Bluetooth API specification is not finalized yet, the Google Chrome team still in progress for the implementation. It is suggested to use the navigator.bluetooth.requestDevice function that takes a mandatory Object that defines filters. These filters are used to return only devices that match some advertised Bluetooth GATT services and/or the device name. From this, you can check if your device is compatible with Web Bluetooth API specification.
Your phone does not advertise BLE packets automatically. You should have an app that starts BLE advertising.
Your Phone needs to simulate a BLE device and send advertisements of the specific service. In this case the batter_service.
You can use the BLE Peripheral Simulater for testing

Using Web MIDI API on Android Chrome 52

I have worked successfully with Web MIDI API and Chrome 52 on my Mac laptop - for example recognizing connected MIDI instruments. But Web MIDI API does not seem to work or recognize connected instruments when I use Chrome 52 in my Samsung Galaxy S5 running Android 5.0.1. I've tried, for example, Web MIDI API tests online like this one, unsuccessfully (all of which work fine on the laptop).
Native apps do recognize my MIDI devices just find in my Galaxy phone - they are connected via a working USB OTG cable. But Chrome (or Opera) are not. Any help will be appreciated. I've tried Chrome Dev and Chrome Beta, same result. I wonder if the problem is the phone, or perhaps the Android version?
UPDATE: I have also tried with an Android tablet of different brand and Android 6.0 (Marshmallow). The result is the same: navigator.requestMIDIAccess() is successful (it invokes the success callback with the midiAccess object as expected), but midiAccess has no inputs or outputs, even though a device is connected. The same tablet recognizes the device when using a native app.
UPDATE 2: Success! The problem was the electronic piano I was using to test. For some reason my laptop Chrome did find my Yamaha piano, but Android Chrome did not (they are the same version of chrome). I moved to another keyboard (a newer Roland piano) and now both Android Chrome and MacOS Chrome now detect it.
You must testing your devices for knowing is reading for USB Host. You can use application like that for testing : app test USB Host
If your device don't USB Host ready you can activate that with root mode.
The problem was the electronic piano I was using to test. For some reason my laptop Chrome did find my Yamaha piano, but Android Chrome did not (they are the same version of chrome). I used a different, newer keyboard (a newer Roland piano) and now both Android Chrome and MacOS Chrome now detect it.

Bluetooth or Ibeacon Scanning on Ios Safari with Javascript

Is there any way to scan ibeacons or other bluetooth 4.0 devices with javascript on ios devices?
I can get data on Chrome Desktop edition with chrome.bluetooth but i couldnt find a way to scan ble devices on browser.
I dont want to use phonegap or other frameworks. Also is there a list that ios safari supported hardware outputs? I can get accelerometer, gyro and compass but i couldnt get other datas.
Thanks

Windows Store Bluetooth

I have been looking through the MSDN docs for Windows Store apps and the only thing I found that was close to Bluetooth was the Windows.Networking.Proximity. This appears to be a class whose use is only for close proximity ie within 3-4 centimeters. The app I am developing is on a HTML5/WinJS platform.
Is there a BluetoothSocket class like there is for android? For those store developers who are not familiar with Bluetooth on android essentially you create a Bluetooth Device member variable and populate that member with the device information, which is a native java call.
That will give you a list of paired devices, and you just open a Bluetooth socket to that device and then its the standard socket operations on a in/outstream for read/write.
Do I need to do the same thing and write a C++/CX version of this and add it as a Windows Component? The key thing here is that the device I'm connecting to treats the Bluetooth as a COM port, so all I need is a stable, reliable way to read/write to this device as if I were connected to a COM port.
Looks like #JimONeil's answer predates Windows 8.1 and was indeed correct for Windows 8, when the only way to have custom communication with BT device would be to create so called "Device App".
As of Windows 8.1 there is a simplified API which allows for easier (as OP describes "Android style") communication with BT devices.
Here's the quote from MSDN docs for "New Windows 8.1 APIs":
For Windows 8.1, Windows Store apps can use the new RFCOMM and GATT
(Generic Attribute Profile) Windows Runtime APIs to access Bluetooth
devices. These APIs provide access to the Bluetooth BR/EDR and
Bluetooth LE transports.
There're also few good sample projects:
Heart Rate Device (C++/ C# and JavaScript)
Bluetooth Chat (C++/ C# and JavaScript)
Per this MSDN Forum article, there isn't a generalized Bluetooth stack available for Windows Store applications.
As the thread indicates, there is only a Bluetooth Call Control sample and
If a device manufacturer needs to use Bluetooth as part of their
device, they can provide a driver and metadata for a Store app to use
it.
Information here:
http://msdn.microsoft.com/en-us/library/windows/apps/hh464909.aspx

Categories