2019-03-06 22:37:50

by Barry Byford

[permalink] [raw]
Subject: Peripheral notifications not showing up

Hello,

I have a system that comes with BlueZ 5.43 installed on a single board
computer (SBC). I have downloaded, built and installed various newer
versions of BlueZ but I am having problems getting them working
correctly.

I have a peripheral (very similar to the gatt server example in the
test directory) with one characteristic. My example was working before
upgrading. However after upgrading, when I turn on notification for
the characteristic it is not showing on the phone.

I do see the notification turn up in dbus-monitor but not in btmon.

signal time=1551910979.743011 sender=:1.38 -> destination=(null
destination) serial=339 path=/ukBaz/bluezero/service0001/char0001;
interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.GattCharacteristic1"
array [
dict entry(
string "Value"
variant array of bytes [
78 14
]
)
]
array [
]

I have tried going back to version 5.43 again but now that is not
working either.

The configure I ran was:
./configure --prefix=/usr \
--mandir=/usr/share/man \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-experimental \
--enable-maintainer-mode


To get configure to work without error I needed to install the following:
sudo apt install glib2.
sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-dev

I have tried various variations on this and done a lot of searching
but don't seem to find an answer.
Is anyone else seeing this issue?
Anyone have any suggestions as what I could try?

Thanks in advance,
Barry


2019-03-08 21:18:07

by Barry Byford

[permalink] [raw]
Subject: Re: Peripheral notifications not showing up

I have tried the same experiment on a Raspberry Pi.

$ uname -a
Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018
armv7l GNU/Linux

I ran the peripheral code I have and it worked fine on the Raspberry
Pi. I then rebuilt BlueZ 5.43 and reinstalled it and I see the same
issue with getting notificatins.
That is, reading of the characteristic in the Nordic nRF app on my
phone works. However, when I activate notifications I can see the
status change on the peripheral and the notifications show up on the
DBus. The notifications just don't show up in btmon or on my phone.

Does anyone have any suggestions of how I can debug this?

Thanks,
Barry


On Wed, 6 Mar 2019 at 22:37, Barry Byford <[email protected]> wrote:
>
> Hello,
>
> I have a system that comes with BlueZ 5.43 installed on a single board
> computer (SBC). I have downloaded, built and installed various newer
> versions of BlueZ but I am having problems getting them working
> correctly.
>
> I have a peripheral (very similar to the gatt server example in the
> test directory) with one characteristic. My example was working before
> upgrading. However after upgrading, when I turn on notification for
> the characteristic it is not showing on the phone.
>
> I do see the notification turn up in dbus-monitor but not in btmon.
>
> signal time=1551910979.743011 sender=:1.38 -> destination=(null
> destination) serial=339 path=/ukBaz/bluezero/service0001/char0001;
> interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
> string "org.bluez.GattCharacteristic1"
> array [
> dict entry(
> string "Value"
> variant array of bytes [
> 78 14
> ]
> )
> ]
> array [
> ]
>
> I have tried going back to version 5.43 again but now that is not
> working either.
>
> The configure I ran was:
> ./configure --prefix=/usr \
> --mandir=/usr/share/man \
> --sysconfdir=/etc \
> --localstatedir=/var \
> --enable-experimental \
> --enable-maintainer-mode
>
>
> To get configure to work without error I needed to install the following:
> sudo apt install glib2.
> sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-dev
>
> I have tried various variations on this and done a lot of searching
> but don't seem to find an answer.
> Is anyone else seeing this issue?
> Anyone have any suggestions as what I could try?
>
> Thanks in advance,
> Barry

2019-03-12 13:12:07

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Peripheral notifications not showing up

Hi Barry,

On Fri, Mar 8, 2019 at 11:20 PM Barry Byford <[email protected]> wrote:
>
> I have tried the same experiment on a Raspberry Pi.
>
> $ uname -a
> Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018
> armv7l GNU/Linux
>
> I ran the peripheral code I have and it worked fine on the Raspberry
> Pi. I then rebuilt BlueZ 5.43 and reinstalled it and I see the same
> issue with getting notificatins.
> That is, reading of the characteristic in the Nordic nRF app on my
> phone works. However, when I activate notifications I can see the
> status change on the peripheral and the notifications show up on the
> DBus. The notifications just don't show up in btmon or on my phone.

Perhaps is being blocked somehow, you got the StartNotification I
suppose? Please make sure the object path matches otherwise it won't
work, you may also check how bluetoothctl does handle notifications
since that has been working for a while.

> Does anyone have any suggestions of how I can debug this?

The usual btmon traces and bluetoothd debug logs are normally a good
idea to share since there could be some bug, though Ive been testing
this regularly with bluetoothctl and that has been stable for a while,
at least on master that is.

