Re: IPSP bluetooth sample with QEMU (ping fails)


Vakul Garg <vakul.garg@...>
 

Hi Paul

On the same topic, I am facing a different issue on my setup.
On running Bluetooth ipsp using QEMU, I get a zephyr error about insufficient buffer space.

shell> [bt] [INF] show_dev_info: Identity: 00:aa:01:00:00:23 (public)
[bt] [INF] show_dev_info: HCI: version 5.0 (0x09) revision 0x0000, manufacturer 0x003f
[bt] [INF] show_dev_info: LMP: version 5.0 (0x09) subver 0x0000
[ipsp] [INF] init_app: Run IPSP sample
[ipsp] [INF] listen: Starting to wait
[bt] [ERR] read_payload: Not enough space in buffer
[bt] [WRN] hci_cmd_done: pool id 6 pool 0x0041d570 != &hci_cmd_pool 0x0041d550
QEMU: Terminated

To reproduce this, I run Bluetooth/ipsp example with emulator Bluetooth controller and btproxy.
Now doing hciconfig -a on a terminal trigger about error.

[b16394@lti emulator]$ sudo ./btvirt -l1
Bluetooth emulator ver 5.47

[b16394@lti bluez-5.47]$ sudo ./tools/btproxy -i 0 -u
Listening on /tmp/bt-server-bredr

[root@lti bluetooth]# sudo hciconfig -a
hci0: Type: Primary Bus: Virtual
BD Address: 00:AA:01:00:00:23 ACL MTU: 192:1 SCO MTU: 0:0
UP RUNNING
RX bytes:0 acl:0 sco:0 events:99 errors:0
TX bytes:3226 acl:0 sco:0 commands:122 errors:0
Features: 0xa4 0x08 0x08 0xc0 0x58 0x1e 0x7b 0x83
Packet type: DM1 DH1 HV1
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Name: 'LTI'
Can't read class of device on hci0: Connection timed out (110)
[root@lti bluetooth]#


Regards

Vakul

-----Original Message-----
From: zephyr-users-bounces@lists.zephyrproject.org [mailto:zephyr-users-
bounces@lists.zephyrproject.org] On Behalf Of Paul Sokolovsky
Sent: Thursday, September 21, 2017 9:46 PM
To: Priyanka Rawat <priyanka.rawat@nxp.com>
Cc: zephyr-users@lists.zephyrproject.org
Subject: Re: [Zephyr-users] IPSP bluetooth sample with QEMU (ping fails)

Hello Priyanka,

On Mon, 18 Sep 2017 17:04:25 +0000
Priyanka Rawat <priyanka.rawat@nxp.com> wrote:

While testing bluetooth IPSP sample (recent master branch of zephyr)
with Qemu, ping fails (no response found) and

ping: sendmsg: No buffer space available (wireshark capture attached).

I noticed that there are some old issues and bugs reported on the IPSP
sample. However, I couldn't figure out if the bugs/issues have been
resolved already.

What is the current status on the IPSP bluetooth sample? Anyone tested
IPSP sample with Qemu?
I tested it on BOARD=96b_carbon (real hardware) straight before 1.9 release,
everything worked well, and I captured docs required to set it up at
https://github.com/zephyrproject-rtos/zephyr/pull/1185 (if you would find
detailed instructions for setting up IPSP in Zephyr useful, please add +1
comment to that pull request).

What's your usecase for working with BLE in qemu_x86 in general? I fully
understand and support the idea of being able to run it via QEMU, so
everyone can test it without a real hardware, but based on your own
experience, not everything works smooth there. So, if you're just interested in
BLE and/or IPSP, I'd suggest to try them on some real board as an alternative
to QEMU, that's known to work pretty well (across few boards).

I myself a novice with BLE support in Zephyr (usually work on other things),
and would be interested to get it work with QEMU too, but don't know when
I'll be able to pay enough attention to it, as I'm currently working on few other
things keeping me pretty busy.


I get the following for the IPSP test:

zephyr/samples/bluetooth/ipsp$ make BOARD=qemu_x86
CONF_FILE=prj_dbg.conf run

[QEMU] CPU: qemu32
qemu-system-i386: warning: Unknown firmware file in legacy mode:
genroms/multiboot.bin

[bt] [INF] show_dev_info: Identity: 00:aa:01:00:00:23 (public) [bt]
[INF] show_dev_info: HCI: version 5.0 (0x09) revision 0x0000,
manufacturer 0x003f [bt] [INF] show_dev_info: LMP: version 5.0 (0x09)
subver 0x0000 [ipsp] [INF] init_app: Run IPSP sample [ipsp] [INF]
listen: Starting to wait


On host PC

----------------

I enabled 6lowpan and bluetooth_6lowpan


# modprobe bluetooth_6lowpan
# modprobe 6lowpan
# echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
# echo connect "00:aa:01:00:00:23 1"
/sys/kernel/debug/bluetooth/6lowpan_control


$ sudo hcitool lescan
[sudo] password for nxf32661:
LE Scan ...
00:AA:01:00:00:23 (unknown)
00:AA:01:00:00:23 Test IPSP node


$ sudo ./echo-client -i bt0 2001:db8::1 Binding to 2001:db8::2 Timeout
while waiting idx 0 len 1 Timeout while waiting idx 1 len 6 Timeout
while waiting idx 2 len 4 Timeout while waiting idx 3 len 26 Timeout
while waiting idx 4 len 1232 Timeout while waiting idx 5 len 1 Timeout
while waiting idx 6 len 256

$ ping6 -I bt0 2001:db8::1
PING 2001:db8::1(2001:db8::1) from 2001:db8::2 bt0: 56 data bytes
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available

$ ifconfig bt0
bt0 Link encap:UNSPEC HWaddr
00-AA-01-FF-FE-01-00-24-00-00-00-00-00-00-00-00 inet6 addr:
fe80::2aa:1ff:fe01:24/64 Scope:Link inet6 addr: 2001:db8::2/64
Scope:Global UP POINTOPOINT RUNNING MULTICAST MTU:1280 Metric:1
RX packets:76 errors:0 dropped:0 overruns:0 frame:0
TX packets:91 errors:0 dropped:91 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:7128 (7.1 KB) TX bytes:8532 (8.5 KB)

Thanks
Priyanka


--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs Follow Linaro:
http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog
_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

Join users@lists.zephyrproject.org to automatically receive all group messages.