getsenic / nuimo-linux-python

Nuimo Python SDK for Linux to connect and communicate with Nuimo controllers made by Senic
https://senic.com
MIT License
52 stars 20 forks source link

linux sdk not working on ubuntu 16.04 #2

Closed gierdo closed 8 years ago

gierdo commented 8 years ago

Hi!

The linux sdk is not working on ubuntu 16.04. The test program fails with the following errors:

$ sudo PYTHONPATH=./nuimo python examples/test.py started discovery Traceback (most recent call last): File "examples/test.py", line 92, in <module> main() File "examples/test.py", line 29, in main nuimo_manager.start_discovery() File "/home/dominik/workspace_other/nuimo-linux-python/nuimo/nuimo.py", line 324, in start_discovery self.nuimos = self.create_nuimos(all_discovered_devices) File "/home/dominik/workspace_other/nuimo-linux-python/nuimo/nuimo.py", line 338, in create_nuimos return [NuimoController(device) for device in self.filter_nuimos(devices)] File "/home/dominik/workspace_other/nuimo-linux-python/nuimo/nuimo.py", line 335, in filter_nuimos return [addr for addr, attrs in devices.items() if attrs.get('name') == 'Nuimo'] AttributeError: 'str' object has no attribute 'get'

Python is installed from the default sources (2.7.12), the sdk was installed as specified in the Readme with pygattlib from the specified sources.

The issue appears to be this: issue 27

If pygattlib is installed from https://bitbucket.org/OscarAcena/pygattlib everything works fine. The fix: diff

larsblumberg commented 8 years ago

Thanks a lot! We'll have a look into it.

larsblumberg commented 8 years ago

Fixed with #4 – Nuimo SDK is now using the original repo as you also suggested. Thanks to @gross1989 for the PR!

naimo84 commented 8 years ago

For me, it only works, if I install it from here:

git clone https://github.com/matthewelse/pygattlib

My install.sh is still (cloned it on September, 8th):

pygattlib) echo "Installing Pygattlib and dependencies" set -x sudo apt-get install pkg-config libboost-python-dev libboost-thread-dev libbluetooth-dev libglib2.0-dev python-dev [ ! -d pygattlib ] && git clone https://github.com/matthewelse/pygattlib cd pygattlib && sudo python setup.py install ;;

I'm developing on a Raspberry Pi 3

gross1989 commented 8 years ago

The fork of matthewelse has a working discovery method similar to these proposals: 1 and 2, but it is some commits behind the original and less frequently updated or not maintained any longer.

I suggest to instantiate with the mac address, which works in any case.

larsblumberg commented 7 years ago

Hi @gierdo, @naimo84 please try our all new Nuimo Python SDK. It now uses BlueZ's D-Bus API directly. Please find all information here: https://github.com/getsenic/nuimo-linux-python