Python library to interact with Move Hub / PoweredUp Hubs

Overview

Python library to interact with Move Hub / PoweredUp Hubs

Move Hub is central controller block of LEGO® Boost Robotics Set.

In fact, Move Hub is just a Bluetooth hardware piece, and all manipulations with it are made by commands passed through Bluetooth Low Energy (BLE) wireless protocol. One of the ways to issue these commands is to write Python program using this library.

The best way to start is to look into demo.py file, and run it (assuming you have installed library).

If you have Vernie assembled, you might run scripts from examples/vernie directory.

Demonstrational Videos

Vernie Programmed Laser Engraver Color Sorter Face Tracker Color Pin Bot BB-8 Joystick

Features

Usage

Please note that this library requires one of Bluetooth backend libraries to be installed, please read section here for details.

Install library like this:

pip install -U pylgbst

Then instantiate MoveHub object and start invoking its methods. Following is example to just print peripherals detected on Hub:

from pylgbst.hub import MoveHub

hub = MoveHub()

for device in hub.peripherals:
    print(device)

Each peripheral kind has own methods to do actions and/or get sensor data. See features list for individual doc pages.

Bluetooth Backend Prerequisites

You have following options to install as Bluetooth backend (some of them might require sudo on Linux):

  • pip install bleak - bleak lib, supports Linux/Windows/MacOS (recommended)
  • pip install pygatt - pygatt lib, works on both Windows and Linux
  • pip install gatt - gatt lib, supports Linux, does not work on Windows
  • pip install gattlib - gattlib - supports Linux, does not work on Windows, requires sudo
  • pip install bluepy - bluepy lib, supports Linux, including Raspbian, which allows connection to the hub from the Raspberry PI

Windows users may first turn to the Bleak backend, which should support any internal or external Bluetooth adapter recognized by the OS. The Windows version of pygatt will only work with a Bluegiga BLED112 Bluetooth Smart Dongle.

Please let author know if you have discovered any compatibility/preprequisite details, so we will update this section to help future users

Depending on backend type, you might need Linux sudo to be used when running Python.

Bluetooth Connection Options

There is an optional parameter for MoveHub class constructor, accepting instance of Connection object. By default, it will try to use whatever get_connection_auto() returns. You have several options to manually control that:

  • use get_connection_auto() to attempt backend auto-detection
  • use get_connection_bluegiga() - if you use BlueGiga Adapter (pygatt library prerequisite)
  • use get_connection_gatt() - if you use Gatt Backend on Linux (gatt library prerequisite)
  • use get_connection_gattool() - if you use GattTool Backend on Linux (pygatt library prerequisite)
  • use get_connection_gattlib() - if you use GattLib Backend on Linux (gattlib library prerequisite)
  • use get_connection_bluepy() - if you use Bluepy backend on Linux/Raspbian (bluepy library prerequisite)
  • use get_connection_bleak() - if you use Bleak backend (bleak library prerequisite)

All the functions above have optional arguments to specify adapter name and Hub name (or mac address). Please take a look at functions source code for details.

If you want to specify name for Bluetooth interface to use on local computer, you can pass that to class or function of getting a connection. Then pass connection object to MoveHub constructor. Like this:

from pylgbst.hub import MoveHub
from pylgbst import get_connection_gatt

conn = get_connection_gatt(hub_mac='AA:BB:CC:DD:EE:FF')
hub = MoveHub(conn)

Roadmap & TODO

  • validate operations with other Hub types (train, PUP etc)
  • make connections to detect hub by UUID instead of name
  • document all API methods

Links

