Re-enable Bluez advertising after connection, through d-bus interface - bluetooth-lowenergy

I have a BLE Gatt server, which is setup using the d-bus bluez interface (version 5.54).
Advertising is working using org.bluez.LEAdvertisingManager1 and can be viewed using a BLE scanner Android app.
Making a connection to the server stops the device from advertising, and it is no longer visible on a BLE scanner.
Disconnecting doesn't start advertising again.
I've seen the same issue described here, with a solution using hcitool commands.
Is there a way to re-enable advertising using the d-bus interface only?

Related

BLE device not disconnecting

I am working with BLE devices. and using nrf controller with bluez 5.4 code.
I am customizing gatttool source code so that multiple devices can connect and disconnect.
My focus part for now is how to disconnect ble device using gatttool apis.
I had found one solution in code that we can use:
g_io_channel_shutdown();
g_io_channel_unref();
These 2 APIs are use to disconnect ble device.
I am using nrf connect application in my mobile to connect generate dummy ble device so that I can perform operations.
When I use this for disconnecting device any other formalities are needed in between or only these APIs are ok?
I am not able to disconnect using these APIs.Some time it is give effect and some time it is not working.
If any one have idea abut this please respond.
Thanks in advance.
Do you mean Bluez 5.4 or Bluez 5.40? Either way, they are quite old releases.
gatttool is one of the BlueZ tools that has been deprecated in BlueZ.
Ideally you would be using the BlueZ DBus API to interact with BlueZ.
Not sure if you are creating a GATT Server (peripheral device) or GATT client (Central Device) but there are examples of both in the BlueZ source:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-gatt-server
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-gatt-client
These examples are in Python, but most languages have DBus libraries to help access the API which are documented at:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/adapter-api.txt
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/device-api.txt
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/gatt-api.txt

Raspberry Pi3 BLE only accepts a single connection

I have created a BLE peripheral that exposes a GATT service. It uses BlueZ 5.50, but it seems that only one device can connect to the GATT service. When the device is connected, then other devices can't see it anymore. It's not showing up in a scan anymore and if it was already scanned, then I can't connect to it anymore.
It seems to be a limitation or configuration issue in BlueZ, because when using the Paypal GATT library it can handle multiple connections. As far as I know, the RPi3 BLE chip should be able to handle up to 10 connections.
Does anyone know if this can be done using BlueZ?
The Paypal GATT library directly connects to the HCI device and bypasses most of the kernel stuff. BlueZ depends on kernel drivers and user-space applications and is capable if the driver reports that the controller allows multiple connections. You need a decent BLE controller and a recent kernel to make it work.
More information can be found in https://github.com/bluez/bluez/issues/12.

Is there a way to disconnect the active bluetooth device(lagacy connection) while keeping the BLE connection active with bluez?

I'm workig on an issue where my device running Linux with bluez is connected to a mobile phone over bluetooth. It also communicates to the phone over BLE with an android application. What I want is to disconnect the legacy connection while keeping the BLE connection active. I tried with org.bluez.Device1 interface with method DisconnectProfile(string uuid). Is there a way to get a list of registered UUIDs which I can use to disconnect the ones related to legacy connection while keeping the GATT profile active?

Is running HM10 on a soft-serial enable the Low Energy charecteristics ? If so, how can the UUIDs and GATT profiles be tweaked in this case ?

I've been tinkering with the HM-10 board for a few weeks now, trying to push data from phone to module and vice-versa. The ultimate goal was to enable the BLE mode and tweak with the characteristics and GATT profiles. I'm pretty new to this domain so can anyone help me out ?
And is there any way we can interface the HM-10 with the hardware rx-tx channel instead of soft-serial ?
Your question is still not very clear, but i think you mean sending AT-commands over BLE-radio.
To make this possible you have to change the MODE using serial connection.
In standard mode the device can only be configured over the serial connection (pins RXD and TXD) using AT commands.
AT+MODE0: It only accepts AT-commands over the serial connection (RXD/TXD)
until a central device connects to the module.
AT+MODE1: Same as MODE0, once a connection is established,
AT-commands can be sent over BLE and manipulate some PIO pins on
the device.
AT+MODE2: Same as MODE0, once a connection is established,
AT-commands can be sent over BLE.
To test it just send a string to hm-10 as "AT\r\n" and it will respond with OK.
Update:
You cannot change the services and characteristics with AT-commands.
There are a lot of other things you can change,like advertising, setup a beacon and change a lot of settings.
For a full list of AT commands and more see the official data sheet:
http://www.jnhuamao.cn/bluetooth41_en.zip

Testing Microchip RN4871 BLE Module with Raspberry Pi 3

I got a Microchip RN4871 BLE Module and want it to act as beacon.
So, I connected over UART and executed the following commands:
SS,20
SC,2
NB,09,656667
I am able to scan and connect to it using hcitool and gattool command. Now I want to verify whether the beacon functionality is working or not. I mean the device is periodically broadcasting Beacon packets or not..
How can I verify that.. Is there any android application which can help or can i do with raspberry pi 3 as it has in built Bluetooth Chip
There are some really nice apps from nordic for free available. I like the nrF connect app. I guess it will help you.

Resources