The pairing process on Windows 10 will not result in establishing a successful connection on Android when Android device plays the peripheral role. The pairing process which is directly handled by the OSs on both sides (regardless of which services you are advertising) is being failed during updating the connection parameters such as Interval, Latency, and Timeout.
It seems both sides are looking for different settings on the connection. We recently tried to simulate another peripheral device using the NRFconnect android app by advertising a battery service for example. The connection will be dropped immediately after failing on compromising on the connection parameter settings. See the attached log files for the NRFConnect words, announcing why the connection is being terminated when it works with Windows. Just for the record, there is no problem when we change the central with another Android device.
Related
Trying to connect an Android phone to a somewhat unusual, nonstandard BLE device (a blood pressure monitor). Data points:
My program connects and reads other BLE devices fine.
My program sees the device in a BLE scan, but won't connect. Instead I get an immediate "Disconnected" status with a generic GATT_ERROR (status code 0x85).
Nordic's Android BLE scanner app will connect and read/write the device.
The device uses an unknown Service (FFF0) with one characteristic (FFF1) for notifications from the device and another (FFF2) to write commands to it.
The TI BLE packet sniffer software seems to indicate that no connection request is ever sent to the device.
Here's what I've observed with the Nordic scanner app:
When you turn the device on, it advertises and the app can connect to it. If you then enable Notifications on FFF1, you receive a byte 0xA5; this is per the device spec, which says it sends this byte every 500 ms. The (rather rudimentary) docs say this is "waiting for the connection" but obviously it is already connected.
If you then write the specified "start" command string to FFF2, it starts taking a reading and appears to perform correctly.
The Nordic app can connect; why can't mine?
Update: have verified that the Nordic app works on the same Android phone that is running my program.
I'm developing an Android Things app (Dev Preview 6.1, Raspberry Pi) with a GATT server. When a connected client app disconnects, my device has stopped advertising. However, the custom client app (out of my control) is written in such a way that it needs to disconnect between reads/writes, then reconnect.
I know that I can restart advertising upon disconnect, but since it has a new (pseudo-)MAC address, the client can't automatically reconnect.
FWIW, I see the same behavior in this sample (& using nRF Connect as a test clinet): https://github.com/androidthings/sample-bluetooth-le-gattserver
Is there way to keep the GATT server advertising in this case? Or can I specify the advertised device address so that I can keep it consistent across advertisements?
It turns out this is a known bug in Android Things: https://issuetracker.google.com/issues/70269277
I'm developing 2 Android BLE applications. One app will serve as the peripheral role and the other app will serve as the central role. On the peripheral app, there is one encrypted characteristic with PROPERTY_WRITE and PERMISSION_WRITE_ENCRYPTED.
The central app is able to connect to the peripheral and discover its services. The first time that central attempts to write to the encrypted characteristic, the system begins the bonding process and a dialog for entering the PIN appears. After the PIN is entered correctly, the characteristic can be written to successfully. If the central disconnects from the peripheral and then attempts to reconnect, a connection is briefly established but then disconnected. The onConnectionStateChange callback is received on the peripheral with a status of STATE_CONNECTED and then immediately called again with a status of STATE_DISCONNECTED.
Unless I manually unpair the devices (from the Bluetooth settings) and then start the connection process again, the central is unable to connect to the peripheral.
I've tried this solution but it did not work for me.
BLE Device Bonding Remove Automatically in Android
Both apps are running on devices with Android 5.
This issue seems to be resolved in Android 5.1.1. Originally, I was running the peripheral app on a Samsung Galaxy Tab A with Android 5.0.2. I switched to a Nexus 9 running 5.1.1 and 6.0.1 and did not encounter the issue described above.
I am implementing Bluetooth Low Energy's HID over GATT (HOGP) profile on Android Lollipop. My target is to use the phone as a keyboard/mouse, which can just plug and play with the default BLE (HID) drivers in Windows 8.1 laptop. The Android phone is supposed to act as BLE peripheral and the laptop should be in BLE central role.
Currently, I am able to establish a very short connection with the laptop. But just right after I enter the passkeys, and bonded successfully with the laptop, the BLE connection will be lost. Have anyone faced this kind of problems before? Or have any solutions on it?
Also, I failed to add generic access service to the gatt server in Android. I am curious if GAP service is included in Android BLE communication by nature? The reason I want to include this service is for defining the "device name", "appearance", and the "peripheral connection parameter update" characteristics. How I can do so?
Did you get your system fixed, I am seeing something kind of similar, where after bonding, my device will go to paired list, then about 20 sec later, the bluetooth on /off button will automatically switch to off position, wait 10 sec, then back
to on position, and my device is gone..
Here's our situation. We have a machine vending machine run in peripheral mode and mobile runs in central mode. When the mobile is close to the vending machine, it triggers the connection and start to communicate. But as far as I know, the peripheral mode can only connect to one device at a time just considering bluetooh 4.0, so if there's someone who wants to make a trick stands around our vending machine and connects to it all the time, no one else can connect the vending machine. Am I right?
My question is
How to avoid this situation. Is it possible for the vending machine to refuse the connection or to trigger the disconnection when it founds that the connection is invalid (triggered by other app)?
I have heard something like multipoint bluetooth. So how much can the multi be, can it be like 100 so that it may solve the problem.
I found a similar situation in paypal beacon. https://devblog.paypal.com/how-does-paypal-beacon-work/ it says the beacon is running in peripheral mode. I am wondering how do they avoid these invalid connections.
Since, the central device(mobile device) initiating connection, it will act as Master and the other end device(vending machine) will act as slave.
According to Bluetooth 4.1 specification, a slave can have multiple masters.
So, more than one mobile device can connect to the single LE device.