You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/Users/chenh/Library/Python/3.12/lib/python/site-packages/i2cpy/driver/ch341/__init__.py", line 13, in <module>
from .dll import ch341dll
File "/Users/chenh/Library/Python/3.12/lib/python/site-packages/i2cpy/driver/ch341/dll.py", line 47, in <module>
ch341dll = load()
^^^^^^
File "/Users/chenh/Library/Python/3.12/lib/python/site-packages/i2cpy/driver/ch341/dll.py", line 22, in load
dll = cdll.LoadLibrary(dll_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ctypes/__init__.py", line 460, in LoadLibrary
return self._dlltype(name)
^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ctypes/__init__.py", line 379, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: dlopen(libch347.so, 0x0006): tried: 'libch347.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibch347.so' (no such file), '/usr/lib/libch347.so' (no such file, not in dyld cache), 'libch347.so' (no such file), '/usr/lib/libch347.so' (no such file, not in dyld cache)
The text was updated successfully, but these errors were encountered:
Short answer is i2cpy does not really support macOS yet.
Actually my present code is not just missing that libch347.so file, it also lacks the logic that initializes ch341 and finding device handlers on macos. And it looks to me that it's hard to get it work for I2C on macOS. I should fix my doc to explicitly mention that macOS is not supported.
And here let me note what parts are possible to work, and what are not, as I am trying it now:
For I2C/SPI QinHeng has a driver zipball downloadable here https://www.wch-ic.com/downloads/CH341PAR_MAC_ZIP.html It has not the libch347.so which exists in their Linux zipball. On macOS it has a libch347.a file. It's however possible to extract obj files from this libch347.a file and build a libch347.so file.
On this basis I can update my Python code, according to their pdf doc which is included in above mentioned zip ball, for how to get it work on macOC. Basically I can firstly call CH34xInit() to initialize the library, and then use CH34xGetDeviceList() to get all devices. And once the CH341 device is detected, from output of CH34xGetDeviceList() I can get the device handle. The rest should ideally be similar to what we do on Linux. However, CH34xStreamI2C() seems to be buggy on macOS in that when I do several write/read operations, it could be good at first couple write/reads but then fail timeout at later CH34xStreamI2C operations.
error in below
The text was updated successfully, but these errors were encountered: