Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3085018ybv; Mon, 24 Feb 2020 17:52:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwvmmyFwg1YKU/m5DYp2Pk2KI6SjVjvQAdpkULinuOWOrQQVM4yv5+mxwUI8Z9JygY6xP1U X-Received: by 2002:a9d:7:: with SMTP id 7mr40668653ota.26.1582595553063; Mon, 24 Feb 2020 17:52:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582595553; cv=none; d=google.com; s=arc-20160816; b=JsHEeNLp4KL33P+7lmW3UjdNeCUnyveZ4Ma5Fb22zW89OUmWOkdNZdT/ctg55HqY80 a0AVIvFvq6+pLaLwJiOVMjtmW1hxbcMBBI21KKtxjt4j5RgD+eEE3O57P6Nya9iPLkTr 70rFQ+7Nh7sKNNMoJDJE88wd8HyXi00VY6FkaqxTdk0tlHRefFpYj8/WSMQPp9FVpgps 4zl5Utp8IN+GSaFMzMUFO8sZ9zjw0hoXe1Z2qJMy8eGrLvQjzpXrW09EZQvZ+zC9zesD sHvRZnz4r7CQ+FhuPdyHknWCt/qVTI2Qs6xocQjnu5uFTgSYhIHwgUWpj6CEajaWj0lu 6jJg== 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=akHXeA5lRpMCrGZMdqNpV5NO1b2BK1U09bjTlxx7Lt0=; b=T6gCcTbEXuwKNYHu3EVI/iK7uTT8kdLSW/5X/XpN6CQ0YffV9dfoWOTyG37wfhqcBT 7/i0cJz/asp3H0oqSZe75M93Dv+91SC3u3HrdH8A4scL2YrGhTvAw4cSQKEw1VSE9N+O dZ0Hk2dU6BF1XshPI5KPTUNWDmTxdJGt/7/oq5aZEdruMaVeutb3ddlJViC7AsokJiSh 8Q7wCpeLhXXdxBz6+hBZJ9AkFKQFOwfEr3ACtgAGz3Yyq1IFYitu2KcwMRX/H173nDG+ tqs5i+eaB3hycXHs3w+Ni6Tm1EWY8YAjNxZJS/4yXdsZUIFC7GKuRC5vccVSORszWNog +svQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RemeadNK; 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 h7si6684033otm.165.2020.02.24.17.52.14; Mon, 24 Feb 2020 17:52:33 -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=RemeadNK; 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 S1728529AbgBYBwL (ORCPT + 99 others); Mon, 24 Feb 2020 20:52:11 -0500 Received: from mail-ot1-f54.google.com ([209.85.210.54]:41895 "EHLO mail-ot1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726962AbgBYBwL (ORCPT ); Mon, 24 Feb 2020 20:52:11 -0500 Received: by mail-ot1-f54.google.com with SMTP id r27so10630689otc.8 for ; Mon, 24 Feb 2020 17:52:10 -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=akHXeA5lRpMCrGZMdqNpV5NO1b2BK1U09bjTlxx7Lt0=; b=RemeadNK2KFNcZ16xxrBJ/4FV/ahudGcc2MTYcPZWH6ZEs6JElzO5lXIGM+yRXuH9g hoMVSP3s/N5pRilGpLiSv5uNB5iSdMjZF5WEorXopv4J89gSXAYMGRsvnaPSxh59FuWL qQfvcp4qdxinbRQ0yvS9H5Kz0K7C3cwIFSCpufQDC2rMWLBFYxFX6Uu4WcQmz2QmWzAi 0PojPuh3n9980BB8Yn3wLmLsg2J2gX9fZVUE7Ac0P0KQPnNiqIBAn8nqTI3jx+m+B7sO J05KSnNSELAJcDU18pap3P5rymqV/n0wVvIUA1XXWLw9wa0q+DC8CRsyC0RcLnOky/SF 9h1Q== 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=akHXeA5lRpMCrGZMdqNpV5NO1b2BK1U09bjTlxx7Lt0=; b=ZcPQEmgFut9hkbGZPp3WIugNw2RaIF8frBfdmlC6bmbqI72tI/oYbWdW5m8egieGFH We4I+lIbJ7l0GhK42Ibt3DquF2MYIV0NOqZXHDacTEEWGQszzsVs6lh2Q6dnZ4+0oWAq CTu63z4yH8Vq8lX2mtx5c24vD46EnqduZoJL1nsbnTWdjtYyqdg9FNZhPLk4teEfnvnK Vwe8/yqMj1gcfaWwnr16Kgrr7XOMW14yvQtT1xg2VbYjVWGiI4fNKZIOgQazw9/nI/oj wcA1PeqTu3qWnpSiBH/qv4Zv5d3vmmGGEOFa3JDrv4bcdtEPNGKLgCEs/JficFGZUule RJnQ== X-Gm-Message-State: APjAAAVwMqGa6nOuBLxlg8mj4Mdnyrs1tKOKti2fBxBSuuGtI4pDSpIt 1taC/U4SOvC0m1UiqM5G/JpBE6mEInPk0ln+1mM= X-Received: by 2002:a9d:6d10:: with SMTP id o16mr44071488otp.28.1582595530050; Mon, 24 Feb 2020 17:52:10 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Luiz Augusto von Dentz Date: Mon, 24 Feb 2020 17:51:58 -0800 Message-ID: Subject: Re: Bluez blotoothctl scan vs hcitool scan To: chris baker 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 Hi Chris, On Mon, Feb 24, 2020 at 5:36 PM chris baker wrote: > > 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! Afaik the HCI duplicate filter flag is not very granular, so the controller may be dropping any reports found during a sort period since it might not have enough memory to store everything, include actual data in the advertisement, to compare with. -- Luiz Augusto von Dentz