Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3074067ybv; Mon, 24 Feb 2020 17:36:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwH8a0sQ9LNp+sx+EclvqB4hGyZQ9SXKsltCXsQFF8sx3dmhJmW3Hiq01iior9thINXbAdN X-Received: by 2002:aca:f242:: with SMTP id q63mr1640508oih.72.1582594595026; Mon, 24 Feb 2020 17:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582594595; cv=none; d=google.com; s=arc-20160816; b=SQbOhxpi07gBKWU/G9LdnmhaPyLp9fx2XrOBHJSuW/QsPgpEnl+UU7WKoM50pnrYNs 9Z0Ksg44/+B82pyStmc2371DgRkQpX19mJrmC9cjxpLX62z3aAjNpeNcrdbQOITfd1LA PDgcVrJt8YzcDEbniSmVOoUVebhJ3CU2cphXgJljhfUgPEIZZfO3E/TG2XATiwVTJYjH 1RRrOYoYM4ds1DpX2nYe0Rf/RYfLTDrMGWWSWTFALxeIt8jI3yCZ3ZiakcSKFSB4nVHm darG1rDzvnj6erc1imA8vHBrFxGu9+F4vmoVHOXFiwlCOPvAqLl/eBxLLeadv25K3Dty ZStQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hoUWZFubdZALCd9e8O268DXImCxJAVzZhN7QYxJJNnM=; b=cRqQ63Xi2WgaJ+LoeC/BoX4XUUyFbdDYBgepSp2/5MqJD9Xp9N/kpf/p4sU+dXi+Ix GDmucVvvNc5mMiL13rK8hW8rYUmmPObuDv1DbblvMuhndMXZbo8fD6yyqL1YlN6ucbIa fshG7VwD2i7jhck5aavVpstQKjYUkj2BHtYajVyKDTfS4BWzsnp46PAFuC3snnOtI144 E8O6kbLMeM46r0APrsrqHZSn08Ot68Cgq/1FIl6fFLH6es+dUcanCXyInxXeFosAIeho DqlcHTgRIg1+BuVb9nk0nqu/W5vMZ7jfONM9vH2hmeRsgBAXJq0ADTFYEF1gGUDMfCGL ufSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZX0XaM0O; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si5884678oik.171.2020.02.24.17.36.23; Mon, 24 Feb 2020 17:36:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZX0XaM0O; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728516AbgBYBgS (ORCPT + 99 others); Mon, 24 Feb 2020 20:36:18 -0500 Received: from mail-ot1-f42.google.com ([209.85.210.42]:39665 "EHLO mail-ot1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728011AbgBYBgS (ORCPT ); Mon, 24 Feb 2020 20:36:18 -0500 Received: by mail-ot1-f42.google.com with SMTP id 77so10637373oty.6 for ; Mon, 24 Feb 2020 17:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hoUWZFubdZALCd9e8O268DXImCxJAVzZhN7QYxJJNnM=; b=ZX0XaM0O2DAGMldSKJ9LhXcEH4yaffI4UVFkzQldJ9BTzyJs6m2yTK5TJ9h/4HQm7D bjuYxwyJ75NiuJB4DMYTuUwz70xzgqn07gdbe6Qk9kgRSyRE3HJh6IF8gkLVQTYv+eJH 4EaCSFzBu30USnVjhokf+Vlyj4KxrvzvyHiySDAeVHtSfChKsoy8uSThe0lkjqoY83SB eyJE2vm723BABLZ4hW27O9Nd45XGOXHEOd2yoOH+QXn5k2ZRAP5XkW0nbLs4/6HOkocq qgzKSG8f3r1DWzqfVnnIm/EJX3cYe9WgKd1F1haImEi81iY1xMGa8/Edxg1FgnaU5qNi Q9UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hoUWZFubdZALCd9e8O268DXImCxJAVzZhN7QYxJJNnM=; b=R3M8G9G0IkNScN1DHHzC1EYtRf85scO5esrvxFGaoH6u4eu60yQW5oXovqCAzmw2p/ /DnJiqUN1+9CN/7tl1JcwFMO/1VeFw909I/ZpzK7KsSs1saR8eyCQcYhn3Rb6YDn+Uw7 5V1IAYnQzzqVV/aiCqWWXZY7jaequY9H4o07wUnC+T2L4m1YOzb8BPgnJ95E81GoBtRy w8+ALjTA1FvcEz71YOzsCVih3SeFaNEIiP/XDIx3UCi2h6ZLkAeKLRKc/h9Vrj3jI3kH ez2Of0dm1L/g8/hT72aELv7ke0nAugbRNcyISXRItJmEWeHC0kmjjOp/lCn6rxFTc7xi 2Ifg== X-Gm-Message-State: APjAAAVa4QAs9rmqUbhDfU2w9FN3WzCNTzdA1ihVtOHu0WRgipd0FKDk cE4UuCFSjkbqyPMOCZ47qXjqY89J1/0cibvXqck= X-Received: by 2002:a9d:58cb:: with SMTP id s11mr43758217oth.55.1582594577205; Mon, 24 Feb 2020 17:36:17 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: chris baker Date: Mon, 24 Feb 2020 17:36:07 -0800 Message-ID: Subject: Re: Bluez blotoothctl scan vs hcitool scan To: Luiz Augusto von Dentz Cc: Barry Byford <31baz66@gmail.com>, Bluez mailing list Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Mon, Feb 24, 2020 at 4:33 PM Luiz Augusto von Dentz wrote: > > Hi Chris, > > On Mon, Feb 24, 2020 at 1:56 PM chris baker wrote: > > > > On Mon, Feb 24, 2020 at 9:13 AM Barry Byford <31baz66@gmail.com> wrote: > > > > > > If the DBus API is not cutting it for you then using the MGMT API > > > https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/mgmt-api.txt > > > is what has been recommended in the past: > > > https://www.spinics.net/lists/linux-bluetooth/msg68959.html > > > > > > On Mon, 24 Feb 2020 at 16:37, chris baker wrote: > > > > > > > > On Mon, Feb 24, 2020 at 6:08 AM Barry Byford <31baz66@gmail.com> wrote: > > > > > > > > > > Hi Chris, > > > > > > > > > > On Mon, 24 Feb 2020 at 10:12, chris baker wrote: > > > > > > > > > > > > > > > > > So my question is, is there a way to get those missing advertisements > > > > > > through the dbus api, possibly some additional setting somewhere? > > > > > > > > > > Duplicates are disabled by default with the DBus API. This can be > > > > > controlled with the DuplicateData setting: > > > > > https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/adapter-api.txt#n107 > > > > > > > > > > Regards, > > > > > Barry > > > > > > > > > > > > My apologies, I guess I wasn't clear (long post) but, I turned > > > > duplicate data on when using the bluetoothctl command (via the "scan" > > > > submenu) and also used the flag, "hcitool lescan --duplicates", when > > > > running the hcitool command. So both scans should have included any > > > > duplicates (unless I've misunderstood something). Additionally, none > > > > of the missing packets were duplicates (again, unless I'm > > > > misunderstanding what "duplicates" means). each packet had a unique > > > > sequence numbers as well as the button data field toggling. > > > > Great, thank you. I'll look into the MGMT api in the coming days. That > > said, is it a problem to use both api's (MGMT/DBus) concurrently from > > the same app? My application supports both connected BLE sensors as > > well as BLE beacon type sensors. If possible I can handle them in two > > different threads, but the DBus thread for connected sensors would > > still occasionally need to scan for new sensors (using the DBus > > discovery call) and would still need to get characteristic changed > > callbacks as well. > > Have a look at the other thread subject: Adding support for > DuplicateData into the kernel > > We are discussing adding support to disable duplicate via MGMT since > DuplicateData does not currently remove it but we might want to change > that, or at least have some alternative API to do that. We could for > example have a socket that enables a more direct access to the > advertisments, that way protocol that work over advertisement would > have a way to do this, in fact this might be better for things like > mesh so it can coexist with bluetoothd. > > > Out of curiosity though, is the behavior I'm seeing normal? Or is the > > sensor doing something improper possibly? Seeing as the packets aren't > > duplicates why would they be filtered (or are they just not being > > received to begin with for some reason)? The 11 second interval seems > > kind of strange. Anyway, thanks again for the help! Chris > > > > -- > Luiz Augusto von Dentz Thanks Luiz, I don't want to sound dense, and I really appreciate you and Barry's help, but these aren't duplicate packets (unless, again, I'm misunderstanding the term). Each packet payload is completely unique. I'll have a look at the other thread for sure, but I'm really just trying to understand if the missing packets I identified in the trace should be there (in the DBus/bluetoothctl trace) or if there's a reason they were excluded. Again, they weren't duplicates and I'm reasonably sure I had the duplicate data flags set correctly each time. Also, whatever is going on is not transient, I can duplicate it with the senor I'm testing every time (both in my app or via bluetoothctl). More important for sure is to find a work-around (hopefully the MGMT api Barry pointed me to) but still just curious why these packets are getting dropped/filtered... Anyway, thanks again to you both!