JS110 Reporting Packet Skips

I am running a custom built python script that calls into the python Joulescope API. I’m seeing pkt_skip warnings, even though I’m not using streaming mode (intentionally) from the Joulsecope.

Some API details are:
joulescope 1.3.0
jsonschema 4.23.0
pyjls 0.13.2
Python is 3.10.11 on Windows 11

The Joulescope JS110 is:
Ver = 2
Hardware_ver = H
Sampling_freq = 2MHz
Reduction_freq = 2 Hz

And my test fixture has a relay board that communicates over USB HID

My test flow is:
1. Joulescope:
2. Open() then stop() via the driver.py v1 API
3. Set the current range to 2A to prevent any brownouts.
4**. I perform some USB HID reads/writes to the relay board.**
5. Later in the test, I get current measurements with the Joulescope
a. I’m using device-side statistics
i. Setup a stats-callaback that gets called every 2Hz with the Joulescope data
ii. And I call status() from driver.py to keep the 2Hz reporting going
iii. Until I’m done getting the current reading that I need.
6. After the current reading phase, I perform some USB HID instructions to the relay board again.

So I’m not performing USB HID relay board operations, and Joulescope current readings at the same time. Both are separate.

The skips are during steps 4 and 6, when I perform the USB HID instructions, I will get some of these warnings from the Joulescope:

04-18-2025_10:31:41sec pkt_index skip: expected 36819, received 37243 *
04-18-2025_10:31:41sec pkt_index skip: expected 38386, received 38875 *
04-18-2025_10:31:41sec pkt_index skip: expected 38878, received 38879 *

This post helped me to understand that I’m likely holding up the PC’s ability to get around to handling stream USB packets during the relay-board USB HID instructions:

However, I don’t believe I’m doing any streaming, at least not intentionally. And is_streaming() in driver.py is false. Fortunately I only need to do device-side stats at 2Hz, and I don’t need to do any relay-board USB HID operations during these measurements. The skipped packet messages aren’t hurting anything. But I would like to understand these warnings and hopefully get rid of them.

Is it expected that, if the PC USB handling gets held up at steps 4 or 6, that the JS110 might report missed packets? If so, what packets are they? Are they streaming? Is there something I can do to assure streaming is turned off since I don’t really need it anyway?

Note too, I have the USB relay board and Joulsecope on separate USB ports. So I don’t think it is a USB throughput issue, but seems to be that the PC is not handling the Joulescope USB packets quickly enough…at a time when I don’t think I would expect any Joulescope packets.

Thanks
timmwalk@gmail.com

Hi @timmwalk and welcome to the Joulescope forum!

The two likely causes of the sample drops is:

  1. Both the JS110 and relay board are on the same USB root hub, and the relay board communications prevents the host from getting JS110 data.
  2. The Python script blocks preventing the host from getting the JS110 data.

The JS110 computes statistcs on the host side by default. Therefore, it does stream all the sample data. As long as you only need 2 Hz and no standard deviation, you can configure the JS110 to compute statistics on the instrument. Here is how:

device.statistics_callback_register(my_statistics_fn, source='sensor')

Also see the statistics_v1.py example.

With the v1 backend (the default for years now), you no longer need to call status, either.

Does this make sense and work for you?

Thanks for the quick response! I will give this a try in the next day or two and let you know.

1 Like