Skip to content

[Bug] DOMException: GATT Server is disconnected. Cannot retrieve services. (Re)connect first with device.gatt.connect. #56

Closed

Description

@GianCann

Sometime, when try to connect to the hub, this error happened:
image

This is the report from console:
DOMException: GATT Server is disconnected. Cannot retrieve services. (Re)connect first with device.gatt.connect.
kn @ error-log.ts:20

Making a second attempt, it works

Activity

  1. added
    triage
    on Jun 17, 2020
  2. changed the title [-][Bug] [/-] [+][Bug] Unexpected error while trying to connect[/+] on Jun 17, 2020
  3. added
    software: pybricks-code
    and removed
    triage
    on Jun 18, 2020
  4. added
    OS: Windows 11
    on Jul 3, 2020
  5. changed the title [-][Bug] Unexpected error while trying to connect[/-] [+][Bug] DOMException: GATT Server is disconnected. Cannot retrieve services. (Re)connect first with device.gatt.connect.[/+] on Jul 18, 2020
  6. dlech commented on Oct 10, 2020

    @dlech
    Member

    If this happens again, can you please collect Bluetooth logs and post them here?

    • Open an administrator command prompt (search start menu for cmd then right click and select "Run As Administrator")

    • Change to the directory where you want to save the file (e.g. cd %HOMEPATH%/Downloads)

    • Run the command:

      logman create trace "bth_hci" -ow -o bth_hci.etl -p {8a1f9517-3a8c-4a9e-a018-4f17a200f277} 0xffffffffffffffff 0xff -nb 16 16 -bs 1024 -mode Circular -f bincirc -max 4096 -ets
      
    • Reproduce your issue.

    • Run the command:

      logman stop "bth_hci" -ets
      
    • Open the directory in File Explorer

    • Right-click the file and select "Send To > Compressed (zipped) Folder"

    • Upload the zip file here

  7. mwinkler commented on Nov 3, 2020

    @mwinkler

    Hi
    I have the same issue with a LEGO City hub (Windows 10 - 2004 / Chrome 86).
    Flashing works without a issue, but I cannot connect after.

    Here the logman zip:
    bth_hci.zip

  8. dlech commented on Nov 3, 2020

    @dlech
    Member

    City hub is a known issue: #48 (comment)

  9. dlech commented on Jan 29, 2021

    @dlech
    Member

    We've made some changes around this, so lets start a new issue if the same error message is seen again.

  10. xblanch commented on Mar 8, 2021

    @xblanch

    Hi,
    I ave the same problem with City Hub. I have hub flashed but now I can't connect.

    GATT Server is disconnected. Cannot retrieve services. (Re)connect first with `device.gatt.connect`.
    

    Thanks.

  11. dlech commented on Mar 9, 2021

    @dlech
    Member

    Hi @xblanch, can you please start a new issue with more details on your OS, web browser and what you did that lead up to the problem?

  12. vdespa commented on Jul 19, 2024

    @vdespa

    In case it helps anyone:

    I also encountered this error. It turned out that the batteries were at about 1V each. After replacing them, it worked without any issues.

  13. added theissue type on Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS: Windows 11software: pybricks-code

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions