We're running into a problem where if we connect to the labjack using python in linux, then log out and sign in as a different user, we aren't able to connect to the labjack again until we shutdown the computer and reboot. Once we do that it will connect normally.
Trying to connect to the labjack after switching users results in the following:
>>> h = ljm.openS("T7", "Ethernet", "192.168.0.20")
interprocess_exception: Permission denied
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/ner/lib/python2.7/site-packages/labjack/ljm/ljm.py", line 314, in openS
raise LJMError(error)
ljm.ljm.LJMError: LJM library error code 1221 LJME_UNKNOWN_ERROR
Later when I quit the python process I get the following:
python: /usr/local/include/boost/thread/pthread/mutex.hpp:111: boost::mutex::~mutex(): Assertion `!res' failed.
Is there something we can do to make it possible to connect to the labjack after switching users? Thanks,
Andrew
LJM version 1.1802 fixes a permissions issue with named mutexes, which sounds like the issue you're seeing. Please try updating:
https://labjack.com/support/software/installers/ljm
We're seeing this problem with the non-blocking version of LJM 1.1804 that you had supplied for us in response to this thread (https://labjack.com/forums/t7/register-access-blocking-while-streaming). I think that is a more recent version than what is available on the website.
Andrew
I've reproduced the issue and I will update this thread when I determine a permanent solution.
A workaround is to set the LJM config "LJM_RPC_ENABLE" to false before any other LJM calls. In Python:
ljm.writeLibraryConfigS("LJM_RPC_ENABLE", 0)
LJM 1.1805 fixes this issue (without need for the workaround mentioned above). It's currently available in a beta installer here:
https://labjack.com/support/software/installers/ljm