Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot go through the example in VMware Workstation 16 with a dedicated bluetooth adapter attached. #5

Closed
scegg opened this issue Oct 21, 2020 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@scegg
Copy link

scegg commented Oct 21, 2020

Describe the bug
Cannot go through the example in VMware Workstation 16 with a dedicated bluetooth adapter attached.

To Reproduce
Steps to reproduce the behavior:

  1. Install a Ubuntu Server 20.04.1 x64
  2. Install dotnet core 3.1, bluez.
  3. Build example project.
  4. dotnet Examples.dll
  5. "Hello Bluetooth" is displayed.
  6. Press enter.
  7. Exception is displayed as below.
advertisement object /org/bluez/example/advertisement0 created
Unhandled exception. System.AggregateException: One or more errors occurred. (org.freedesktop.DBus.Error.UnknownMethod: Method "RegisterAdvertisement" with signature "oa{sv}" on interface "org.bluez.LEAdvertisingManager1" doesn't exist
)
 ---> Tmds.DBus.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "RegisterAdvertisement" with signature "oa{sv}" on interface "org.bluez.LEAdvertisingManager1" doesn't exist

   at Tmds.DBus.DBusConnection.CallMethodAsync(Message msg, Boolean checkConnected, Boolean checkReplyType)
   at Tmds.DBus.Connection.CallMethodAsync(Message message)
   at Tmds.DBus.CodeGen.DBusObjectProxy.SendMethodReturnReaderAsync(String iface, String member, Nullable`1 inSignature, MessageWriter writer)
   at DotnetBleServer.Advertisements.AdvertisingManager.RegisterAdvertisement(Advertisement advertisement) in C:\Users\allen\Desktop\dotnet-ble-server-master\DotnetBleServer\Advertisements\AdvertisingManager.cs:line 23
   at DotnetBleServer.Advertisements.AdvertisingManager.CreateAdvertisement(AdvertisementProperties advertisementProperties) in C:\Users\allen\Desktop\dotnet-ble-server-master\DotnetBleServer\Advertisements\AdvertisingManager.cs:line 37
   at Examples.SampleAdvertisement.RegisterSampleAdvertisement(ServerContext serverContext) in C:\Users\allen\Desktop\dotnet-ble-server-master\Examples\SampleAdvertisement.cs:line 18
   at Examples.Program.<>c.<<Main>b__0_0>d.MoveNext() in C:\Users\allen\Desktop\dotnet-ble-server-master\Examples\Program.cs:line 19
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Examples.Program.Main() in C:\Users\allen\Desktop\dotnet-ble-server-master\Examples\Program.cs:line 14
Aborted (core dumped)

Environment (please complete the following information):

  • OS: Ubuntu Server x64 20.04.1
  • Platform: amd64
  • BlueZ Version: 5.53
dmesg | grep -i blue
[    2.766346] usb 2-2.1: Product: Virtual Bluetooth Adapter
[    3.748630] Bluetooth: Core ver 2.22
[    3.748648] Bluetooth: HCI device and connection manager initialized
[    3.748651] Bluetooth: HCI socket layer initialized
[    3.748652] Bluetooth: L2CAP socket layer initialized
[    3.748653] Bluetooth: SCO socket layer initialized
[    7.069640] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    7.069641] Bluetooth: BNEP filters: protocol multicast
[    7.069643] Bluetooth: BNEP socket layer initialized
@scegg scegg added the bug Something isn't working label Oct 21, 2020
@scegg scegg changed the title [BUG] Cannot go through the example in VMware Workstation 16 with a dedicated bluetooth adapter attached. Oct 21, 2020
@scegg
Copy link
Author

scegg commented Oct 21, 2020

Tried in Raspberry Pi 4 with Ubuntu Server 20.04.1 ARM64 and dotnet core 3.1, same problem.

@scegg
Copy link
Author

scegg commented Apr 25, 2021

I found the reason why I cannot use BLE on my Pi4 and VM.
I'm using Ubuntu arm64 or x64 20.04, not Pi OS. A lib installation is required:
sudo apt install pi-bluetooth then
sudo nano /boot/firmware/usercfg.txt add include btcfg.txt to the end.
and sudo reboot.

Before testing code, make sure that bluetooth device can be listed by hciconfig -a.

@scegg scegg closed this as completed Apr 25, 2021
@bennil
Copy link

bennil commented Jan 22, 2022

In my case I had to activate experimental bluetooth low energy mode with old bluez version 5.43

check bluez version:
bluetoothctl -v

change systemd service file:
sudo nano /lib/systemd/system/bluetooth.service

change the line
ExecStart=/usr/lib/bluetooth/bluetoothd
in
ExecStart=/usr/lib/bluetooth/bluetoothd --experimental

and then reload/restart service
sudo systemctl daemon-reload
sudo systemctl restart bluetooth

this guide helped me to find the solution:
https://learn.adafruit.com/install-bluez-on-the-raspberry-pi/installation

Afterwards the above descriped exception:
Tmds.DBus.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "RegisterAdvertisement" with signature "oa{sv}" on interface "org.bluez.LEAdvertisingManager1" doesn't exist
was gone

@Lucia-Bader
Copy link

@scegg I would also like to test the application with VMware Workstation 16 Player, but i have read that not all adapters are compatible with VMware. So what kind of bluetooth adapter do you use?

@scegg
Copy link
Author

scegg commented Feb 23, 2022

@scegg I would also like to test the application with VMware Workstation 16 Player, but i have read that not all adapters are compatible with VMware. So what kind of bluetooth adapter do you use?

Here it is.... https://www.amazon.com/dp/B01LX6HISL/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=ugreenus-20&linkId=9cfc44318289542fd806ffae4145af5e&language=en_US

@Lucia-Bader
Copy link

@scegg I would also like to test the application with VMware Workstation 16 Player, but i have read that not all adapters are compatible with VMware. So what kind of bluetooth adapter do you use?

Here it is.... https://www.amazon.com/dp/B01LX6HISL/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=ugreenus-20&linkId=9cfc44318289542fd806ffae4145af5e&language=en_US

Thank you for the link :) I'm just a little confused the articel description says that it is not compatible with Linux, is it working because you connect the dongle to a windows host or why is it working?

@scegg
Copy link
Author

scegg commented Feb 23, 2022

@scegg I would also like to test the application with VMware Workstation 16 Player, but i have read that not all adapters are compatible with VMware. So what kind of bluetooth adapter do you use?

Here it is.... https://www.amazon.com/dp/B01LX6HISL/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=ugreenus-20&linkId=9cfc44318289542fd806ffae4145af5e&language=en_US

Thank you for the link :) I'm just a little confused the articel description says that it is not compatible with Linux, is it working because you connect the dongle to a windows host or why is it working?

Dunno. I connect it to windows (host) and pass it directly to vm. Works like a charm.

@Lucia-Bader
Copy link

@scegg I would also like to test the application with VMware Workstation 16 Player, but i have read that not all adapters are compatible with VMware. So what kind of bluetooth adapter do you use?

Here it is.... https://www.amazon.com/dp/B01LX6HISL/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=ugreenus-20&linkId=9cfc44318289542fd806ffae4145af5e&language=en_US

Thank you for the link :) I'm just a little confused the articel description says that it is not compatible with Linux, is it working because you connect the dongle to a windows host or why is it working?

Dunno. I connect it to windows (host) and pass it directly to vm. Works like a charm.

Okey sounds good. Do you know if it is also possible to use the built in bluetooth adapter of the windows host instead of an usb adapter?

@scegg
Copy link
Author

scegg commented Feb 23, 2022

@scegg I would also like to test the application with VMware Workstation 16 Player, but i have read that not all adapters are compatible with VMware. So what kind of bluetooth adapter do you use?

Here it is.... https://www.amazon.com/dp/B01LX6HISL/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=ugreenus-20&linkId=9cfc44318289542fd806ffae4145af5e&language=en_US

Thank you for the link :) I'm just a little confused the articel description says that it is not compatible with Linux, is it working because you connect the dongle to a windows host or why is it working?

Dunno. I connect it to windows (host) and pass it directly to vm. Works like a charm.

Okey sounds good. Do you know if it is also possible to use the built in bluetooth adapter of the windows host instead of an usb adapter?

If you can see it on the device list...

I didn't test it because my keyboard and mouse are both BT powered.

@Lucia-Bader
Copy link

@scegg I would also like to test the application with VMware Workstation 16 Player, but i have read that not all adapters are compatible with VMware. So what kind of bluetooth adapter do you use?

Here it is.... https://www.amazon.com/dp/B01LX6HISL/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=ugreenus-20&linkId=9cfc44318289542fd806ffae4145af5e&language=en_US

Thank you for the link :) I'm just a little confused the articel description says that it is not compatible with Linux, is it working because you connect the dongle to a windows host or why is it working?

Dunno. I connect it to windows (host) and pass it directly to vm. Works like a charm.

Okey sounds good. Do you know if it is also possible to use the built in bluetooth adapter of the windows host instead of an usb adapter?

If you can see it on the device list...

I didn't test it because my keyboard and mouse are both BT powered.

Okey thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants