Re: low energy: does gatt client/server work in current version? How to test?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> > > My attempt at launching server is below (using python gatt-server, (1)
> > > ). I was doing "hciconfig leadv 0" manually at some point.
> > >
> > > Using hciconfig while bluetoothd is running sounds kind-of
> > > dangerous. Stackoverflow (2) suggests using btmgmt (3) instead, and
> > > things got slightly different, but did not start to work for me. Is
> > > there documentation how to get this to work somewhere?
> 
> Have a look at bluetoothctl first, all the necessary commands are
> there to enable to act as peripheral:

And indeed it does, and it does work when done this way.

> > > (3)
> > > sudo tools/btmgmt -i hci0 power off
> > > sudo tools/btmgmt -i hci0 le on
> > > sudo tools/btmgmt -i hci0 connectable on
> > > sudo tools/btmgmt -i hci0 name "some friendly name"
> > > sudo tools/btmgmt -i hci0 advertising on
> > > sudo tools/btmgmt -i hci0 power on
> > > tools/btgatt-server -i hci0 -s low -t public -r -v
> 
> No need to use btmgmt, applications should use the D-Bus API which has
> pretty much everything you are doing with btmgmt.

Yes, that works, thanks.

As far as I understand, with bluetoothd running, neither btmgmt nor
hciconfig should be used. Unfortunately they are easy to find and
"seem" to work.

[bluetooth]# agent KeyboardDisplay
Agent is already registered
[bluetooth]# info FC:CE:56:3B:D1:6C
Device FC:CE:56:3B:D1:6C not available
[NEW] Device FC:CE:56:3B:D1:6C FC-CE-56-3B-D1-6C
[FC-CE-56-3B-D1-6C]# info FC:CE:56:3B:D1:6C
Device FC:CE:56:3B:D1:6C (random)
	Alias: FC-CE-56-3B-D1-6C
	Paired: no
	Trusted: no
	Blocked: no
	Connected: yes
	LegacyPairing: no
[FC-CE-56-3B-D1-6C]# pair FC:CE:56:3B:D1:6C
Attempting to pair with FC:CE:56:3B:D1:6C
Request passkey
[agent] Enter passkey (number in 0-999999): 000000
[FC-CE-56-3B-D1-6C]# info FC:CE:56:3B:D1:6C
Device FC:CE:56:3B:D1:6C (random)
	Alias: FC-CE-56-3B-D1-6C
	Paired: no
	Trusted: no
	Blocked: no
	Connected: yes
	LegacyPairing: no
[FC-CE-56-3B-D1-6C]# pair FC:CE:56:3B:D1:6C

If I retry the pairing, nothing happens:

[FC-CE-56-3B-D1-6C]# pair FC:CE:56:3B:D1:6C
Attempting to pair with FC:CE:56:3B:D1:6C

If I retry, it is busy:

[FC-CE-56-3B-D1-6C]# pair FC:CE:56:3B:D1:6C
Attempting to pair with FC:CE:56:3B:D1:6C
Failed to pair: org.bluez.Error.InProgress
Failed to pair: org.freedesktop.DBus.Error.NoReply
Failed to pair: org.freedesktop.DBus.Error.NoReply

I tried power cycling the device, re-connect and re-pair.

[CHG] Device FC:CE:56:3B:D1:6C Connected: no
[bluetooth]#
[CHG] Device FC:CE:56:3B:D1:6C Connected: no
[CHG] Device FC:CE:56:3B:D1:6C Connected: yes
[FC-CE-56-3B-D1-6C]# pair FC:CE:56:3B:D1:6C
Attempting to pair with FC:CE:56:3B:D1:6C
[FC-CE-56-3B-D1-6C]# info FC:CE:56:3B:D1:6C
Device FC:CE:56:3B:D1:6C (random)
	Alias: FC-CE-56-3B-D1-6C
	Paired: no
	Trusted: no
	Blocked: no
	Connected: yes
	LegacyPairing: no
[FC-CE-56-3B-D1-6C]# pair FC:CE:56:3B:D1:6C
Attempting to pair with FC:CE:56:3B:D1:6C
Failed to pair: org.bluez.Error.InProgress
[FC-CE-56-3B-D1-6C]# 

Which does not work :-(.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux