Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3829956pxv; Mon, 26 Jul 2021 13:19:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJIT+ONUy2CuXlIjnXbjaGu9ivce5k/D8hr6aGr6dpFQhI/Su8BkfcTQUBWc5XKSpEoHYm X-Received: by 2002:a6b:2bd4:: with SMTP id r203mr11488756ior.157.1627330750840; Mon, 26 Jul 2021 13:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627330750; cv=none; d=google.com; s=arc-20160816; b=j3WabdR2bAjL5+JrHAeyi0TFm5YCrfhU29KTjlUsPHpmE1JVXNtI9fgBK6b1gDiRZ3 4M8WdmWwDn55dOilA8sbO7pUIwXL6WwtBges40Dk9HiAxtQD889b0w9NBTQx5uJsjG29 fdeH0KEGAaCju615JVqEOKGh6r2xjp+iTwTp7MqaI/jyGYOycaKR9aTC5JKdXFSGnO8f qKTdZWqAdAzdikWfvJpba0koa3/fGs8D+xfl6kv6+pRCJf7Rc884yq7s6G43CqNBs2NL TSzAMk2AK3UgSBHC7+ghNGxMMQT3d9mWXSITzoQZDHX9O39WL2bgkzotf1dAWyRmO9UL /eNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:to:subject:message-id :date:from:in-reply-to:references:mime-version:dkim-signature; bh=qpXW/t7/LAN2V8q8ydEap7i6JhSb1/NqGECjNdox3Ms=; b=WEJMM5SUQb7T5M7J6Wmq5MgAtWa8HHfb9vRpKcEdqas4EqPVy+Ve31asxPEyTdnsfy ZiacXIyto9pbeEtN59txtIrsPaG6CJUtec9EKtoZFiDB3ii/NoKNI4WfryDzhA7xzVUc BdV0N6wgCYcfeJV3tWYAS68v5rUrFgoltaLhG09lyQzP+ZU0B1ZoV6FIu/pdxm1hVXpq 0tFNaZgwYIqtJOmYhlrlUNDPLCzgOXQNMdU0a7vk1Jfxg66u0+ouzEtqQMR908xdR02h ROwdbpIPkXLKaZJWMEnoyj9PYAXBnY3Dx7wWZOed7+s9XL5SQMH+ZY2STXTnmniAOoGs qqyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jgklD0xD; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id x7si1058406ilu.63.2021.07.26.13.18.44; Mon, 26 Jul 2021 13:19:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jgklD0xD; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 S229646AbhGZThF (ORCPT + 99 others); Mon, 26 Jul 2021 15:37:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232571AbhGZThE (ORCPT ); Mon, 26 Jul 2021 15:37:04 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64457C061757 for ; Mon, 26 Jul 2021 13:17:32 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id o185so12310601oih.13 for ; Mon, 26 Jul 2021 13:17:32 -0700 (PDT) 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 :content-transfer-encoding; bh=qpXW/t7/LAN2V8q8ydEap7i6JhSb1/NqGECjNdox3Ms=; b=jgklD0xD/6dAXnJr+VD/hAW4aKAs12pi9T0yX9UWaCsKPChS2nLxnF1p8NAVQ2YH3f YpZ5nKxxYLw8draAG4/bsW47w2sReNFZUsK2k/+GLk/Oa8W2jwEGaBmuIlNJlbFKy/BJ PaZTX2OILtmZVSg6yDyguLNGPzKZuFoE1+M0V/pH84oYqcKwU2TDmh4VfZfjfTPXtHFI Db0eQEsnjpM8iV5ys58q39UVhqy0PI1bZDpgK5LQBYtbXqsnDP7pfAGLycUnG6R1HVSb hz3lvJZsNxbiK6vgTXMB+sgbr8rNtZsIqWtOpfsyvShcvbg6QpGcbtcSS/qhu6TL/pz3 qm5A== 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:content-transfer-encoding; bh=qpXW/t7/LAN2V8q8ydEap7i6JhSb1/NqGECjNdox3Ms=; b=dLTzDrCBpzggmuqPWK8btv5UxB2HX40b//GmYe1OGDqAiqFpGHPO/ntL5wrVwu1Fyq etgdcONk+vsjWWeJj8Q4Cy49kjg6trnCwIq+sCYsIgwszYI2Bg1SQP5giJLvycy7As97 DSwRHlWHKwHxKRjlRBPvwGAQT8jmNg6qB0+ABHFLLsJOmFANMQfA15N/OjMFF1H9EQeO O3lsWCMi0v7eXvIiYSY9Qz4jey6Yk52CvZVp68wdR/w7pJXdJRPL+NWMJI/VnC9Gg02g 21rgtSWef84armroEdLd/C4azmDh3icDGLu+9yVAQw6VBgm670O91/EJoNKCh0n5jf6h TDPw== X-Gm-Message-State: AOAM532YvqGedJeSWpzo4neBUVY0IfPJ9ZzyJCzjTYYaDkdKzEDYDGI4 yzw2KaabBGpMX8lU6al9KRc0DIzgwdMDWyV5Gqk= X-Received: by 2002:a54:4494:: with SMTP id v20mr570776oiv.70.1627330651725; Mon, 26 Jul 2021 13:17:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Emil Lenngren Date: Mon, 26 Jul 2021 22:17:27 +0200 Message-ID: Subject: Re: Instable BLE connection - MTU Request, Attribute not found - wireshark findings To: =?UTF-8?Q?Peter_H=C3=B6ller?= , Bluez mailing list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Den m=C3=A5n 26 juli 2021 kl 22:00 skrev Peter H=C3=B6ller : > > However, I installed wireshark ( I used the wireshark version instead > of tshark, because I am not familiar with the shell commands in > tshark. However, unfortunately I cannot copy any sniffed protocols for > now) > > my connection status out of bluetoothctl is: > paired, trusted and connected > > > 1.) paired and connected I go to > >menu gatt > >select attribute b5f90074-aa8d-11e3-9046-0002a5d5c51b (as I always do) > this leads me to: > GoPro8639:/service002d/char0033]# > no I: > write "0x03 0x01 0x01 0x01" (which always started the shutter on > peripheral, when we used btusb 0.6 (now we are using btusb 0.7!) > > but nothing happens at peripheral. > on wireshark there is no error but I get on Write response packet: > Bluetooth Attribute Protocol > -->Opcode: Write Response (0x13) > -->0... .... =3D Authentication Signature: False > .0.. .... =3D Command: False > ..01 0011 =3D Method: Write Respone (0x13) > > Can you debug this? Was there any change in syntax due to write =3D xx xx xx xx xx> [offset] [type] ? > > Hoever, > sudo gatttool -t random -b xx:xx:xx:xx:xx:xx -I > connect > char-write-req 2f 03010101 > > still works (!) and goes through to the peripheral !, unless there > occurs no is no file descriptor Error > > > 2.) due to the disconnect problem after longer connection ~15 min: > there where no further findings: > wireshark delivers an HCI event - Disconnect Complete with > Reason: Connection Timeout (0x08) > > 3.) due to the immediate disconnect problem (~1 - 10 sec after > connection): there seems to be an encryption problem and /or > Encryption change takes too long?: > (I type for you...) > > from host to controller: HCI_CMD length: 29 > SENT LE Create Connection > > from controller to host: HCI_EVT length: 7 > Rcvd Command Status (LE Create Connection) > > from controller to host: HCI_EVT lenght: 22 > Rcvd LE Meta (LE Connection Complete) > > from host to controller: HCI_CMD length: 32 > Sent LE Start Encryption > > from controller to host: HCI_EVT lenght: 7 > Rcvd Command Status (LE Start Encryption) > > from controller to host: HCI_EVT lenght: 7 > Rcvd Encryption Change > ----->containg under BluetoothHCI Event: Status: Connection timeout (0x0= 8) and > > Encrytion Enable: Link Level Encryption is OFF (0x00) > > from host to controller: HCI_CMD length: 7 > Sent Disconnect > ----->containg under BluetoothHCI Command: Reason: Authentication > Failure (0x05) > > from controller to host: HCI_EVT lenght: 7 > Sent Disconnect Complete > ----->containg under BluetoothHCI Event: Reason Connection Timeout(0x08= ) If you have one method that works and one that fails, you should use btmon to compare the exact write payloads. I don't know about GoPro so can't help what kind of messages it expects. You can see that it's the controller that first notifies of the disconnection with the reason "Connection Timeout" (in a start encryption result, as indicated by the result code). So likely it's due to one of the reasons I wrote about earlier. Another reason for connection timeout is if the firmware is buggy or just drops the connection for example when you suddenly power off the device. What also could happen is, during encryption setup, is if both devices believe they share the same encryption key, but in fact they for some reason have two different keys stored, then the peripheral will drop the connection with the reason "Connection terminated due to MIC failure" while the central will eventually get a "Connection Timeout". /Emil