Comments
  • Discovering devices without result

    Discovering devices without result

    Actually this is not an issue but I am hoping for help :-)

    I am very happy that I have found your library, I am sure it will bring fun to my son and me :-)

    I am trying to get it running on my Raspberry 3

    What I did: sudo pip install gattlib Following depedencies were necessary to get gattlib compiled: sudo apt-get install libglib2.0-dev sudo apt-get install libboost-all-dev pip install gTTS pip install https://github.com/undera/pylgbst/archive/0.5.tar.gz

    Python version is: Python 2.7.13

    Starting on of the test programs while pressing the Move Hub button leads to:

    INFO:comms:Discovering devices using hci0...
    INFO:comms:Discovering devices using hci0...
    INFO:comms:Discovering devices using hci0...
    INFO:comms:Discovering devices using hci0...
    

    and loops infinite without finding the Move Hub.

    Using the scan funtionality of the blutoothctltool I can see the Move Hub:

    [NEW] Device 90:A4:DE:F7:70:C9 Panasonic Viera
    [NEW] Device E8:B1:FC:47:99:8C LENOVO
    [NEW] Device 00:16:53:AC:DA:6B LEGO Move Hub
    

    Strange thing is that when I use the command hcitool scan I do not see the Move Hub but the other BT devices:

    pi@raspberrypi:~/legoboost $ hcitool scan
    Scanning ...
    	E8:B1:FC:47:99:8C	LENOVO
    	90:A4:DE:F7:70:C9	Panasonic Viera
    

    Is there anything I need to configure additionally to get library call hub = MoveHub(connection) finding the LEGO Move Hub?

    Any advice is welcome to get the the problem on my side analyzed.

    Many thanks, Holger

    opened by dasoho 23
  • gattlib

    gattlib

    HI, We'd love to use some of your code with my son on his Lego Boost. Unfortunately we're having some issues with dependencies using python 3.6. Apologies if this is not the correct forum, we're new to this and will learn quickly!

    $ python3 demo.py Traceback (most recent call last): File "demo.py", line 4, in from pylgbst import * File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pylgbst/init.py", line 1, in from pylgbst.movehub import * File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pylgbst/movehub.py", line 5, in from pylgbst.comms import BLEConnection File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pylgbst/comms.py", line 11, in from gattlib import DiscoveryService, GATTRequester ModuleNotFoundError: No module named 'gattlib'

    opened by g255 18
  • V1.0 not connecting to the Raspberry Pi

    V1.0 not connecting to the Raspberry Pi

    Previously I had a working system on the Raspberry Pi 3 and Pi3+ Linux raspberrypi 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l GNU/Linux PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)" NAME="Raspbian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=raspbian ID_LIKE=debian

    I install the latest version with pip install https://github.com/undera/pylgbst/archive/1.1.0.tar.gz And I also tried a pip3 install, both report a successful installation. then I tried:- from pylgbst.hub import MoveHub hub = MoveHub() for device in hub.peripherals: print(device)

    nothing is detected, and I have to use Ctrl C to get out of it. The same sort of thing happens with the other demo codes. This also happened before and after a firmware update on my boost hub. It is the same on the very latest Buster version with python3.7 on a Pi 3 and Pi 4, but with that there could be incompatibilities with the dependencies or OS.

    opened by Grumpy-Mike 17
  • Is bleak supported or not?

    Is bleak supported or not?

    I am still confused, is bleak supported or not? I am trying to run it on a mac:

    from pylgbst.hub import MoveHub
    from pylgbst.comms.cbleak import BleakConnection
    
    conn = BleakConnection()
    conn.connect()  # you can pass Hub mac address as parameter here, like 'AA:BB:CC:DD:EE:FF'
    
    hub = MoveHub(conn)
    

    and I get this:

    solver.py:5: RuntimeWarning: coroutine 'BleakConnection.connect' was never awaited
      conn.connect()  # you can pass Hub mac address as parameter here, like 'AA:BB:CC:DD:EE:FF'
    RuntimeWarning: Enable tracemalloc to get the object allocation traceback
    /Users/max/Library/Python/3.7/lib/python/site-packages/pylgbst/hub.py:48: RuntimeWarning: coroutine 'BleakConnection.set_notify_handler' was never awaited
      self.connection.set_notify_handler(self._notify)
    RuntimeWarning: Enable tracemalloc to get the object allocation traceback
    /Users/max/Library/Python/3.7/lib/python/site-packages/pylgbst/comms/__init__.py:46: RuntimeWarning: coroutine 'BleakConnection.write' was never awaited
      self.write(ENABLE_NOTIFICATIONS_HANDLE, ENABLE_NOTIFICATIONS_VALUE)
    RuntimeWarning: Enable tracemalloc to get the object allocation traceback
    Got only these devices: (None, None, None, None, None, None, None)
    /Users/max/Library/Python/3.7/lib/python/site-packages/pylgbst/hub.py:71: RuntimeWarning: coroutine 'BleakConnection.write' was never awaited
      self.connection.write(self.HUB_HARDWARE_HANDLE, msgbytes)
    RuntimeWarning: Enable tracemalloc to get the object allocation traceback
    

    Mac, Bleak 0.7.1, pylgbst 1.2.0 Thanks

    opened by finik 15
  • pylgbst on RPI3 with Raspbian stretch

    pylgbst on RPI3 with Raspbian stretch

    Hi, Thank you for your great job and very usefull to learn python to children. Thank to S. Mack for "Lego boost roboter steuern mit python unter windows oder linux" (in german :( )

    But would it be possible to do a tutorial for RPI3 dummy users like me please? I'm facing a lot of issues...

    Let's start from the beginning. I'm using RPI3 (enhanced with bluetooth) under Raspbian stretch. I updated with : sudo apt-get update sudo apt-get upgrade -y

    Next i failed to install gattlib: sudo pip install gattlib

    Collecting gattlib Using cached https://files.pythonhosted.org/packages/be/2f/5b1aecec551b42b59d8b399ad444b5672972efb590ca83d784dbe616a3e1/gattlib-0.20150805.tar.gz Complete output from command python setup.py egg_info: Package glib-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `glib-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'glib-2.0' found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-RfY5iW/gattlib/setup.py", line 12, in "pkg-config --cflags glib-2.0".split()).decode('utf-8') File "/usr/lib/python2.7/subprocess.py", line 219, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '['pkg-config', '--cflags', 'glib-2.0']' returned non-zero exit status 1

    ----------------------------------------
    

    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-RfY5iW/gattlib/

    This cmds didn't figure out the issue sudo apt-get install glib-2.0 sudo pip install --upgrade setuptools --user python

    The next step succeeded pip install https://github.com/undera/pylgbst/archive/0.5.tar.gz

    but it seems to be necessary to make a: git clone https://github.com/undera/pylgbst/ to run examples?

    last step failed : python demo.py but of course => ImportError: No module named gattlib

    thank's for your help.

    opened by vwone 13
  • Unhandled port data: MsgPortValueSingle

    Unhandled port data: MsgPortValueSingle

    Thank you for this fantastic library! I'm able connect and send commands to 3 motors connected to a technic hub. However, If I try to get the angle of a motor I get warnings like: WARNING peripherals Unhandled port data: MsgPortValueSingle({'payload': b'00000000', 'port': 3})

    The code I used is based on the example in the documentation, however my motors are not recognized bij the library as Motor_A, Motor_B, Motor_C. So I address them via the port number. Is the warning caused by the different addressing?

    addr = "66F8E420-8D44-43D6-AF9A-CD65EFA3XXXX"
    conn = get_connection_bleak(hub_mac=addr)
    hub = MoveHub(conn)
    
    my_motor = Motor(port=0x0,parent=hub)
    my_motor.start_speed(-0.5)
    
    steering = EncodedMotor(port=0x3,parent=hub)
    
    def callback(angle):
        print("Angle: %s" % angle)
    
    steering.subscribe(callback, mode=EncodedMotor.SENSOR_ANGLE)
    
    steering.angled(30)
    
    opened by oehoe 12
  • Can't get robot battery level

    Can't get robot battery level

    Hi!

    I'm currently working on a project with my classmates on the Lego Bosst. We're using the current library to make the robot moving, turning, etc....

    I have to create a script to get the battery state of the robot while connected via Bluetooth from an Raspberry Pi to it, but I'm stuck for weeks while trying for it :( I would like just to get the battery percentage, but when I'm launching a script, it always says "Low voltage, check power source (maybe replace battery)", assuming that I've made the robot charged for like 1-2 hours.

    I started searching in the "hub.py" file to see what can be done, and I found this :

    image

    I don't understand what i don't have the current percentage value returned, instead I have the error I've said before :( Can someone help me to solve this issue ?

    I specify that I have installed the library by using the "pip install -U pylgbst", with all the bluetooth prerequisites, on my Raspberry.

    Thanks you for responding, Have a great day :)

    opened by JeanPeyreMesMots 11
  • Control External Motor and Motors A/B together

    Control External Motor and Motors A/B together

    Is it possible to control the Motor connected to port D (or C) simultaneously with the Motors A and/or B? Did not find any such feature but in the Lego-App it appears that it is possible.

    opened by hofluk 11
  • demo.py & examples fail with

    demo.py & examples fail with "Failed to obtain all builtin devices"

    Hi Andrey,

    first of all: thanks a lot for all the effort you put into this library & the related Youtube videos! Those got me triggered in buying a Raspi Zero W and a BLED112 (for testing on Windows) and trying to learn Python :-)

    Since I'm a complete noob to Python and this whole BLE topic, I had a hard time to setup the library and its requirements. I didnt get it to work on Windows (using PyCharm), but on the Raspi I'm now at a point where I think I have everything correctly setup - but still cannot "talk" to the Lego Boost.

    I'm using Python3 and installed bluepy and the pylgbst lib:

    sudo pip3 install https://github.com/undera/pylgbst/archive/0.10.tar.gz
    sudo pip3 install bluepy
    

    I can use bluetoothctl to discover, pair and connect to the Boost Hub. However, when I try to run the demo.py, I get the following error:

    pi@zeropi01:~/projects/pylgbst/examples $ sudo python3 demo.py
    INFO:root:Trying get_connection_bluepy
    INFO:comms-bluepy:Discovering devices...
    INFO:comms-bluepy:Discovering devices...
    INFO:comms-bluepy:Discovering devices...
    INFO:comms-bluepy:Discovering devices...
    INFO:root:Found LEGO Move Hub at 00:16:53:aa:7b:f2
    INFO:movehub:Attached IMOTOR on port C
    INFO:movehub:Attached DISTANCE_COLOR_SENSOR on port D
    INFO:movehub:Attached MOTOR on port A
    INFO:movehub:Attached MOTOR on port B
    INFO:movehub:Attached MOTOR on port AB
    INFO:movehub:Attached LED on port LED
    WARNING:movehub:Got only these devices: (LED on port LED, EncodedMotor on port A, EncodedMotor on port B, EncodedMotor on port AB, None, Button on port 0, None, None)
    Traceback (most recent call last):
      File "demo.py", line 194, in <module>
        hub = MoveHub(connection)
      File "/usr/local/lib/python3.5/dist-packages/pylgbst/movehub.py", line 63, in __init__
        self._wait_for_devices()
      File "/usr/local/lib/python3.5/dist-packages/pylgbst/movehub.py", line 83, in _wait_for_devices
        raise RuntimeError("Failed to obtain all builtin devices")
    RuntimeError: Failed to obtain all builtin devices
    

    I have all motors and the sensor connected. I also tried without any connected motors/sensors, but the error is the same.

    I can launch the DebugServer as described in the readme, and that starts successfully - but running demo.py still fails:

    pi@zeropi01:~/projects/pylgbst/examples $ sudo python3 demo.py
    Traceback (most recent call last):
      File "demo.py", line 194, in <module>
        hub = MoveHub(connection)
      File "/usr/local/lib/python3.5/dist-packages/pylgbst/movehub.py", line 63, in __init__
        self._wait_for_devices()
      File "/usr/local/lib/python3.5/dist-packages/pylgbst/movehub.py", line 71, in _wait_for_devices
        self.connection.enable_notifications()
      File "/usr/local/lib/python3.5/dist-packages/pylgbst/comms/__init__.py", line 41, in enable_notifications
        self.write(ENABLE_NOTIFICATIONS_HANDLE, ENABLE_NOTIFICATIONS_VALUE)
      File "/usr/local/lib/python3.5/dist-packages/pylgbst/comms/__init__.py", line 163, in write
        self._send(payload)
      File "/usr/local/lib/python3.5/dist-packages/pylgbst/comms/__init__.py", line 167, in _send
        self.sock.send(json.dumps(payload) + "\n")
    TypeError: a bytes-like object is required, not 'str'
    

    Any idea what I'm doing wrong here? I also cloned your repo to the Raspi, so I'd happily try any suggested code change (if you tell me how to use the local repo instead of the installed pip3 pylgbst lib... ;-)

    Furthermore I tried to run the android_remote.py but that fails with another error message:

    pi@zeropi01:~/projects/pylgbst/examples $ sudo python3 vernie/android_remote.py
    Traceback (most recent call last):
      File "android_remote.py", line 12, in <module>
        from . import Vernie
    SystemError: Parent module '' not loaded, cannot perform relative import
    

    What do I need to do to make that work?

    Regards Michael

    opened by mivola 11
  • Feature request: Support of BlueGiga adapters

    Feature request: Support of BlueGiga adapters

    It would be really cool to additionally support BlueGiga BLED112 adpators through pygatt just like the pyb00st package. This would allow the usuage of your package for people who have only such an adaptor (like me) and enables support for Windows, where pygattlib is not available.

    Probably not that complex if you analyse a bit the implementation in pyb00st. If I find some time, I'll maybe try if I can get something running (on Linux, though)

    opened by birgander2 9
  • Fix to work with Bleak on a mac

    Fix to work with Bleak on a mac

    • Sometimes the data returnes is not byte/bytes, but native objective-c class _NSInlineData even though isinstance will fail, otherwise it seems to be working
    opened by finik 8
  • Calling hub methods from callback functions blocks further operations

    Calling hub methods from callback functions blocks further operations

    So, I tried to implement a simple demo where press of the button controls some other functions of a MoveHub, i.e. changes LED colour, or spins up a motor. The code looks like this:

    from pylgbst.hub import MoveHub
    from pylgbst import get_connection_bleak
    
    conn = get_connection_bleak()
    hub = MoveHub(conn)
    
    def callback_btn(is_pressed):
        global hub
        print("Btn pressed: %s" % is_pressed)
    
        hub.motor_external.wait_complete()
        if is_pressed == 0:
            hub.motor_external.timed(5, 1.0, wait_complete=False)
    
    try:
        hub.button.subscribe(callback_btn)
        time.sleep(60)
    finally:
        hub.button.unsubscribe(callback_btn)
        hub.disconnect()
    

    Once I release the button for the first time, it spins up the motor for 5 seconds exactly as I expect it to do. However, it does seem to ignore any further button presses... callback function is not called at all as I am not even getting any strings printed. Is this an expected behaviour due to threaded execution?

    Is there a way to implement this?

    Thanks a lot in advance.

    opened by Yakuza-UA 3
  • Cannot run a Lego tram

    Cannot run a Lego tram

    I'm trying to create a working solution for the new Lego Christmas tram. We want to make it run periodically in a shop window.

    My plan is to use a Raspberry Pi connecting using Bluetooth, and then write some software to run the tram every now and then. As a start: My family wants me to setup an SMS gateway, so visitors outside the window can start the tram on demand by sending a text message. :-)

    But first things first: I need a Python library to control the tram - and I would like to use pylgbst. But unfortunately, I cannot make it work.

    Before diving into the details, I want to add that it actually works with another Python library known as BrickNil. However, this library has its own set of challenges, and it seems to be completely unsupported - there hasn't been an update in three years, and PR and issues are unanswered. So I would prefer helping out to make pylgbst work.

    Hardware for the tram is determined by Lego: An 88009 SmartHub, an 88011 Train Motor, and an 88005 Light Set.

    BrickNil uses Bleak, and I can write a program and connect to the hub, change the colour of the builtin LED, and turn on the light in the external light set.

    However, when I try pylgbst on the same RPi and tram, nothing works. If I try using pylgbst with bluepy, it can find the hub, but reports that nothing is connected. If I try using Bleak, it cannot find anything at all.

    In issue #124 I found a small debug program. If I modify this to use a specific BT backend, I get these results for bluepy:

    lars@lego-sporvogn:~ $ sudo ./test.py 
    DEBUG:comms-bluepy:Trying to connect client to MoveHub with MAC: 90:84:2b:c6:9a:f8
    INFO:comms-bluepy:Discovering devices...
    DEBUG:comms:Checking device: None, MAC: xx:xx:xx:xx:xx:xx
    DEBUG:comms:Checking device: Smart Hub, MAC: 90:84:2b:c6:9a:f8
    INFO:comms:Found Smart Hub at 90:84:2b:c6:9a:f8
    DEBUG:comms-bluepy:Writing to handle 15: b'0100'
    lars@lego-sporvogn:~ $ 
    

    and for Bleak:

    lars@lego-sporvogn:~ $ ./test.py 
    DEBUG:asyncio:Using selector: EpollSelector
    DEBUG:asyncio:Using selector: EpollSelector
    INFO:comms-bleak:Discovering devices... Press green button on Hub
    lars@lego-sporvogn:~ $ 
    

    Nothing more before the test program times out.

    The RPi runs the latest Raspbian as of writing and updated to the latest and greatest everything. This means Python version 3.9.2.

    I would love to see this work - but we're in a bit of a hurry, our traditional Christmas exhibition in the shop window opens Dec. 1st. :-)

    opened by larsskj 23
  • Blue Tooth Connection

    Blue Tooth Connection

    Dear Sir


    (base) C:\Users\eojin>C:/Users/eojin/anaconda3/python.exe e:/pylgbst-master/examples/demo.py 44 INFO root Trying get_connection_bluepy 48 INFO root Trying get_connection_bluegiga 120 INFO pygatt.backends.bgapi.bgapi Initialized new BGAPI backend 121 INFO pygatt.backends.bgapi.bgapi Auto-detecting serial port for BLED112 146 INFO root Trying get_connection_gatt 185 INFO root Trying get_connection_bleak 270 INFO comms-bleak Discovering devices... Press green button on Hub C:\Users\eojin\anaconda3\lib\site-packages\pylgbst\comms\cbleak.py:142: FutureWarning: The discover function will removed in a future version, use BleakScanner.discover instead. devices = await discover(timeout=1) 11019 WARNING hub Got only these devices: (None, None, None, None, None, None, None) Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\eojin\anaconda3\lib\threading.py", line 973, in _bootstrap_inner self.run() File "C:\Users\eojin\anaconda3\lib\threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "C:\Users\eojin\anaconda3\lib\site-packages\pylgbst\comms\cbleak.py", line 50, in
    self._connection_thread = threading.Thread(target=lambda: asyncio.run(self._bleak_thread()))
    File "C:\Users\eojin\anaconda3\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\eojin\anaconda3\lib\asyncio\base_events.py", line 647, in run_until_complete return future.result() File "C:\Users\eojin\anaconda3\lib\site-packages\pylgbst\comms\cbleak.py", line 60, in _bleak_thread await bleak.connect(self.hub_mac, self.hub_name) File "C:\Users\eojin\anaconda3\lib\site-packages\pylgbst\comms\cbleak.py", line 157, in connect
    raise ConnectionError('Device not found.') ConnectionError: Device not found.

    How do I do? Or before starting your example. How to check connection?

    Thanks Best Regards

    opened by JaeYoungLee79 3
  • Connecting to WeDo SmartHub: no characteristic found

    Connecting to WeDo SmartHub: no characteristic found

    Hey there, first of all thanks @undera for creating this library! I am trying to connect to a Lego WeDo 2.0 SmartHub. I am a noob, but I read it should be compatible with Boost. I get this stack trace, does it sound like something easy to fix? Thanks!

    WARNING:pygatt.device:No characteristic found matching 00001624-1212-efde-1623-785feabcd123
    Traceback (most recent call last):
      File "./demo2.py", line 258, in <module>
        main()
      File "./demo2.py", line 18, in main
        movehub = SmartHub(conn)
      File "/usr/local/lib/python3.7/dist-packages/pylgbst-1.2.2-py3.7.egg/pylgbst/hub.py", line 359, in __init__
      File "/usr/local/lib/python3.7/dist-packages/pylgbst-1.2.2-py3.7.egg/pylgbst/hub.py", line 74, in __init__
      File "/usr/local/lib/python3.7/dist-packages/pylgbst-1.2.2-py3.7.egg/pylgbst/comms/cpygatt.py", line 54, in set_notify_handler
      File "/usr/local/lib/python3.7/dist-packages/pygatt/device.py", line 206, in subscribe
        self._notification_handles(uuid)
      File "/usr/local/lib/python3.7/dist-packages/pygatt/device.py", line 178, in _notification_handles
        value_handle = self.get_handle(uuid)
      File "/usr/local/lib/python3.7/dist-packages/pygatt/device.py", line 273, in get_handle
        raise exceptions.BLEError(message)
    pygatt.exceptions.BLEError: No characteristic found matching 00001624-1212-efde-1623-785feabcd123
    Exception ignored in: <function Hub.__del__ at 0x76572108>
    Traceback (most recent call last):
      File "/usr/local/lib/python3.7/dist-packages/pylgbst-1.2.2-py3.7.egg/pylgbst/hub.py", line 79, in __del__
      File "/usr/local/lib/python3.7/dist-packages/pylgbst-1.2.2-py3.7.egg/pylgbst/comms/cpygatt.py", line 47, in disconnect
      File "/usr/local/lib/python3.7/dist-packages/pygatt/backends/gatttool/device.py", line 16, in wrapper
    pygatt.exceptions.NotConnectedError: 
    
    opened by erjosito 7
  • Technic Hub Port AB doesnt work

    Technic Hub Port AB doesnt work

    Hello everyone, the library is great but I have problems with my Technic Hub. The BLE connection works without any problems, I can also control and use any motor. But I have problems with the AB port. Unfortunately, I cannot use two ports (A and B) at the same time.

    If the Demo.py goes to "movehub.motor_AB.timed(1.5, -0.2, 0.2)" an error occurs.

    With Run Debug I found out that the AB port is set to None. Can someone help me here.

    opened by ProfKingKong 16
  • [motors]Is there a way to ?

    [motors]Is there a way to ?

    Hi, Is there a way to use motor_AB() to launch a movement, then change primary and secondary speed as we wish ? To avance and turn with for example ?

    opened by djibb 1
