Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
From: "Stotland, Inga" <inga.stotland@intel.com>
To: "Gix, Brian" <brian.gix@intel.com>,
	"sbrown@ewol.com" <sbrown@ewol.com>,
	"vallapaneni@socoptimum.com" <vallapaneni@socoptimum.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: bluez meshctl error: socket operation on non-socket
Date: Tue, 3 Dec 2019 23:42:21 +0000
Message-ID: <2eab12375d67cae33acea2278bf9ba58d352a4da.camel@intel.com> (raw)
In-Reply-To: <d8c0faa1bde18f8cb7180344bb03c816acdcdd3c.camel@ewol.com>

Hi Steve and all,

On Thu, 2019-11-28 at 16:05 -0700, Steve Brown wrote:
> I've successfully provisioned the zephyr onoff-app with both meshctl
> and mesh-cfgclient.
> 
> However, when installing meshd, I found that you have to enable
> bluetooth-mesh with systemctl or I get this when I issue the
> "create".
> 
> GNU gdb (Ubuntu 8.3-0ubuntu1) 8.3
> Copyright (C) 2019 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html
> >
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "aarch64-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <
> http://www.gnu.org/software/gdb/bugs/
> >;.
> Find the GDB manual and other documentation resources online at:
>     <
> http://www.gnu.org/software/gdb/documentation/
> >;.
> 
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from mesh-cfgclient...
> (gdb) run
> Starting program: /usr/bin/mesh-cfgclient 
> 
> Warning: config file "/home/ubuntu/.config/meshcfg/config_db.json"
> not found
> [mesh-cfgclient]# create 0100
> 
> Program received signal SIGSEGV, Segmentation fault.
> l_dbus_proxy_method_call (proxy=0x0, method=0xaaaaaaada7a8
> "CreateNetwork", setup=0xaaaaaaab6ba0 <create_net_setup>,
> reply=0xaaaaaaab69e0 <create_net_reply>, user_data=0x0, destroy=0x0)
>     at ell/dbus-client.c:305
> 305		req->proxy = proxy;
> (gdb) bt
> #0  l_dbus_proxy_method_call (proxy=0x0, method=0xaaaaaaada7a8
> "CreateNetwork", setup=0xaaaaaaab6ba0 <create_net_setup>,
> reply=0xaaaaaaab69e0 <create_net_reply>, user_data=0x0, destroy=0x0)
>     at ell/dbus-client.c:305
> #1  0x0000aaaaaaac1c34 in cmd_exec (argv=0xaaaaaab40650, argc=2,
> entry=0xaaaaaaafdf18 <main_menu+16>) at src/shared/shell.c:441
> #2  menu_exec (entry=0xaaaaaaafdf18 <main_menu+16>, argc=argc@entry=2
> , argv=argv@entry=0xaaaaaab40650) at src/shared/shell.c:468
> #3  0x0000aaaaaaac2008 in shell_exec (argc=2, argv=0xaaaaaab40650) at
> src/shared/shell.c:511
> #4  0x0000aaaaaaac312c in rl_handler (input=0xaaaaaab41900 "create
> 0100") at src/shared/shell.c:713
> #5  0x0000ffffbf6809e8 in rl_callback_read_char () from /lib/aarch64-
> linux-gnu/libreadline.so.8
> #6  0x0000aaaaaaac1ecc in input_read (io=<optimized out>,
> user_data=<optimized out>) at src/shared/shell.c:1256
> #7  0x0000aaaaaaac7440 in io_callback (fd=<optimized out>, events=1,
> user_data=0xaaaaaab40780) at ell/io.c:126
> #8  0x0000aaaaaaac83f8 in l_main_iterate (timeout=<optimized out>) at
> ell/main.c:473
> #9  0x0000aaaaaaac84d8 in l_main_run () at ell/main.c:520
> #10 l_main_run () at ell/main.c:502
> #11 0x0000aaaaaaac86f4 in l_main_run_with_signal (
> callback=callback@entry=0xaaaaaaac3c20 <l_sig_func>, 
> user_data=user_data@entry=0x0) at ell/main.c:642
> #12 0x0000aaaaaaac3cf4 in mainloop_run_with_signal (func=func@entry=0
> xaaaaaaac2130 <signal_callback>, user_data=user_data@entry=0x0) at
> src/shared/mainloop-ell.c:87
> #13 0x0000aaaaaaac3394 in bt_shell_run () at src/shared/shell.c:1174
> #14 0x0000aaaaaaab42d8 in main (argc=<optimized out>, argv=<optimized
> out>) at tools/mesh-cfgclient.c:1970
> (gdb) quit
> A debugging session is active.
> 
> 	Inferior 1 [process 5112] will be killed.
> Steve
> 
> On Thu, 2019-11-28 at 22:41 +0530, Venkat Vallapaneni wrote:
> > Hi Brian,
> > I am using latest bluez and ell trees on ubuntu 18.04. Log windows 
> > showing segmentation fault if it helps. I ran demon first and then 
> > mesh-cfgclient
> > 
> > vallapaneni@venkat-laptop:~$ sudo ~/tools/bluez/mesh/bluetooth-
> > meshd
> > D-Bus ready
> > Request name success
> > Loading node configuration from /var/lib/bluetooth/mesh
> > filter_set id: 1, --> 2b
> > filter_set id: 2, --> 29
> > filter_set id: 3, --> 2a
> > filter_set id: 4, --> 2b
> > Controller hci 0 is in use
> > 
> > vallapaneni@venkat-laptop:~/tools/bluez$ sudo 
> > ~/tools/bluez/tools/mesh-cfgclient
> > 
> > Warning: config file
> > "/home/vallapaneni/.config/meshcfg/config_db.json" 
> > not found
> > [mesh-cfgclient]# create
> > Segmentation fault
> > vallapaneni@venkat-laptop:~/tools/bluez$
> > 
> > Rgds,
> > Venkat.
> > 
> > On 28/11/19 9:37 pm, Gix, Brian wrote:
> > > Hi Venkat,
> > > 
> > > > On Nov 28, 2019, at 2:59 AM, Venkat Vallapaneni <
> > > > vallapaneni@socoptimum.com
> > > > > wrote:
> > > > 
> > > > Hi Brian,
> > > > 
> > > > Thanks for the response. Yes, I am using PB-GATT barrier. With
> > > > bluetooothd running, I am able to provision my device.
> > > 
> > > Ok... well if this is specifically to play with Zephyr, you can
> > > build it to accept PB-ADV based provisioning as well. But i think
> > > Zephyrs mesh tip is PN-GATT by default.
> > > 
> > > > I also tried mesh-cfgclient but unsuccessful. I launched the
> > > > shell with mesh-cfgclient (with bluetooth-meshd running) and I
> > > > gave create command in the shell. I see segmentation fault. Any
> > > > steps I am missing?
> > > 
> > > Are you on the tip of both the BlueZ tree, and the ELL tree?
> > > Also,
> > > what linux distro are you using?
> > > 
> > > > Is mesh-cfgclient only for provisioning or also for sending
> > > > mesh
> > > > messages also?
> > > 
> > > mesh-cfgclient not only provisions devices with PB-ADV, but it
> > > also
> > > is a full featured Config Client. It can send keys, bindings,
> > > subscriptions, and publications.
> > > 
> > > 
> > > > Rgds,
> > > > 
> > > > Venkat.
> > > > 
> > > > 
> > > > > On 28/11/19 4:22 am, Gix, Brian wrote:
> > > > > Hi Venkat,
> > > > > 
> > > > > Are you attempting to provision a device that requires PB-
> > > > > GATT
> > > > > provisioning?  If so, the bluetoothd daemon must be up and
> > > > > running. However, this tool is old, and will probably be
> > > > > deprecated at some point.
> > > > > 
> > > > > However most Mesh devices should support Advertising based
> > > > > provisioning.
> > > > > 
> > > > > The Mesh daemon (Bluetooth-meshd) and the mesh-cfgclient tool
> > > > > (in the tools directory) has been undergoing modification
> > > > > even
> > > > > since v5.52, so you will want to checkout the tip.
> > > > > 
> > > > > ./tools/mesh-cfgclient is the tool most appropriate for mesh
> > > > > development today.
> > > > > 
> > > > > 
> > > > > 
> > > > > > > On Nov 26, 2019, at 8:16 PM, Venkat Vallapaneni <
> > > > > > > vallapaneni@socoptimum.com
> > > > > > > > wrote:
> > > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > I am trying to use bluez 5.52 for provisioning a bluetooth
> > > > > > mesh capable device. When I gave provision <uuid>, I get
> > > > > > this
> > > > > > below error. Please let me know what I am missing.
> > > > > > 
> > > > > > I am using ell 0.26 on ubuntu 18.04. I am able to provision
> > > > > > successfully with bluez 5.50.
> > > > > > 
> > > > > > AcquireWrite success: fd 8 MTU 69
> > > > > > GATT-TX:     03 00 10
> > > > > > *sendmsg: Socket operation on non-socket*[Zephyr]#
> > > > > > 
> > > > > > Rgds,
> > > > > > Venkat.
> > > > > > 

