Coder Social home page Coder Social logo

0-1-0 / lightblue-0.4 Goto Github PK

View Code? Open in Web Editor NEW
97.0 14.0 93.0 302 KB

LightBlue python module that compiles successful on OS X 10.8 (Mountain Lion)

License: GNU General Public License v3.0

Python 60.61% Objective-C 24.63% C 9.06% C++ 5.15% Makefile 0.55%

lightblue-0.4's Issues

Issue with OS X yosemite

Hi

I have been getting this error whenever I try to import the lightblue module

Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.7/site-packages/lightblue/init.py", line 160, in
from _lightblue import *
File "/Library/Python/2.7/site-packages/lightblue/_lightblue.py", line 296, in
class _SDPQueryRunner(Foundation.NSObject):
objc.error: _SDPQueryRunner is overriding existing Objective-C class

I have tried the 2nd suggestion found here http://stackoverflow.com/questions/22279913/how-to-install-either-pybluez-or-lightblue-on-osx-10-9-mavericks but no luck.

Any help would be appreciated :)

unable to install via python

I run python setup.py install but I get errors. I'm using OSX 10.13.2. I tried changing the permission of the Library/Frameworks folder to rwx for staff but this error persisted. Any ideas?

(py2710) Adams-MacBook-Pro-4:lightblue-0.4 adamnoack$ python setup.py install
running install
running build
running build_py
running install_lib
running install_egg_info
Removing /Users/adamnoack/anaconda/envs/py2710/lib/python2.7/site-packages/lightblue-0.4-py2.7.egg-info
Writing /Users/adamnoack/anaconda/envs/py2710/lib/python2.7/site-packages/lightblue-0.4-py2.7.egg-info
Build settings from command line:
    ARCHS = x86_64
    DEPLOYMENT_LOCATION = YES
    DSTROOT = /
    INSTALL_PATH = /Library/Frameworks

=== BUILD TARGET LightAquaBlue OF PROJECT LightAquaBlue WITH CONFIGURATION Release ===

Check dependencies

Write auxiliary files
write-file /Users/adamnoack/Desktop/thesis_research/python-mindwave-mobile-py27/lightblue-0.4/src/mac/LightAquaBlue/build/LightAquaBlue.build/Release/LightAquaBlue.build/Objects-normal/x86_64/LightAquaBlue.LinkFileList
/bin/mkdir -p /Users/adamnoack/Desktop/thesis_research/python-mindwave-mobile-py27/lightblue-0.4/src/mac/LightAquaBlue/build/SharedPrecompiledHeaders/LightAquaBlue_Prefix-hdesrmpelnbqitggrloyogevohmt
write-file /Users/adamnoack/Desktop/thesis_research/python-mindwave-mobile-py27/lightblue-0.4/src/mac/LightAquaBlue/build/SharedPrecompiledHeaders/LightAquaBlue_Prefix-hdesrmpelnbqitggrloyogevohmt/LightAquaBlue_Prefix.pch.pch.hash-criteria

Create product structure
/bin/mkdir -p /Library/Frameworks/LightAquaBlue.framework/Versions/A
error: Unable to create directory: /Library/Frameworks/LightAquaBlue.framework/Versions/A (Permission denied)

** INSTALL FAILED **


The following build commands failed:
	Create product structure
(1 failure)

Can't Install on Mac OS 13.2.1

What I've tried

Per installation instructions, download and extract source code, execute sudo python3 setup.py install

What happens

Installation fails with the following output:


/Users/user/Desktop/lightblue-0.4-master/src/mac/LightAquaBlue/BBServiceAdvertiser.m:128:20: error: implicit declaration of function
      'IOBluetoothAddServiceDict' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        IOReturn status = IOBluetoothAddServiceDict((CFDictionaryRef) sdpEntries, &serviceRecordRef);
                          ^
/Users/user/Desktop/lightblue-0.4-master/src/mac/LightAquaBlue/BBServiceAdvertiser.m:142:3: error: implicit declaration of function 'IOBluetoothObjectRelease'
      is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                IOBluetoothObjectRelease(serviceRecordRef);
                ^
