Compare commits

...

2 Commits

Author SHA1 Message Date
b08f819bdc
readme: update with platform-specific information
Turns out using USB hardware sucks everywhere, in slightly different
ways.
2024-07-04 11:37:27 -07:00
8feb520d8f
add (almost certainly wrong) macos entitlements file
This is not currently used.
2024-07-04 11:36:12 -07:00
2 changed files with 40 additions and 3 deletions

View File

@ -12,8 +12,26 @@ I mostly just want this to run on Linux, as a static executable. The zig build s
Dependencies are fully vendored.
### Status
### Build
Build with `zig 0.13`.
Requires `zig` version `0.13.x` to compile.
It builds for Linux and macOS. It does not currently build for Windows due to `ljacklm` having a dependency on pthreads (specifically, it uses mutexes).
```shell
zig build
```
Unfortunately, all platforms have additional steps that must be taken (some easier than others) in order to run the program successfully.
#### Windows
This compiles for, and runs on, Windows. However, the Labjack U12 by default gets assigned the Windows USB HID driver, which causes the USB report descriptor control transfer read to get mangled for mystery reasons that presumably made sense to some egghead at Microsoft at some point in time. Fortunately, this can be relatively easily fixed by using a tool like [zadig] to set the Labjack U12 to use the WinUSB driver instead of the HID driver. This is not an endorsement of the above outlined process, but rather an explanation for persons either foolish or desperate.
#### macOS
This works on macOS, though it has to be run with `sudo`, as access to the USB hardware at user privilege level is gated by entitlements. Using entitlements is in turn gated by signature with an Apple Developer Certificate and Notarization, which may only be acquired with a paid Apple Developer Program subscription. If you have those, great. The provided `yaes.entitlements` is almost certainly not the correct set of entitlements, since I can't test it. Just run it with `sudo` whilst praising Tim Apple for the Most Advanced Operating System on the Planet.
#### Linux
You probably need to install the included udev rules file in order for the USB device to be accessible as a user. This is buried in the source tree as `deps/labjack/exodriver/90-labjack.rules`. These should probably go in `/etc/udev/rules.d` if you are installing them manually and I have properly understood the various Linux folder conventions.
[zadig]: https://zadig.akeo.ie

19
yaes.entitlements Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.developer.driverkit.transport.usb</key>
<array>
<dict>
<key>idVendor</key>
<integer>3285</integer>
</dict>
</array>
</dict>
</plist>