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

can't connect to device, don't know what to check #11

Open
dirl75 opened this issue Nov 30, 2023 · 6 comments
Open

can't connect to device, don't know what to check #11

dirl75 opened this issue Nov 30, 2023 · 6 comments

Comments

@dirl75
Copy link

dirl75 commented Nov 30, 2023

Hello,
I get an error when trying to connect to bioharness. Everyhting seems to be in place. The device's Bluetooth light is on, I can connect it no problem using the company's software.

What else should I check?
thanks

(base) PS C:\Program Files\App-Zephyr-main> .\run.cmd
Checking if conda present...
conda 22.11.1
Checking if python environment present...
Launching application...
2023-11-30 13:56:07,395 INFO: starting up...
2023-11-30 13:56:07,395 INFO: No BioHarness (BHT) device MAC address provided, initiating discovery...
2023-11-30 13:56:17,647 INFO: Discovered device BH BHT053918 (58:93:D8:4A:16:12)
2023-11-30 13:56:17,647 INFO: Connecting to device 58:93:D8:4A:16:12...
2023-11-30 13:56:17,647 WARNING: Connection attempt failed, attempting reconnect...
2023-11-30 13:56:18,651 INFO: Connecting to device 58:93:D8:4A:16:12...
@chkothe
Copy link
Member

chkothe commented Nov 30, 2023

Haven't seen that so far -- do you have multiple bluetooth adapters on your system by any chance, or multiple Zephyrs? There's actually very little happening there, it's just using the Python Bluetooth module and invokes connect with that MAC address. To investigate, you might do one of the following:

  • To get a more detailed error you might edit these lines here into:
            except IOError as e:
                if self._reconnect:
                    logger.warning(f"Connection attempt failed ({e}), attempting reconnect...")
  • Run it in a Python IDE like PyCharm in debug mode and put a breakpoint on that same warning line and inspect the value of e (after you added the as e part)

Let me know what you learned.

@NathanLeRoux29
Copy link

Hello, I have the same problem with this guy and I do what you tell him to do. I have this now, what i can do ?

(pyzephyr) C:\Users\tinat\Desktop\Workspace\Oxab\App-Zephyr>run.cmd
Checking if conda present...
conda 24.4.0
Checking if python environment present...
Launching application...
2024-06-13 10:05:47,227 INFO: starting up...
2024-06-13 10:05:47,228 INFO: No BioHarness (BHT) device MAC address provided, initiating discovery...
2024-06-13 10:05:57,537 INFO: Discovered device BH BHT005703 (C8:3E:99:0D:AC:D2)
2024-06-13 10:05:57,539 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:05:57,542 WARNING: Connection attempt failed (U),attempting reconnect...
2024-06-13 10:05:58,546 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:05:58,546 WARNING: Connection attempt failed (U),attempting reconnect...
2024-06-13 10:05:59,558 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:05:59,558 WARNING: Connection attempt failed (U),attempting reconnect...
2024-06-13 10:06:00,573 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:06:00,573 WARNING: Connection attempt failed (U),attempting reconnect...
2024-06-13 10:06:01,587 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:06:01,587 WARNING: Connection attempt failed (U),attempting reconnect...
2024-06-13 10:06:02,602 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:06:02,602 WARNING: Connection attempt failed (U),attempting reconnect...
2024-06-13 10:06:03,615 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:06:03,615 WARNING: Connection attempt failed (U),attempting reconnect...
2024-06-13 10:06:04,625 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:06:04,625 WARNING: Connection attempt failed (U),attempting reconnect...
2024-06-13 10:06:05,632 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:06:05,632 WARNING: Connection attempt failed (U),attempting reconnect...
2024-06-13 10:06:06,643 INFO: Connecting to device C8:3E:99:0D:AC:D2...
2024-06-13 10:06:17,547 ERROR: Operation timed out: Waiting for device response to GetSerialNumber timed out.
2024-06-13 10:06:17,548 INFO: Shutting down BioHarness link...
2024-06-13 10:06:17,752 INFO: Done.

@chkothe
Copy link
Member

chkothe commented Jun 13, 2024

Since this seems to be a fundamental Bluetooth connection issue, which shouldn't really specific to this software, the main things that come to mind are the Bluetooth stack of the PC or something about the charging state or maybe firmware of the bioharness. (e.g., we had recently seen some instability with a Windows laptop that had a wonky Bluetooth stack that sometimes would and other times would not connect, that was with a completely different BLE device though). So trying this on another PC could be one thing to check. Other than that, making sure that your Zephyr is in the best condition (fully charged, firmware up to date, making sure that the vendor software consistently connects on the same PC) would be the other thing.

@NathanLeRoux29
Copy link

I can't really try with another PC right now, but I think I won't have a choice. Because I tried it with my Zephyr fully charged, firmware up to date, and I can connect the device with the vendor software.

@NathanLeRoux29
Copy link

I try with another PC and i have the same problem

@chkothe
Copy link
Member

chkothe commented Jun 18, 2024

Ok another thing you might try is increasing the timeout via the command-line argument (default 20 seconds); I recall at least one circumstance (again with another kind of device) where that made a difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants