Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joulescope UI might display settings that are not actually in device #238

Closed
atsju opened this issue Nov 16, 2023 · 3 comments
Closed

Joulescope UI might display settings that are not actually in device #238

atsju opened this issue Nov 16, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@atsju
Copy link
Contributor

atsju commented Nov 16, 2023

Joulescope model

JS220

UI version

other

What OS are you seeing the problem on?

Windows 11

What happened?

UI1.0.42
image
I had the sampling rate at 50kHz but I'm pretty sure it was actually sampling at 1MHz (I was evaluating the noise level)

What was expected?

UI should always ensure the actual setting are same between display and device

How to reproduce?

  1. Open UI and set sampling to 50kHz
  2. unplug JS220
  3. replug JS220
  4. UI still displays 50kHz but JS is 1Mhz

Extra information

No response

@atsju atsju added bug Something isn't working triage New issue that needs to be reviewed and prioritized labels Nov 16, 2023
@mliberty1
Copy link
Member

I was able to successfully duplicate this behavior. The sampling_frequency setting is restored correctly when the device first connects. However, it is not restored correctly for subsequent disconnect-reconnects.

I captured the following log snippet:

INFO:2023-11-16 10:34:03,104:jsdrv_stream_buffer.py:223:joulescope_ui.devices.jsdrv.jsdrv_stream_buffer.001:device_close JS220-001707
...
INFO:2023-11-16 10:34:09,962:backend.c:737:jsdrv:device_add_msg u/js220/001707 : \\?\usb#vid_16d0&pid_10ba#001707#{e27188c8-98ff-41de-be50-653324c6b19c}
INFO:2023-11-16 10:34:09,962:jsdrv.c:457:jsdrv:device add sn=u/js220/001707
...
INFO:2023-11-16 10:34:10,105:jsdrv_stream_buffer.py:211:joulescope_ui.devices.jsdrv.jsdrv_stream_buffer.001:device_open JS220-001707
INFO:2023-11-16 10:34:10,105:jsdrv_stream_buffer.py:353:joulescope_ui.devices.jsdrv.jsdrv_stream_buffer.001:add JS220-001707.i
INFO:2023-11-16 10:34:10,105:js220.py:736:joulescope_ui.devices.jsdrv.device.u.js220.001707:firmware_update_available JS220-001707: up to date
INFO:2023-11-16 10:34:10,105:js220.py:691:joulescope_ui.devices.jsdrv.device.u.js220.001707:current_range auto
INFO:2023-11-16 10:34:10,105:js220.py:609:joulescope_ui.devices.jsdrv.device.u.js220.001707:setting(Device(u/js220/001707)): signal_frequency <= 50000
INFO:2023-11-16 10:34:10,105:js220.py:609:joulescope_ui.devices.jsdrv.device.u.js220.001707:setting(Device(u/js220/001707)): statistics_frequency <= 2
INFO:2023-11-16 10:34:10,105:js220.py:609:joulescope_ui.devices.jsdrv.device.u.js220.001707:setting(Device(u/js220/001707)): target_power <= True

The UI is doing the "right thing" in attempting to restore the signal_frequency parameter value.

The Joulescope UI uses self._driver.open(self._path, 'restore') to open the pyjoulescope_driver device. 'restore' gets converted to open mode 1 by pyjoulescope_driver.binding.Driver.open which is JSDRV_DEVICE_OPEN_MODE_RESUME. This gets all settings values from the instrument, which it does here.

However, sampling_frequency is "special" for now in that the joulescope_driver knows it as h/fs, which is implemented on the host, not the instrument. The long-term goal is to implement downsampling on the instrument. With the existing host-based implementation, restoring the value from the instrument does nothing, so the pubsub retained value remains but without being reprocessed. The driver needs to be reconfigured correctly using the retained value. The joulescope_driver.js220_usb.d_open should call on_sampling_frequency with the retained pubsub value for h/fs.

@mliberty1
Copy link
Member

Fixed in jetperch/joulescope_driver@40e6342 and will be included in the next release.

@mliberty1 mliberty1 removed the triage New issue that needs to be reviewed and prioritized label Nov 17, 2023
@mliberty1
Copy link
Member

Fixed in 1.0.45 (currently alpha).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

2 participants