Errors Connecting to MetaWear Device with BLE dongles on MetaHub
I recently purchased some MMR sensors and a MetaHub and was having some issues with BLE dongle connections. I am trying to connect a MMR device with a BLE dongle on a MetaHub and running into some errors. I have attached the python script I am trying to run: it simply connects to a device and then blinks the LEDs before disconnecting. When passing no hci_mac argument the code runs fine and in able to connect the the MetaSensor and have the on board LEDs blink. The only error being thrown is error > 1590522052.141092: Error on line: 296 (src/blestatemachine.cc): Operation now in progress
which I have read elsewhere can be ignored.
When trying to connect with the dongle I get the following errors:
error 1590521927.717962: Error on line: 296 (src/blestatemachine.cc): No route to host
Traceback (most recent call last):
File "/home/pi/Apps/Python-Examples/MetaWear-SDK-Python/Project/singleConnect.py", line 14, in
File "/home/pi/.local/lib/python3.5/site-packages/mbientlab/metawear/metawear.py", line 195, in connect
mbientlab.warble.WarbleException: Timed out while trying to connect to remote device
I have set up my Pi and dongles as described in the tutorials and am still facing these issues. The BLE dongle is visible and running when I check hciconfig and bluetoothctl.
Also when preforming a scan within bluetoothctl the MetaWear devices are not visible when scanning with the dongle (and they are when scanning with the onboard bluetooth). I have preformed this scan multiple times and waited a while with the same results.
With these results the timed out error makes sense since the MetaWear devices cannot even be found when scanning with the dongle, although I do not know where the "No route to host" error comes from. I also don't know how to fix the fact that the dongles are not able to see other devices properly.
I received 3 dongles with my MetaHub and the same issue happens with each of them. I have updated all of my packages and tried numerous reboots but cannot seem to find the source of this problem. I realize there are similar posts to this (https://mbientlab.com/community/discussion/comment/9901#Comment_9901) but in this case the dongle was not discovering any devices (in my case it can pick up a few devices but no matter how long it is left to scan it can never find the MetaWear devices)
Any help would be appreciated as the MetaHub and bluetooth dongles were both purchased directly from Mbientlabs.
Board Information - MMR
Model number: 5
Host Device Information
MetaHub (raspberry pi running Raspbian (stretch))
Bluetooth dongles are the CSR 4.0 purchased directly from Mbientlabs
python script being run:
from mbientlab.metawear import MetaWear, libmetawear
from mbientlab.metawear.cbindings import *
from time import sleep
from threading import Event
device = MetaWear("DA:6A:BD:93:6C:FA”, hci_mac = “00:1A:7D:DA:71:10”)
#returns True if device is connected
pattern= LedPattern(repeat_count= Const.LED_REPEAT_INDEFINITELY)
libmetawear.mbl_mw_led_write_pattern(device.board, byref(pattern), LedColor.GREEN)