Releases(1.2.2)
Owner
Andrey Pokhilko
Open Source evangelist with Python / Java / PHP background.
Andrey Pokhilko
Trashselected - Plugin for fman.io to move files that has been selected in fman to trash

TrashSelected Plugin for fman.io to move files that has been selected in fman to

null 1 Feb 4, 2022
pyToledo is a Python library to interact with the common virtual learning environment for the Association KU Leuven (Toledo).

pyToledo pyToledo is a Python library to interact with the common virtual learning environment for the Association KU Leuven a.k.a Toledo. Motivation

Daan Vervacke 5 Jan 3, 2022
A lightweight Python module to interact with the Mitre Att&ck Enterprise dataset.

enterpriseattack - Mitre's Enterprise Att&ck A lightweight Python module to interact with the Mitre Att&ck Enterprise dataset. Built to be used in pro

xakepnz 7 Jan 1, 2023
Python scripts to interact with Upper Deck ePack online trading card platform

This script should connect to the Upper Deck ePack API using your browser cookies and download a list of your current collection and save it as a CSV.

Adrian Kent 1 Nov 22, 2021
A web-based chat application that enables multiple users to interact with one another

A web-based chat application that enables multiple users to interact with one another, in the same chat room or different ones according to their choosing.

null 3 Apr 22, 2022
This collection is to provide an easier way to interact with Juniper

