Monitoring data while running

Been working with Joulescope for a couple weeks now, and my I am needing to monitor and record data from a unit simultaneously over time. But, when I run while I have a Joulescope active I get multiple errors and nothing is written to the CSV file. When I disable the active Joulescope then run, it works just fine.

Starting logging - press CTRL-C to stop
Found 2 Joulescopes
2020-07-01T08:53:41 ERROR While running command
Traceback (most recent call last):
File “”, line 64, in _cmd_process
rv =
File “”, line 680, in open
raise IOError(’%s : open failed %s’ % (self, kernel32.get_last_error()))
OSError: Joulescope:001138 : open failed [6] The handle is invalid.

2020-07-01T08:53:41 ERROR While running command
Traceback (most recent call last):
File “”, line 74, in _cmd_process
self._device.control_transfer_in(cbk, *args, **kwargs)
File “”, line 772, in control_transfer_in
return self._control_transfer.pend(cbk_fn, pkt)
AttributeError: ‘NoneType’ object has no attribute ‘pend’
2020-07-01T08:53:44 ERROR device thread hung: control_transfer_in - FORCE CLOSE
2020-07-01T08:53:44 WARNING could not fetch info record
2020-07-01T08:53:44 WARNING could not fetch active calibration
2020-07-01T08:53:44 ERROR while capturing data
Traceback (most recent call last):
File “”, line 351, in run
File “”, line 341, in _open_devices
File “”, line 429, in open
info =
File “C:\Python38\lib\site-packages\joulescope\”, line 442, in info
rv = self._usb.control_transfer_in(
File “”, line 218, in control_transfer_in
return self._post_block(‘control_transfer_in’, (args, kwargs))
File “”, line 165, in _post_block
raise IOError(‘DeviceThread not running’)
OSError: DeviceThread not running

Any help would be greatly appreciated.
Thank you.

1 Like

Hi @RyanM and welcome to the Joulescope forum!

Let me first make sure that I understand what you are trying to do. I think that you have two Joulescopes connected to your host PC. You want to use one Joulescope with the script. You want to simultaneously use the other Joulescope with the Joulescope UI (or another different script).

Is this right?

I tried to duplicate what you see. Here is what I did:

  1. I connected two Joulescopes to my computer.
  2. I started the Joulescope UI, which opens the “first” Joulescope by default.
  3. I then tried running the script
  4. I saw the same error message you reported.

Currently, the script will attempt to open all connected Joulescopes. This case is not something that the script currently handles.

Just out of curiosity, I tried opening a second Joulescope UI with debugging available, and I initially get this same error. Manually selecting the other Joulescope works, though.

Please confirm that I understand what you are trying to do. In the meantime, I’ll take a quick look at the downsample_logging code.

Ideally I would like to be able to do this with just one Joulescope, I just happen to have two connected at the moment. The idea is to be able to have either the multimeter or o-scope view up and running while running the script.

Ok, I have one possible immediate workaround. First, I need to define some names. I will use js_log for the Joulescope you want to use with downsample_logging, and js_ui for the Joulescope you want to use with the Joulescope User Interface.

Here’s what you can do:

  • Disconnect the host USB connection from js_ui
  • Connect the host USB connection for js_log
  • Start It should find one Joulescope and run normally.
  • Connect the host USB connection for js_ui
  • Start the Joulescope UI. If it comes up disabled, manually select the “second” DevicesJoulescope device.

Not ideal, but does this solve the immediate need?

You will never be able to run the downsample_logging script (at least in anything close to its existing form) with the Joulescope UI also receiving data. Application access to a Joulescope is exclusive, so only one application can connect to a Joulescope at a time. We could add the ability for the Joulescope UI to record the statistics data (the same data used by and the multimeter) to a CSV file, just like downsample_logging does.

Does this match what you want?

The downside is that you lose the automatic recovery mechanism on computer reboots and all other strange, unexpected errors that is part of downsample_logging.

1 Like

Yes, it does indeed match what I want. It is unfortunate that it isn’t possible to do both application from the same Joulescope currently. Thank you for the work around, I am sure I can figure out were to go from here. And thank you for the speedy response.

1 Like

I just created issue #85 over on GitHub. I don’t think that adding this feature is too much work, and it may even make it into the upcoming release.


Software 0.9.2+ have a new record statistics button in the UI.

Upgrade now!