/Users/user/Desktop/lightblue-0.4-master/src/mac/LightAquaBlue/BBServiceAdvertiser.m:151:9: error: implicit declaration of function
      'IOBluetoothRemoveServiceWithRecordHandle' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return IOBluetoothRemoveServiceWithRecordHandle(handle);
               ^
3 errors generated.

** INSTALL FAILED **


The following build commands failed:
	CompileC /Users/user/Desktop/lightblue-0.4-master/src/mac/LightAquaBlue/build/LightAquaBlue.build/Release/LightAquaBlue.build/Objects-normal/x86_64/BBServiceAdvertiser.o /Users/user/Desktop/lightblue-0.4-master/src/mac/LightAquaBlue/BBServiceAdvertiser.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'LightAquaBlue' from project 'LightAquaBlue')
(1 failure)

Can't install light blue on macOS 11.5

lightblue-0.4 % sudo python setup.py install
Password:
running install
running build
running build_py
running install_lib
byte-compiling /Users/timothedesbordes/opt/anaconda3/lib/python3.8/site-packages/lightblue/_bluetoothsockets.py to _bluetoothsockets.cpython-38.pyc
File "/Users/timothedesbordes/opt/anaconda3/lib/python3.8/site-packages/lightblue/_bluetoothsockets.py", line 391
except _socket.error, err:
^
SyntaxError: invalid syntax

byte-compiling /Users/timothedesbordes/opt/anaconda3/lib/python3.8/site-packages/lightblue/_lightblue.py to _lightblue.cpython-38.pyc
File "/Users/timothedesbordes/opt/anaconda3/lib/python3.8/site-packages/lightblue/_lightblue.py", line 60
except _lightbluecommon.BluetoothError, e:
^
SyntaxError: invalid syntax

byte-compiling /Users/timothedesbordes/opt/anaconda3/lib/python3.8/site-packages/lightblue/_macutil.py to _macutil.cpython-38.pyc
File "/Users/timothedesbordes/opt/anaconda3/lib/python3.8/site-packages/lightblue/_macutil.py", line 43
kIOBluetoothServiceBrowserControllerOptionsNone = 0L
^
SyntaxError: invalid syntax

running install_egg_info
Removing /Users/timothedesbordes/opt/anaconda3/lib/python3.8/site-packages/lightblue-0.4-py3.8.egg-info
Writing /Users/timothedesbordes/opt/anaconda3/lib/python3.8/site-packages/lightblue-0.4-py3.8.egg-info
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild install -target LightAquaBlue -configuration Release DSTROOT=/ INSTALL_PATH=/Library/Frameworks DEPLOYMENT_LOCATION=YES

User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
DEPLOYMENT_LOCATION = YES
DSTROOT = /
INSTALL_PATH = /Library/Frameworks

note: Using new build system
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
error: unable to find sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.4u.sdk' (in target 'LightAquaBlue' from project 'LightAquaBlue')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'LightAquaBlue' from project 'LightAquaBlue')

** INSTALL FAILED **

error on Mac OS X 10.13.1

when try to connect a device , it raise an exception in file _macutil.py at line 75:

'module' object has no attribute 'BluetoothDeviceAddress'

error msg:

Traceback (most recent call last):
  File "test.py", line 26, in <module>
    crash(target)
  File "test.py", line 10, in crash
    sock.connect((target, 0xf))
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_bluetoothsockets.py", line 351, in connect
    _macutil.createbtdevaddr(address[0]))
ValueError: depythonifying struct of 1 members, got tuple of 6

CompileC error

This is the error I get:
The following build commands failed:
CompileC /Users/thomask/Downloads/lightblue-0.4-master/src/mac/LightAquaBlue/build/LightAquaBlue.build/Release/LightAquaBlue.build/Objects-normal/x86_64/BBServiceAdvertiser.o /Users/thomask/Downloads/lightblue-0.4-master/src/mac/LightAquaBlue/BBServiceAdvertiser.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'LightAquaBlue' from project 'LightAquaBlue')
(1 failure)

Anyone knows what to do?