Ansible Collection - cremsburg.apstra Overview The goal of this collection is to provide an easier way to interact with Juniper's Apstra solution. Whi

Calvin Remsburg 1 Jan 18, 2022
JLC2KICAD_lib is a python script that generate a component library for KiCad from the JLCPCB/easyEDA library.

JLC2KiCad_lib is a python script that generate a component library (schematic, footprint and 3D model) for KiCad from the JLCPCB/easyEDA library. This script requires Python 3.6 or higher.

Nicolas Toussaint 73 Dec 26, 2022
K2HASH Python library - NoSQL Key Value Store(KVS) library

k2hash_python Overview k2hash_python is an official python driver for k2hash. Install Firstly you must install the k2hash shared library: curl -o- htt

Yahoo! JAPAN 3 Oct 19, 2022
Msgpack serialization/deserialization library for Python, written in Rust using PyO3 and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Aviram Hassan 139 Dec 30, 2022
PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standard Library.

PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standar

Collage Labs 10 Nov 19, 2022
🔩 Like builtins, but boltons. 250+ constructs, recipes, and snippets which extend (and rely on nothing but) the Python standard library. Nothing like Michael Bolton.

Boltons boltons should be builtins. Boltons is a set of over 230 BSD-licensed, pure-Python utilities in the same spirit as — and yet conspicuously mis

