Comments (4)
Since reporting the issue, I was able to get this to work:
- Tried to compile
hidapi
directly on macOS Catalina, which I couldn't get to work. - Compiled
hidapi
on macOS Mojave, which installed it to/usr/local/lib
. - I was able to use
hidapi
and this module on Mojave to control a Blynclight. Yay! - Copied that and installed the
hidapi
files to the same location on macOS Catalina. - I was able to use this module on Catalina to control a Blynclight.
- Profit!
So, it seems like the problem is either with a) what the MacPorts port
command produced or b) with the location where it was installed. MacPorts installs under /opt
.
Assuming it compiled correctly, I'm wondering if the /opt
location is or can be searched for the library. I'm not sure how to check — or set — that for libraries (like PATH for executables).
From MacPorts:
$ ls -1 /opt/local/lib/ | grep hid
libhidapi.0.dylib
libhidapi.a
libhidapi.dylib
What I copied from macOS Mojave:
$ ls -1 /usr/local/lib/ | grep hid
libhidapi.0.dylib
libhidapi.a
libhidapi.dylib
libhidapi.la
Update: I found these references:
- ctypes — A foreign function library for Python
- Which paths does python ctypes module search for libraries on Mac OS?
The MacPorts path of /opt
is not in the list, per the Stackoverflow article. I'm still not sure how to / if it's possible to add a path for ctypes.util.find_library
to search.
Update 2: Also found something that appears similar:
I will keep looking to find a way to add /opt
.
from blynclight.
The error in your traceback comes from ctypes.util.find_library
failing to find the installed hidapi
library.
import ctypes.util
print(ctypes.util.find_library('hidapi'))
I'm not familiar with port
so I don't know how it manages the files it installs.
from blynclight.
Thanks for all the detailed information on what you had to do to get BlyncLight running!
I'll dig into find_library
and see if I can improve how the shared library is located.
from blynclight.
So looking at the code for ctypes.util.macholib.dylib
I found an environment variable you can set to help find_library
.. uh.. find the library.
$ export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib
I tested this on my macOS 10.15.5 installation after installing Mac Ports:
$ which port
/opt/local/bin/port
$ brew uninstall hidapi
...
$ blync -a
<blows up>
$ sudo port install hidapi
...
$ blync -a
<still blows up, expected>
$ export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib
$ blync -a
Number of available lights: 1
KEY:ID:VALUE
path:00:IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/TRP0@7/IOPP/PXSX@0/IOPP/pci-bridge@2/IOPP/pci1b21,1242@0/AppleUSBXHCIPCI@00000000/AppleUSB20XHCIPort@00300000/Blynclight Plus@00300000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice
vendor_id:00:0x2c0d
product_id:00:0x10
release_number:00:0x100
product_string:00:Blynclight Plus
usage_page:00:0xff00
usage:00:0x1
interface_number:00:0x0
Add that to your shell's profile script and you should be able to skip copying things to /usr/local.
from blynclight.
Related Issues (20)
- Commands to Light Not Processing HOT 17
- Support PyUSB & HIDAPI
- ear HOT 1
- pip3 install in editable mode doesn't work HOT 1
- Flash not working HOT 3
- Installing on a Raspberry Pi HOT 20
- Control from iOS shortcut application HOT 3
- "No such device" error with blync CLI HOT 15
- ImportError after Pip update to v0.8.0 HOT 9
- ship a command line interface and driver script HOT 1
- [QUESTION] Source of COMMAND_LENGTH HOT 3
- RFE: add a udev rule to docs HOT 6
- Candle flicker effect command-line interface.
- Light not recognized. HOT 5
- MacOSX - usb.core.NoBackendError: No backend available when calling BlyncLight.available_lights() HOT 14
- Add an effects package. HOT 1
- Create a simple API server and ship in scripts directory.
- Python version testing with tox
- Relax version requirements for Python from only 3.7 to 3.5 or better HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blynclight.