The debug output indicates that the daemon started, but hasn't found an
available hci device, so it is stuck in semi-initialized mode:
the dbus-service name has been registered, but not the interfaces.

There are multiple thins going on here:
- Currently bluetoothd & bluetooth-meshd cannot run on the same
controller (addressing this requires kernel changes). So if there is
only one controller it's either bluetoothd or meshd daemons, but not
both. Please check if bluetoothd is running.
Perhaps, with systemctl meshd starts before bluetoothd starts and grabs
the single hci device?

- mesh-cfgclient needs to have an additional check for Network1 being
detected. This would deal with the symptom not the reason.

- I believe the daemon should be fixed so that d-bus service is not
exposed unless there is a BT controller available. Will look into this.

Best regards,

Inga
 
 




      parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27  4:16 Venkat Vallapaneni
2019-11-27 22:52 ` Gix, Brian
2019-11-28 10:58   ` Venkat Vallapaneni
2019-11-28 16:07     ` Gix, Brian
2019-11-28 17:11       ` Venkat Vallapaneni
2019-11-28 23:05         ` Steve Brown
2019-11-29  1:28           ` Venkat Vallapaneni
2019-12-03 23:42           ` Stotland, Inga [this message]

Reply instructions:

You may reply publically 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=2eab12375d67cae33acea2278bf9ba58d352a4da.camel@intel.com \
    --to=inga.stotland@intel.com \
    --cc=brian.gix@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=sbrown@ewol.com \
    --cc=vallapaneni@socoptimum.com \
    /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

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org
	public-inbox-index linux-bluetooth

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git