Closed mauriciofarina closed 2 years ago
An update,
I got able to access the device by compiling your PCBUSB-Wrapper and running the can_moni application. However, the Python example in this repository doesn't work either.
Running the can_recv.py
example I get:
CAN API V3 for generic CAN Interfaces (Python Wrapper 0.1.1)
>>> can = CANAPI(libUVCANPCB.dylib)
>>> can.init(81, 0x00)
+++ error: can.init returned -202
I think the problem might be related to the libUVCANPCB.dylib
/libPCBUSB.dylib
dll
First, there is no Kernel driver for the PCAN USB interfaces. USB is part of the OS and the access to the CAN device is build upon the USB URBs in user space.
That the CLI tool can_moni
is running on Monterey is good. It means that the “driver” implementation is still compatible with the news version of Apple´s mostest advanced operation system.
can_moni
does not depend on the PCBUSB library. The “driver” sources are built in. In this sense, it is a driverless CAN application. Your issue then seems to be an installation problem.
Can you please check if
• the symbolic link libPCBUSB.dylib
is located in the folder /usr/local/lib
and
• it points to the dynamic library libPCBUSB.0.10.dylib
(in the same folder)
• that the permissions -rw-r-r-x
are set correctly and
• the folder /usr/local/lib
is in the library search path
When all these conditions are fulfilled, please check the security setting on your Mac.
I checked the files in /usr/local/lib
and it all seems ok
-rwxr-xr-x@ 1 mauricio admin 151496 Oct 27 16:35 libPCBUSB.0.10.dylib
lrwxr-xr-x 1 root admin 35 Oct 27 16:35 libPCBUSB.dylib -> /usr/local/lib/libPCBUSB.0.10.dylib
About the last item, the PCANBasic.py
searches the library this way:
self.__m_dllBasic = cdll.LoadLibrary("libPCBUSB.dylib")
Not sure if that's what you're asking for...
Regarding the security settings, I couldn't find any thing relevant under the Security & Privacy menu.. What do you suggest checking?
I'm facing basically exactly the same issue: Monterrey, permissions are correct. cddl.LoadLibrary loads correctly, but unable to initialize the connection w/ the report of "NODRIVER"
Hey guys, can you try to compile and run the PCBUSB Monitor App. It also loads the PCBUSB dylib at run-time. Just to make sure it is not a Python issue on Monterey.
I also thought this could be the issue. However, I tried installing anaconda and running with different python releases and the problem persisted. So I don't think this is the problem... Anyway, I'll try the Monitor App and I'll let you know
@mauriciofarina A while ago I´ve patched the PCANBasic.py from Peak-System after I ran into problems with Python 2.7 on macOS (10.13 and 11.x). Maybe you can try out this patch: PCANBasic.zip See also my Gist macOS Library for PCAN-USB Interfaces: Python Example
@mac-can I tried using the patch you provided and compiling the PCBUSB Monitor App (V0.3) and, in both cases, the problem persists.
The error is always the same (No driver Loaded)...
Here's a screenshot of the Monitor App Screen and Xcode Logs:
hmm, ...
The library is compiled with the old Eclipse build environment; no target system is set, so it still runs under macOS 10.x. Maybe that this is denied by macOS 12.x and reveals the error message.
A preliminary version of the PCBUSB dylib compiled as Universal macOS Binary can be downloaded here: https://www.uv-software.de/dokuwiki/doku.php?id=uvs:programs:pcbusb_library It should run on Intel and ARM architectures, but it is not tested on arm64. And a colleague has confirmed that it is running on Monterey.
Happy CANgineering.
Hello @mac-can !
Just tried the preliminary version and it work perfectly!
Thank you for the help!
python3 pcbusb_recv.py
Error: (0, b'The driver is not loaded')
Same Issue on Monterey :(
Well, seems it work once ...
ls -la /usr/local/lib/libPC*
-rwxr-xr-x@ 1 flow admin 151496 May 6 2021 /usr/local/lib/libPCBUSB.0.10.dylib
-rwxr-xr-x@ 1 flow admin 401616 Feb 7 12:57 /usr/local/lib/libPCBUSB.0.11.dylib
lrwxr-xr-x 1 flow admin 35 Feb 7 12:57 /usr/local/lib/libPCBUSB.dylib -> /usr/local/lib/libPCBUSB.0.11.dylib
Tried different versions ... and nothing. Intel x64 platform
@taraskarpuk
Did you tried this?
hmm, ...
The library is compiled with the old Eclipse build environment; no target system is set, so it still runs under macOS 10.x. Maybe that this is denied by macOS 12.x and reveals the error message.
A preliminary version of the PCBUSB dylib compiled as Universal macOS Binary can be downloaded here: https://www.uv-software.de/dokuwiki/doku.php?id=uvs:programs:pcbusb_library It should run on Intel and ARM architectures, but it is not tested on arm64. And a colleague has confirmed that it is running on Monterey.
Happy CANgineering.
@mauriciofarina What does preliminary version mean? i have tried 0.11 version
@taraskarpuk the preliminary version is the OS_X_Library_for_PCANUSB_v0.10.ub.tar
file. Try using it and see if it works for you. That was the solution for me!
Ok! Now it's working with "MacCan Monitor"... But i use python-can library... And seems i have problem with sending messages. Transmits only ID and DLC=0 and No data transmitted
Hi all, I saw that you have already solved the issue. Nevertheless, for root causing of issues related to installing or using libPCBUSB.dylib on macOS Monterey (12.x) and/or Apple Silicon (M1 chip) I´ve created a trouble shooting guide and published it as a Gist. Uwe
Hello!
After upgrading my Mac to Monterey I lost access to my device. When Running the Python Example I receive the error:
Error: (0, b'The driver is not loaded')
The Mac still recognizes the PCAN-USB device and shows it on system report menu
I tried searching on how to reload Mac drivers and things like that, but I have no experience on Mac drivers, kernel....