> Thanks,
> Barry
>
>
> On Wed, 6 Mar 2019 at 22:37, Barry Byford <[email protected]> wrote:
> >
> > Hello,
> >
> > I have a system that comes with BlueZ 5.43 installed on a single board
> > computer (SBC). I have downloaded, built and installed various newer
> > versions of BlueZ but I am having problems getting them working
> > correctly.
> >
> > I have a peripheral (very similar to the gatt server example in the
> > test directory) with one characteristic. My example was working before
> > upgrading. However after upgrading, when I turn on notification for
> > the characteristic it is not showing on the phone.
> >
> > I do see the notification turn up in dbus-monitor but not in btmon.
> >
> > signal time=1551910979.743011 sender=:1.38 -> destination=(null
> > destination) serial=339 path=/ukBaz/bluezero/service0001/char0001;
> > interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
> > string "org.bluez.GattCharacteristic1"
> > array [
> > dict entry(
> > string "Value"
> > variant array of bytes [
> > 78 14
> > ]
> > )
> > ]
> > array [
> > ]
> >
> > I have tried going back to version 5.43 again but now that is not
> > working either.
> >
> > The configure I ran was:
> > ./configure --prefix=/usr \
> > --mandir=/usr/share/man \
> > --sysconfdir=/etc \
> > --localstatedir=/var \
> > --enable-experimental \
> > --enable-maintainer-mode
> >
> >
> > To get configure to work without error I needed to install the following:
> > sudo apt install glib2.
> > sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-dev
> >
> > I have tried various variations on this and done a lot of searching
> > but don't seem to find an answer.
> > Is anyone else seeing this issue?
> > Anyone have any suggestions as what I could try?
> >
> > Thanks in advance,
> > Barry



--
Luiz Augusto von Dentz

2019-03-17 22:03:05

by Barry Byford

[permalink] [raw]
Subject: Re: Peripheral notifications not showing up

Hi Luiz,

Thanks for taking a look at this.

On Tue, 12 Mar 2019 at 13:12, Luiz Augusto von Dentz
<[email protected]> wrote:
>
> Hi Barry,
>
> On Fri, Mar 8, 2019 at 11:20 PM Barry Byford <[email protected]> wrote:
> >
> > I have tried the same experiment on a Raspberry Pi.
> >
> > $ uname -a
> > Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018
> > armv7l GNU/Linux
> >
> > I ran the peripheral code I have and it worked fine on the Raspberry
> > Pi. I then rebuilt BlueZ 5.43 and reinstalled it and I see the same
> > issue with getting notificatins.
> > That is, reading of the characteristic in the Nordic nRF app on my
> > phone works. However, when I activate notifications I can see the
> > status change on the peripheral and the notifications show up on the
> > DBus. The notifications just don't show up in btmon or on my phone.
>
> Perhaps is being blocked somehow, you got the StartNotification I
> suppose? Please make sure the object path matches otherwise it won't
> work, you may also check how bluetoothctl does handle notifications
> since that has been working for a while.

My code is working with the default installation of BlueZ that is on
the board. The issue is when I build a version of BlueZ on the board
myself.
This leads me to believe it is not the code I'm running.



>
> > Does anyone have any suggestions of how I can debug this?
>
> The usual btmon traces and bluetoothd debug logs are normally a good
> idea to share since there could be some bug, though Ive been testing
> this regularly with bluetoothctl and that has been stable for a while,
> at least on master that is.
>

Here are the logs.
https://gist.github.com/ukBaz/b8317f2d76acc6dbf844c2713555974e
To my untrained eye it looks like the notification is started but it
never shows up. In the dbus-monitor output below, the notifications
are on the dbus. I can't tell where they are going missing between the
dbus and bluetoothd.


> > Thanks,
> > Barry
> >
> >
> > On Wed, 6 Mar 2019 at 22:37, Barry Byford <[email protected]> wrote:
> > >
> > > Hello,
> > >
> > > I have a system that comes with BlueZ 5.43 installed on a single board
> > > computer (SBC). I have downloaded, built and installed various newer
> > > versions of BlueZ but I am having problems getting them working
> > > correctly.
> > >
> > > I have a peripheral (very similar to the gatt server example in the
> > > test directory) with one characteristic. My example was working before
> > > upgrading. However after upgrading, when I turn on notification for
> > > the characteristic it is not showing on the phone.
> > >
> > > I do see the notification turn up in dbus-monitor but not in btmon.
> > >
> > > signal time=1551910979.743011 sender=:1.38 -> destination=(null
> > > destination) serial=339 path=/ukBaz/bluezero/service0001/char0001;
> > > interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
> > > string "org.bluez.GattCharacteristic1"
> > > array [
> > > dict entry(
> > > string "Value"
> > > variant array of bytes [
> > > 78 14
> > > ]
> > > )
> > > ]
> > > array [
> > > ]
> > >
> > > I have tried going back to version 5.43 again but now that is not
> > > working either.
> > >
> > > The configure I ran was:
> > > ./configure --prefix=/usr \
> > > --mandir=/usr/share/man \
> > > --sysconfdir=/etc \
> > > --localstatedir=/var \
> > > --enable-experimental \
> > > --enable-maintainer-mode
> > >
> > >
> > > To get configure to work without error I needed to install the following:
> > > sudo apt install glib2.
> > > sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-dev
> > >
> > > I have tried various variations on this and done a lot of searching
> > > but don't seem to find an answer.
> > > Is anyone else seeing this issue?
> > > Anyone have any suggestions as what I could try?
> > >
> > > Thanks in advance,
> > > Barry
>
>
>
> --
> Luiz Augusto von Dentz

