Testing Bluetooth with QEMU


Priyanka
 

Hi


I am testing samples/bluetooth/beacon with QEMU.

The version of zephyr is recent master branch.


1)

The beacon sample test with local Bluetooth adapter on Linux PC, gives the init failed error

[QEMU] CPU: qemu32
qemu-system-i386: warning: Unknown firmware file in legacy mode: genroms/multiboot.bin
Starting Beacon Demo
Bluetooth init failed (err -35)

2)

So, I test the sample "beacon" with emulation support with BlueZ.

Attached wireshark capture.

Could someone verify if my setup (tools and commands) is correct or I am missing something here? 

For further bluetooth tests, has anyone tried the tools "l2ping" and "l2test" ?

When I do "make qemu" : Bluetooth is initialized and Beacon started. BD address is 00:aa:01:00:00:23 (public).


However, "hciconfig -a" gives 

[bt] [ERR] read_payload: Not enough space in buffer

[bt] [WRN] hci_cmd_done: pool id 1 pool 0x00405098 != &hci_cmd_pool 0x00405078

I have following running in different terminals.

$ sudo ./btvirt -l2
Bluetooth emulator ver 5.46

$ sudo tools/btproxy -i 0 -u
Listening on /tmp/bt-server-bredr
Opening user channel for hci0
New client connected

# zephyr/samples/bluetooth/beacon$ make qemu
[QEMU] CPU: qemu32
qemu-system-i386: warning: Unknown firmware file in legacy mode: genroms/multiboot.bin

Starting Beacon Demo
[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
Bluetooth initialized
Beacon started

[bt] [ERR] read_payload: Not enough space in buffer
[bt] [WRN] hci_cmd_done: pool id 1 pool 0x00405098 != &hci_cmd_pool 0x00405078


$ hciconfig -a

hci0: Type: BR/EDR 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:203 errors:0

TX bytes:7024 acl:0 sco:0 commands:636 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: 'xxxxxx #1'

Can't read class of device on hci0: Connection timed out (110)

$ sudo btmgmt --index 1

[hci1]# find -l
Discovery started
hci1 type 6 discovering on
hci1 dev_found: 00:AA:01:00:00:23 type LE Public rssi 127 flags 0x0000
AD flags 0x06
name Zephyr Heartrate Sensor
hci1 type 6 discovering off

Thanks
Priyanka


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