nccgroup / BLESuite

BLESuite is a Python package that provides an easier way to test Bluetooth Low Energy (BLE) device
MIT License
176 stars 40 forks source link

ImportError: libboost_python-py27.so.1.55.0 #2

Open raulsiles opened 6 years ago

raulsiles commented 6 years ago

When using BLESuite, latest version from GIT (August 1, 2016), in Kali Linux 2017.3, the following error is generated when trying to run any of the default scripts from the "bleSuite" dir:

# python bleSmartScan.py -h
Traceback (most recent call last):
  File "bleSmartScan.py", line 4, in <module>
    from bleConnectionManager import BLEConnectionManager
  File "/Labs/BLE/BLESuite/BLESuite-master/bleSuite/bleConnectionManager.py", line 1, in <module>
    from gattlib import GATTRequester, GATTResponse
  File "build/bdist.linux-x86_64/egg/gattlib.py", line 7, in <module>
  File "build/bdist.linux-x86_64/egg/gattlib.py", line 6, in __bootstrap__
ImportError: libboost_python-py27.so.1.55.0: cannot open shared object file: No such file or directory

After creating a symbolic link from libboost 1.55 to the currently available (latest) libboost version, v1.62, the error message disappears:

# pwd
/usr/lib/x86_64-linux-gnu
# ln -s libboost_python-py27.so.1.62.0 libboost_python-py27.so.1.55.0

Then, a similar issue affects the related "thread" library:

# ln -s libboost_thread.so.1.62.0 libboost_thread.so.1.55.0

However, when a tool that makes use of BLESuite and that requires establishing a BLE connection is run, such as "https://github.com/nccgroup/BLESuite-CLI", a mismatch library error is generated:

# python ./bleSuite-runner.py smartScan --addr 0E:0A:B0:00:23:15
BTLE Smart Scan beginning
Traceback (most recent call last):
  File "./bleSuite-runner.py", line 12, in <module>
    main()
  File "/Labs/BLE/BLESuite/BLESuite-CLI-master/bleSuiteCLI/bleSuiteCLI.py", line 356, in main
    processArgs(args)
  File "/Labs/BLE/BLESuite/BLESuite-CLI-master/bleSuiteCLI/bleSuiteCLI.py", line 191, in processArgs
    args.addrType[0], args.security[0])
  File "/Labs/BLE/BLESuite/BLESuite-CLI-master/bleSuiteCLI/cmdLineToolWrappers.py", line 520, in bleRunSmartScan
    connectionManager = bleConnectionManager.BLEConnectionManager(address, adapter, addressType, securityLevel)
  File "/usr/local/lib/python2.7/dist-packages/bleSuite/bleConnectionManager.py", line 41, in __init__
    self.createRequester()
  File "/usr/local/lib/python2.7/dist-packages/bleSuite/bleConnectionManager.py", line 55, in createRequester
    self.requester = GATTRequester(self.address, False)
Boost.Python.ArgumentError: Python argument types in
    GATTRequester.__init__(GATTRequester, str, bool)
did not match C++ signature:
    __init__(_object*, std::string)
    __init__(_object*, std::string, bool)
    __init__(_object*, std::string, bool, std::string)

Is there any specific reason why BLESuite is linked to libboost v1.55, or could it make use of newer libboost versions?

raulsiles commented 6 years ago

The libboost references are associated to PyGattlib (from within the BLESuite "PyGattlib" directory):

Binary file ./build/lib.linux-x86_64-2.7/gattlib.so matches
./build/lib.linux-x86_64-2.7/gattlib.so
           libboost-python1.55-dev,
           libboost-thread1.55-dev,
./debian/control