Mahmoud Hashemi 6k Jan 6, 2023
A Python library to simulate a Zoom H6 recorder remote control

H6 A Python library to emulate a Zoom H6 recorder remote control Introduction This library allows you to control your Zoom H6 recorder from your compu

Matias Godoy 68 Nov 2, 2022
Python library for creating PEG parsers

PyParsing -- A Python Parsing Module Introduction The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the t

Pyparsing 1.7k Jan 3, 2023
Python library to natively send files to Trash (or Recycle bin) on all platforms.

Send2Trash -- Send files to trash on all platforms Send2Trash is a small package that sends files to the Trash (or Recycle Bin) natively and on all pl

Andrew Senetar 224 Jan 4, 2023
Python screenshot library, replacement for the Pillow ImageGrab module on Linux.

tldr: Use Pillow The pyscreenshot module is obsolete in most cases. It was created because PIL ImageGrab module worked on Windows only, but now Linux

null 455 Dec 24, 2022
A functional standard library for Python.

Toolz A set of utility functions for iterators, functions, and dictionaries. See the PyToolz documentation at https://toolz.readthedocs.io LICENSE New

null 4.1k Jan 4, 2023
🔩 Like builtins, but boltons. 250+ constructs, recipes, and snippets which extend (and rely on nothing but) the Python standard library. Nothing like Michael Bolton.

Boltons boltons should be builtins. Boltons is a set of over 230 BSD-licensed, pure-Python utilities in the same spirit as — and yet conspicuously mis

Mahmoud Hashemi 5.4k Feb 20, 2021
Retrying library for Python

Tenacity Tenacity is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just

Julien Danjou 4.3k Jan 2, 2023