linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Glancy <joe.t.glancy@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: DBUS API error "Not paired" when attempting to read GATT characteristic
Date: Tue, 3 May 2016 16:38:02 +0100	[thread overview]
Message-ID: <5728C5DA.7000703@gmail.com> (raw)

Hello all.

I was wondering whether someone could possibly help shine some light on 
an issue I'm having.

Here's the setup:
  - Ubuntu 16.04 w/Bluez 5.37 (from the official repos, experimental 
mode enabled)
  - BBC micro:bit
  - "hciconfig -a hci0":
hci0:	Type: BR/EDR  Bus: USB
	BD Address: XX:XX:XX:XX:XX:XX  ACL MTU: 1022:8  SCO MTU: 183:5
	UP RUNNING PSCAN
	RX bytes:718 acl:0 sco:0 events:54 errors:0
	TX bytes:3731 acl:0 sco:0 commands:54 errors:0
	Features: 0xff 0xfe 0x0d 0xfe 0xd8 0x7f 0x7b 0x8f
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
	Link policy: RSWITCH HOLD SNIFF
	Link mode: SLAVE ACCEPT
	Name: 'Io'
	Class: 0x4c010c
	Service Classes: Rendering, Capturing, Telephony
	Device Class: Computer, Laptop
	HCI Version: 4.1 (0x7)  Revision: 0x3101
	LMP Version: 4.1 (0x7)  Subversion: 0x1
	Manufacturer: Atheros Communications, Inc. (69)

What I am trying to do:
  - Read some bytes from a characteristic on the micro:bit through 
BlueZ's DBUS API using a Python script and the dbus module

The error I am getting:
  - "org.bluez.Error.NotPermitted: Not paired"

I have paired the micro:bit both from the normal Ubuntu Bluetooth 
settings menu, and I have also paired it with the bluetoothctl tool, 
each on separate occasions. Both reported that the pair was successful 
(no pin was required however, compared to when I pair the micro:bit to 
my phone I do need the pin), however when I tried running my script 
(which does not check whether the device is paired or connected: this is 
performed by the user, and I can verify that both the Ubuntu settings 
and bluetoothctl reported it as both paired and connected), I get the 
afore mentioned error ("org.bluez.Error.NotPermitted: Not paired").

Is this, therefore, an error with my program (I have spent hours 
checking it and cannot find any errors)? Or a possible bug with BlueZ? 
There are very few resources online for this kind of thing so I ended up 
resorting to the Bluetooth mailing list - please notify me if this is 
the wrong kind of stuff to be asking.

The micro:bit is the only LE device which has ever connected to this 
(laptop) computer, and the characteristic (and its service) which I am 
reading from do both exist as DBUS objects. My grasp of the DBUS system 
is rather rudimentary, and so far has just been gained from BlueZ examples.

I have checked using the DBUS API to make sure that the device is both 
paired and connected - both said yes, but, as previously said I get an 
error (more specifically, an exception is thrown when I try to call 
"<DBUS interface to characteristic>.ReadValue()").

Is this my doing, or an issue with something out of my control? Any help 
will be appreciated :)

             reply	other threads:[~2016-05-03 15:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03 15:38 Joe Glancy [this message]
2016-05-04 11:03 ` DBUS API error "Not paired" when attempting to read GATT characteristic Luiz Augusto von Dentz
2016-05-05 17:15   ` Joe Glancy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5728C5DA.7000703@gmail.com \
    --to=joe.t.glancy@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).