NSInvalidArgumentException on send (El Capitain, python 2.7)

Hello,
When running the simple_server.py example, the read is successful, but the write fails.

Connected by ('10:BF:48:D1:22:B8', 1)
Echoing received data: This is my test
Traceback (most recent call last):
  File "simple_server.py", line 18, in <module>
    conn.send(data)
  File "build/bdist.macosx-10.6-x86_64/egg/lightblue/_bluetoothsockets.py", line 524, in send
  File "build/bdist.macosx-10.6-x86_64/egg/lightblue/_bluetoothsockets.py", line 737, in write
ValueError: NSInvalidArgumentException - Class OC_PythonObject: no such selector: bytes

Thanks.

Unable to successfully import lightblue after installation

I'm running OSX 10.8.3 and encounter an error when trying to import the library.

Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import lightblue

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/__init__.py", line 160, in <module>
    from _lightblue import *
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_lightblue.py", line 398, in <module>
    class _AsyncDeviceInquiry(Foundation.NSObject): 
TypeError: Error when calling the metaclass bases
    class _AsyncDeviceInquiry does not fully implement protocol IOBluetoothDeviceInquiryDelegate: no implementation for deviceInquiryDeviceNameUpdated:device:devicesRemaining:

Import error

Hi Guys,

After install lightblue i got this:

Traceback (most recent call last):
File "", line 1, in
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/init.py", line 160, in
from _lightblue import *
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_lightblue.py", line 297, in
class _SDPQueryRunner(Foundation.NSObject):
objc.error: _SDPQueryRunner is overriding existing Objective-C class

any ideia?

Implicit declaration of function 'IOBluetooth*' is invalid in C99 on macos 11.1

Project is not building because of those three errors:

/Users/isoto/dev/lightblue-0.4/src/mac/LightAquaBlue/BBServiceAdvertiser.m:128:20: Implicit declaration of function 'IOBluetoothAddServiceDict' is invalid in C99

/Users/isoto/dev/lightblue-0.4/src/mac/LightAquaBlue/BBServiceAdvertiser.m:142:3: Implicit declaration of function 'IOBluetoothObjectRelease' is invalid in C99

/Users/isoto/dev/lightblue-0.4/src/mac/LightAquaBlue/BBServiceAdvertiser.m:151:9: Implicit declaration of function 'IOBluetoothRemoveServiceWithRecordHandle' is invalid in C99

help

how to install in windows

No architectures to compile for (ARCHS=$(NATIVE_ARCH_ACTUAL)

The installer exits with a failure on my mac:

Check dependencies
No architectures to compile for (ARCHS=$(NATIVE_ARCH_ACTUAL), VALID_ARCHS=i386 x86_64).

** INSTALL FAILED **

It happens both within and outside a virtualenv

What to do? Any ideas?
I'm on MacOS X 10.8.4 with Xcode and command line developer tools installed. 2.4ghz intel core 2 duo.

Signature mismatch for `deviceInquiryComplete:error:aborted`

I get the following error when I first import lightblue:

Traceback (most recent call last):
  File "commander.py", line 3, in <module>
    import lightblue
  File "/usr/local/lib/python2.7/site-packages/lightblue/__init__.py", line 160, in <module>
    from _lightblue import *
  File "/usr/local/lib/python2.7/site-packages/lightblue/_lightblue.py", line 397, in <module>
    class _AsyncDeviceInquiry(Foundation.NSObject):
TypeError: Error when calling the metaclass bases
    class _AsyncDeviceInquiry does not correctly implement protocol IOBluetoothDeviceInquiryDelegate: the signature for method deviceInquiryComplete:error:aborted: is v@:@iB instead of v@:@iZ

LightBlue describes how to resolve this signature mismatch (and I posted a more thorough explanation on Stack Overflow). Since this repo seems to expressly target OS X 10.8, though, I'm wondering if the patch should be in the core code rather than left to the user as a post-install fix.

Are there any 10.8 machines that do need the v@:@iB signature? Unless it varies across Mac hardware, I think the signature should be changed in the code to v@:@iZ.

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.