Code Monkey home page Code Monkey logo

Comments (4)

kariudo avatar kariudo commented on June 13, 2024 1

Additional errors include:

2021-12-31 14:45:12 INFO     Likely found a onewheel, using ***
2021-12-31 14:45:15 ERROR    Connection error: [WinError -2147483629] The object has been closed
2021-12-31 14:45:15 WARNING  Cannot read data, not connected

from onewheel-bluetooth.

kariudo avatar kariudo commented on June 13, 2024

Full debug output after detecting the board with scan:

2021-12-31 14:50:41 DEBUG    Connecting to BLE device @ ***
2021-12-31 14:50:42 DEBUG    _ConnectionStatusChanged_Handler: 1
2021-12-31 14:50:42 DEBUG    Get Services...
2021-12-31 14:50:43 DEBUG    _ConnectionStatusChanged_Handler: 0
2021-12-31 14:50:43 ERROR    Connection error: Could not get GATT services: Unreachable
2021-12-31 14:50:43 DEBUG    _ConnectionStatusChanged_Handler: 1
2021-12-31 14:50:43 INFO     Connected to board: None
2021-12-31 14:50:43 DEBUG    _ConnectionStatusChanged_Handler: 0
2021-12-31 14:50:43 WARNING  Not connected, exiting loop
2021-12-31 14:50:43 DEBUG    _ConnectionStatusChanged_Handler: 1
2021-12-31 14:50:43 DEBUG    Disconnecting from ***
2021-12-31 14:50:43 DEBUG    _ConnectionStatusChanged_Handler: 0
2021-12-31 14:50:43 DEBUG    Disconnecting from BLE device...
2021-12-31 14:50:43 DEBUG    Disconnected

from onewheel-bluetooth.

kariudo avatar kariudo commented on June 13, 2024

I think the problem is coming from this bit in bleak

https://github.com/hbldh/bleak/blob/156e8af24a4ec13540586fc32a13f99e75b2abb9/bleak/backends/winrt/client.py#L262

            # Windows does not support explicitly connecting to a device.
            # Instead it has the concept of a GATT session that is owned
            # by the calling program.
            self._session.maintain_connection = True
            # This keeps the device connected until we set maintain_connection = False.

            # wait for the session to become active
            await asyncio.wait_for(event.wait(), timeout=timeout)
        except BaseException:
            handle_disconnect()
            raise
        finally:
            self._session_active_events.remove(event)

        # Obtain services, which also leads to connection being established.
        await self.get_services()

from onewheel-bluetooth.

kariudo avatar kariudo commented on June 13, 2024

Since this looks like a bleak issue and I am more interested in linux support for my usage currently, this is not a priority unless someone else has a fix or input short of me making changes to bleak to work around it.

from onewheel-bluetooth.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.