Latest Python SDK connection problem.

I am using VirtualBox in Windows 10 host machine with Virtual machine OS of Ubuntu 16.04 and latest metawear python SDK (0.3.1). I am using Qualcomm Bluetooth 4.1 adapter
 I am trying to run one of example files, but this always fails on device.connect() portion. Here is the error I got.
Traceback (most recent call last):
  File "metawearTest.py", line 22, in <module>
    device.connect()
  File "/usr/local/lib/python2.7/dist-packages/metawear-0.3.1-py2.7.egg/mbientlab/metawear/__init__.py", line 158, in connect
    for s in self.gatt.discover_primary():
RuntimeError: Device is not responding!
I looked at the source code and try to manually connect using ble
device.gatt.connect(True, channel_type="random")
a = device.gatt.read_by_uuid("00002a27-0000-1000-8000-00805f9b34fb")[0]  # hardware
print(a)
 b = device.gatt.read_by_handle(0x0012)[0] # manufacturer
 print(b)
    b = device.gatt.read_by_handle(0x0012)[0] # manufacturer
RuntimeError: Device is not responding!
this works for a, but fails for b. It looks like if I try to read more than one uuid, it throws error somehow. 
I tried gattool cmd to connect to the device manually and  was able to get primary characteristics.
attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0008, end grp handle: 0x000b uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x000f uuid: 0000180f-0000-1000-8000-00805f9b34fb
attr handle: 0x0010, end grp handle: 0x001a uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle: 0x001b, end grp handle: 0xffff uuid: 326a9000-85cb-9195-d9dd-464cfbbae75a

Could there be a reason why python sdk (pygatt) is failing even on the connection stage? Thank you.

Comments

  • Is the bluetooth adapter you're passing into the VM the one integrated into your laptop?  I also use VirtualBox to run Linux and I find that passing a USB adapter works better than the integrated radio in VB.
  • It is integrated Bluetooth in the laptop, so I need Bluetooth dongle? Is there a setting I need to change in order to run it?
  • I would disable the internal adapter and try using a bluetooth dongle.
  • I am also having the same problem (exposed in a recent post of mine), but on raspberry pi 3. No matter if I use a dongle or the internal bluetooth adapter, I also get this error.
This discussion has been closed.