JS110 python joulescope questions

I am using a python script with the joulescope package to automate Joulescope validation testing. This works well with the JS220 and I’m adapting a separate script for JS110 but I am encountering “pkt_index skip” messages on each read. These don’t really break anything (I still get the expected amount of data, the data looks good, and I think this is expected behavior at read startup for JS110), but the text does visually disrupt the logging for intermediate results. I generally see two skip messages per read. For clarity, here’s an example of the skip messages:

pkt_index skip: expected 0, received 16229
pkt_index skip: expected 16252, received 0

Is there a way to suppress / disable the logging for the “pkt_index skip“ messages? Ideally it would be suppressing just that message so I can see others, but adjusting the log level could be an option too.

The other question I have on the joulescope package is what is the right way to find the parameters for a device? Assuming something like
import joulescope
JS = joulescope.scan_require_one(config=‘auto’)
then using JS.parameters() returns a list of objects that aren’t very clear: [<joulescope.parameter.Parameter object at 0x000002B6CF4D0AF0>, <joulescope.parameter.Parameter object at 0x000002B6CF3977F0>,

List comprehension printing ([print(x) for x in JS.parameters()]) does show parameter names, but I suspect there’s an easier way.

pkt_skip

The JS110 streaming often does not start cleanly. You get a small burst of samples, a gap, and then a continuous stream of samples. The pkt_index skip indicates this.

The pkt_index skip messages come from js110_usb.c in joulescope_driver. You have a few options:

  1. Change the log level to error. I think that the following code should work:
from joulescope import DriverWrapper, scan_require_one
DriverWrapper().driver.log_level = 'ERROR'
...
  1. Fork joulescope_driver and delete this line.

Parameters

The easiest way is probably parameters_v1.py.

For all of the JS220 topics available to publish, try this:

python -m pyjoulescope_driver info -v "*"

Thank you!

Adjusting the log level with DriverWrapper is a good solution.

To minimize the chances of suppressing important information I saved, modified, and restored the log level around the read functions with
log_level = joulescope.v1.DriverWrapper().driver.log_level
joulescope.v1.DriverWrapper().driver.log_level = ‘ERROR’ # Suppress the pkt_index skip message which occurs on JS110 reads.
js_reading = JS.read(1)
joulescope.v1.DriverWrapper().driver.log_level = log_level # Restore the logging level
This was also to avoid having to import separately from joulescope.v1 for DriverWrapper and from joulescope for scan_require_one and read.

The Parameters link had good info and I found
joulescope.v1.js110.PARAMETERS_DICT.keys()
generated a succinct list of the parameter names for the device.

At first I didn’t see any results when running

but after plugging in a Joulescope, it shows the info for that device.

1 Like

Yes, this is the expected behavior with the JS220. The JS220 firmware actually defines the topics, not the host side, so the host needs to have a JS220 to query.

1 Like