linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ferry Toth <ftoth@exalondelft.nl>
To: linux-bluetooth@vger.kernel.org
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: When connecting to NAP bnep0 can not go up
Date: Mon, 18 Feb 2019 16:36:39 +0100	[thread overview]
Message-ID: <f1dbdbbf-9e8e-ab9e-6079-4f3e60e7e233@exalondelft.nl> (raw)
In-Reply-To: <81ee645c-f9ae-f1f2-4c3c-89d55c7ccddf@exalondelft.nl>

Adding Andy, Marcel, Johan to CC

Op 16-02-19 om 18:38 schreef Ferry Toth:
> I'm trying to make a connection from my Edison (linux 4.19) to my android
> phone (nap), but it seems Edison bnep0 gets removed immediately after
> creation. How can help me diagnose this?

Actually, this is using Andy's kernel 4.20 (not 4.19).

I didn't mention that other BT functionality seems to be working fine. 
And building with Yocto Thud (bluez 5.50).

Everything is fairly up-to-date (compared to Edison factory image).

> Initially I tried connman. The bluetooth service appears, but when I 
> try to
> connect I get:
>
> connmanctl> connect bluetooth_43341B001FAC_C462EA01AF74
> Error /net/connman/service/bluetooth_43341B001FAC_C462EA01AF74:
> Input/output error
>
> For testing I switched to the bluez test-network.py script:
>
> root@edison:~# python3 ./test-network.py C4:62:EA:01:AF:74 nap
> Traceback (most recent call last):
>   File "./test-network.py", line 42, in <module>
>     iface = network.Connect(service)
>   File "/usr/lib/python3.5/site-packages/dbus/proxies.py", line 70, in
> __call__
>     return self._proxy_method(*args, **keywords)
>   File "/usr/lib/python3.5/site-packages/dbus/proxies.py", line 145, in
> __call__
>     **keywords)
>   File "/usr/lib/python3.5/site-packages/dbus/connection.py", line 
> 651, in
> call_blocking
>     message, timeout)
> dbus.exceptions.DBusException: org.bluez.Error.Failed: Input/output error
>
> Using btmon to log while running above script:
>
> < ACL Data TX: Handle 12 flags 0x00 dlen 11
> #96 [hci0] 2974.047858
>       Channel: 78 len 7 [PSM 15 mode 0] {chan 0}
>       BNEP: Control (0x01|0)
>          Setup Conn Req (0x01)
>            Size: 0x02
>            Dst: 0x1116(NAP)
>            Src: 0x1115(PANU)
>> HCI Event: Number of Completed Packets (0x13) plen 5
> #97 [hci0] 2974.049982
>         Num handles: 1
>         Handle: 12
>         Count: 2
>> ACL Data RX: Handle 12 flags 0x02 dlen 8
> #98 [hci0] 2974.052464
>       Channel: 64 len 4 [PSM 15 mode 0] {chan 0}
>       BNEP: Control (0x01|0)
>          Setup Conn Rsp (0x02)
>            Rsp msg: Operation Successful(0x0000)
> = bluetoothd: bnep: Could not bring up bnep0: Cannot assign requested
> address(99)
> = bluetoothd: connect failed Input/output error
>
> And logging with udevadm monitor:
> KERNEL add /devices/pci..../serial0-0/bluetooth/hci0/hci0:12 (bluetooth)
> UDEV   add /devices/pci..../serial0-0/bluetooth/hci0/hci0:12 (bluetooth)
> KERNEL add /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0 
> (net)
> KERNEL add
> /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0/queues/rx-0
> (queues)
> KERNEL add
> /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0/queues/tx-0
> (queues)
> KERNEL remove
> /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0/queues/rx-0
> (queues)
> KERNEL[146116.687930] remove
> /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0/queues/tx-0
> (queues)
> KERNEL 
> remove   /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0
> (net)

Note the KERNEL already issues a remove before UDEV add

> UDEV   add      /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0 
>
> (net)
> UDEV   add
> /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0/queues/rx-0
> (queues)
> UDEV   add
> /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0/queues/tx-0
> (queues)
> UDEV   remove
> /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0/queues/rx-0
> (queues)
> UDEV  [146116.776687] remove
> /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0/queues/tx-0
> (queues)
> UDEV   remove   /devices/pci..../serial0-0/bluetooth/hci0/hci0:12/net/bnep0 
>
> (net)
> KERNEL remove   /devices/pci..../serial0-0/bluetooth/hci0/hci0:12
> (bluetooth)
> UDEV   remove   /devices/pci..../serial0-0/bluetooth/hci0/hci0:12
> (bluetooth)
>
> To me it looks like the kernel already removes the bnep0 device, 
> before user
> space can bring it up.
>
> And indeed, doing the same from another computer (Ubuntu linux 4.18) I 
> get
> only the kernel and udev add events, the connection is established and 
> the
> remove events appear only after pressing Ctrl-C
>
> What could this be?
>
>

  reply	other threads:[~2019-02-18 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <27e70326-9ca5-dadc-e2ac-90fc81c1b167@exalondelft.nl>
2019-02-16 15:45 ` When connecting to NAP bnep0 can not go up Ferry Toth
2019-02-16 17:38 ` Ferry Toth
2019-02-18 15:36   ` Ferry Toth [this message]
2019-02-24 17:13     ` Ferry Toth
2019-03-10 13:08       ` Ferry Toth

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=f1dbdbbf-9e8e-ab9e-6079-4f3e60e7e233@exalondelft.nl \
    --to=ftoth@exalondelft.nl \
    --cc=andy.shevchenko@gmail.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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).