RuntimeError(“jsdrv open failed”) while using pyjoulescope_examples

Hitting the following error when trying to run using my JS220 Joulescope on a Mac OS with python3.11. I am trying to log battery current and voltage over a charge cycle (~3 hrs).

pyjoulescope_examples % bin/ 
Starting logging  - press CTRL-C to stop
Found one Joulescope
Traceback (most recent call last):
  File "/Users/rxxxxx/Code/pyjoulescope_examples/bin/", line 522, in <module>
  File "/Users/rxxxxx/Code/pyjoulescope_examples/bin/", line 518, in run
  File "/Users/rxxxxx/Code/pyjoulescope_examples/bin/", line 331, in run
  File "/Users/rxxxxx/Code/pyjoulescope_examples/bin/", line 265, in open
    self._devices[device] = LoggerDevice(self, device, self._start_time_s)
  File "/Users/rxxxxx/Code/pyjoulescope_examples/bin/", line 392, in __init__, mode='restore')
  File "pyjoulescope_driver/binding.pyx", line 859, in
  File "pyjoulescope_driver/binding.pyx", line 595, in pyjoulescope_driver.binding._handle_rc
RuntimeError: jsdrv_open failed -4 UNKNOWN | Unknown error | u/js220/002208

Hi @rdietz and welcome to the Joulescope forum!

I just tried a few things, and it appears that is the error you get when you attempt to run but the device is already in use. Only one program can access a Joulescope device at a time. Is the Joulescope UI still running? If you close the UI and all other programs that might be using the Joulescope, does work for you?

The error code -4 is LIBUSB_ERROR_NO_DEVICE, like from here. The code should convert the libusb error code into a jsdrv_error_code_e error code to generate a more meaningful error message…