Skip to content

Instantly share code, notes, and snippets.

View mac-can's full-sized avatar
💭
Do one thing, and do it well.

Uwe Vogt mac-can

💭
Do one thing, and do it well.
View GitHub Profile
@mac-can
mac-can / PCBUSB-Installation.md
Last active July 19, 2022 07:23
PCBUSB Installation

How to install the PCBUSB-Library on Mac

The PCBUSB-Library realizes an USB to CAN user-space driver under macOS for PCAN-USB interfaces from PEAK-System Technik, Darmstadt.

This Gist describes how to install the library.

Download the Library

First download the library either from the MacCAN homepage or from the GitHub repo.

@mac-can
mac-can / PCBUSB-Troubleshooting.md
Created February 13, 2022 17:57
PCBUSB Library on macOS Monterey and/or Apple Silicon

Troubleshooting Guide for PCBUSB Library on macOS Monterey and/or Apple Silicon

If you encounter problems installing or using libPCBUSB.dylib on macOS Monterey (12.x) and/or Apple Silicon (M1 chip), this guide may help you isolate the problem.

1. Try out the utilities from the PCBUSB-Utilities repo

To basically check whether the PCAN hardware runs on your Mac or is supported by the PCBUSB driver, you can try the PCBUSB-Utilities. The utilities can_test and can_moni are standalone programs that run in user space and do not require the PCBUSB dylib to be installed.

Download and unzip the artifact(s) from latest tag. Do not run the install.sh script. Instead, run the binaries directly in a terminal session. Type either can_test --help or can_moni --help to see all program options.

@mac-can
mac-can / PCANBasic.py
Last active August 8, 2022 12:06
macOS Library for PCAN-USB Interfaces: Python Example
# PCANBasic.py
#
# ~~~~~~~~~~~~
#
# PCAN-Basic API
#
# ~~~~~~~~~~~~
#
# ------------------------------------------------------------------
# Author : Keneth Wagner
@mac-can
mac-can / pcan_recv.cpp
Created May 7, 2021 21:04
macOS Library for PCAN-USB Interfaces: Blocking Read Example
//
// macOS Library for PCAN-USB Interfaces
// Example: receive CAN messages (Blockng read)
//
// To compile type `clang++ pcbusb_recv.cpp -l PCBUSB -o pcbusb_recv'
// libPCBUSB.dylib is expected to be in the library search path.
//
// Note: Press Ctrl+C to terminate the program.
//
#include <stdio.h>