What permissions does LJM need?
By default, LJM tries to access the following:
- Local file system
- USB
- Network
- Named mutexes
Some programing environments constrain permissions by default. If LJM is not working, it's worth checking if permissions are set correctly.
Set LJM Configurations Before Accessing Devices
The LJM configurations mentioned on this page should essentially be set before any other LJM calls, like LJM_Open
, since they alter the behavior of functions LJM_Open
.
Use LJM_WriteLibraryConfigS to set the configurations that take numbers as values.
Use LJM_WriteLibraryConfigStringS to set the configurations that take strings as values.
Local file system
Necessary
LJM needs to access a ljm_constants.json
file so that it can look up register information. By default, LJM tries to read the ljm_constants.json
file from the location where ljm_constants.json
is installed. However, the location of ljm_constants.json
can be specified via the LJM_CONSTANTS_FILE
configuration. For more information, see LJM_CONSTANTS_FILE.
The following shows an example of error output when the ljm_constants.json
file could not be accessed:
The error constants file /usr/local/share/LabJack/LJM/ljm_constants.json
could not be opened.
Optional
LJM may access other files on the file system for the purposes of improving network device detection, configuration, and debug logging.
USB
LJM needs access to USB in order to communicate via USB with LabJack devices. Alternately, you can use network connections or demo mode.
Network
LJM needs access to the network in order to communicate via TCP or UDP with LabJack devices. Alternately, you can use USB connections or demo mode.
For LJM on Windows UWP, TCP communications require the internetClientServer
capability.
Optional
Each LJM instance (each process that loads LJM, including LabJack Kipling) tries to communicate with other LJM instances for the purpose of identifying and sharing USB connections to LabJack devices. Since this functionality is not necessarily important, you can disable gRPC.
The following shows an example of error output that may result from LJM's usage of gRPC failing due to permissions on a Unix-based machine:
E0205 16:05:30.305708000 4295751104 server_chttp2.c:53] {"created":"@1549404330.305647000","description":"No address added out of total 1 resolved","file":"src/core/ext/transport/chttp2/server/chttp2_server.c","file_line":260,"referenced_errors":[{"created":"@1549404330.305643000","description":"Failed to add any wildcard listeners","file":"src/core/lib/iomgr/tcp_server_posix.c","file_line":353,"referenced_errors":[{"created":"@1549404330.305592000","description":"OS Error","errno":47,"file":"src/core/lib/iomgr/socket_utils_common_posix.c","file_line":271,"os_error":"Address family not supported by protocol family","syscall":"socket","target_address":"[::]:0"},{"created":"@1549404330.305643000","description":"Unable to configure socket","fd":4,"file":"src/core/lib/iomgr/tcp_server_utils_posix_common.c","file_line":215,"referenced_errors":[{"created":"@1549404330.305631000","description":"OS Error","errno":1,"file":"src/core/lib/iomgr/tcp_server_utils_posix_common.c","file_line":188,"os_error":"Operation not permitted","syscall":"bind"}]}]}]}
Named Mutexes
LJM uses named mutexes to synchronize usage gRPC. To circumvent this, you can disable gRPC by setting LJM_RPC_ENABLE
to 0
.
LJM uses named mutexes to synchronize usage of the LJM Auto IPs file. To circumvent this, you can disable LJM Auto IPs by setting LJM_AUTO_IPS
to 0
.