2019-03-18 22:17:31

by Barry Byford

[permalink] [raw]
Subject: Re: Peripheral notifications not showing up

This seems to be a permissions issue. If I run my script with sudo
then it works.

Not quite sure why the build and install is changing the permissions required.

Any thoughts?

On Sun, 17 Mar 2019 at 22:02, Barry Byford <[email protected]> wrote:
>
> Hi Luiz,
>
> Thanks for taking a look at this.
>
> On Tue, 12 Mar 2019 at 13:12, Luiz Augusto von Dentz
> <[email protected]> wrote:
> >
> > Hi Barry,
> >
> > On Fri, Mar 8, 2019 at 11:20 PM Barry Byford <[email protected]> wrote:
> > >
> > > I have tried the same experiment on a Raspberry Pi.
> > >
> > > $ uname -a
> > > Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018
> > > armv7l GNU/Linux
> > >
> > > I ran the peripheral code I have and it worked fine on the Raspberry
> > > Pi. I then rebuilt BlueZ 5.43 and reinstalled it and I see the same
> > > issue with getting notificatins.
> > > That is, reading of the characteristic in the Nordic nRF app on my
> > > phone works. However, when I activate notifications I can see the
> > > status change on the peripheral and the notifications show up on the
> > > DBus. The notifications just don't show up in btmon or on my phone.
> >
> > Perhaps is being blocked somehow, you got the StartNotification I
> > suppose? Please make sure the object path matches otherwise it won't
> > work, you may also check how bluetoothctl does handle notifications
> > since that has been working for a while.
>
> My code is working with the default installation of BlueZ that is on
> the board. The issue is when I build a version of BlueZ on the board
> myself.
> This leads me to believe it is not the code I'm running.
>
>
>
> >
> > > Does anyone have any suggestions of how I can debug this?
> >
> > The usual btmon traces and bluetoothd debug logs are normally a good
> > idea to share since there could be some bug, though Ive been testing
> > this regularly with bluetoothctl and that has been stable for a while,
> > at least on master that is.
> >
>
> Here are the logs.
> https://gist.github.com/ukBaz/b8317f2d76acc6dbf844c2713555974e
> To my untrained eye it looks like the notification is started but it
> never shows up. In the dbus-monitor output below, the notifications
> are on the dbus. I can't tell where they are going missing between the
> dbus and bluetoothd.
>
>
> > > Thanks,
> > > Barry
> > >
> > >
> > > On Wed, 6 Mar 2019 at 22:37, Barry Byford <[email protected]> wrote:
> > > >
> > > > Hello,
> > > >
> > > > I have a system that comes with BlueZ 5.43 installed on a single board
> > > > computer (SBC). I have downloaded, built and installed various newer
> > > > versions of BlueZ but I am having problems getting them working
> > > > correctly.
> > > >
> > > > I have a peripheral (very similar to the gatt server example in the
> > > > test directory) with one characteristic. My example was working before
> > > > upgrading. However after upgrading, when I turn on notification for
> > > > the characteristic it is not showing on the phone.
> > > >
> > > > I do see the notification turn up in dbus-monitor but not in btmon.
> > > >
> > > > signal time=1551910979.743011 sender=:1.38 -> destination=(null
> > > > destination) serial=339 path=/ukBaz/bluezero/service0001/char0001;
> > > > interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
> > > > string "org.bluez.GattCharacteristic1"
> > > > array [
> > > > dict entry(
> > > > string "Value"
> > > > variant array of bytes [
> > > > 78 14
> > > > ]
> > > > )
> > > > ]
> > > > array [
> > > > ]
> > > >
> > > > I have tried going back to version 5.43 again but now that is not
> > > > working either.
> > > >
> > > > The configure I ran was:
> > > > ./configure --prefix=/usr \
> > > > --mandir=/usr/share/man \
> > > > --sysconfdir=/etc \
> > > > --localstatedir=/var \
> > > > --enable-experimental \
> > > > --enable-maintainer-mode
> > > >
> > > >
> > > > To get configure to work without error I needed to install the following:
> > > > sudo apt install glib2.
> > > > sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-dev
> > > >
> > > > I have tried various variations on this and done a lot of searching
> > > > but don't seem to find an answer.
> > > > Is anyone else seeing this issue?
> > > > Anyone have any suggestions as what I could try?
> > > >
> > > > Thanks in advance,
> > > > Barry
> >
> >
> >
> > --
> > Luiz Augusto von Dentz