jetperch/joulescope_driver

WARNING jsdrv Unsupported port0 op: 4

YouriWoelders1 opened this issue · 1 comments

This warning only occours when i'm running it with WSL and everything seems to be running just fine. Should I be worried about this warning that keeps poping up like every second? I not sure why get it and what is means.

Basic code as example:

from joulescope import scan_require_one
import logging
logging.basicConfig(level=logging.DEBUG)

device = scan_require_one()
device.open()

Perform a basic operation
print(device.info())

device.close()

Log:

INFO:jsdrv:open_ll
INFO:jsdrv:device_open(u/js220/002301)
INFO:jsdrv:device_open(u/js220/002301) => 0
INFO:jsdrv:open
INFO:jsdrv:bulk_in_open(1275073064, endpoint=0x82)
INFO:jsdrv:port0 connect rsp
INFO:jsdrv:JS220 app_id=3, FW=1.2.1, HW=1.0.0, FPGA=1.2.1, protocol=1.0.0
INFO:jsdrv:publish to dev $ nul
INFO:jsdrv:publish to dev c/!ping u32 1
INFO:jsdrv:bulk_out_send(u/js220/002301) 48 bytes
INFO:jsdrv:bulk_out_send(u/js220/002301) 48 bytes
WARNING:jsdrv:Unsupported port0 op: 4
INFO:jsdrv:bulk_out_send(u/js220/002301) 48 bytes
INFO:jsdrv:open complete
INFO:jsdrv:on_sampling_frequency(2000000)
INFO:jsdrv:publish to dev s/i/range/mode u8.R 4
INFO:jsdrv:bulk_out_send(u/js220/002301) 48 bytes
INFO:jsdrv:publish to dev s/v/range/select u8.R 0
INFO:jsdrv:bulk_out_send(u/js220/002301) 48 bytes
INFO:jsdrv:publish to dev s/v/range/mode u8.R 1
INFO:jsdrv:bulk_out_send(u/js220/002301) 48 bytes
{'type': 'info', 'ver': 2, 'model': 'js220', 'hardware_version': '1.0.0', 'serial_number': '002301', 'ctl': {'hw': {'rev': '1.0.0', 'sn_mcu': '002301', 'sn_mfg': '002301', 'ver': '1.0.0'}, 'fw': {'ver': '1.2.1'}}, 'sensor': {'fw': {'ver': '1.2.1'}, 'fpga': {'ver': '1.2.1'}}}
INFO:jsdrv:close
INFO:jsdrv:device_close(u/js220/002301)
INFO:jsdrv:close
INFO:jsdrv:jsdrv_finalize 0x2b9d1b0
INFO:jsdrv:USB backend finalize
INFO:jsdrv:JS220 USB upper-level thread done u/js220/002301
INFO:jsdrv:backend finalize
INFO:jsdrv:libusb backend finalize
INFO:jsdrv:jsdrv_usb_backend_thread exit

That error is the host code saying that it does not support the newer timestamp message coming from the JS220. I think that you have an old version of pyjoulescope_driver.

First, check your version:

python -m pyjoulescope_driver info

    SYSTEM INFORMATION
    ------------------
    python               3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
    python impl          CPython
    platform             Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
    processor            x86_64
    CPU cores            16 physical, 32 total
    CPU frequency        2995 MHz (0 MHz min to 0 MHz max)
    RAM                  30.7 GB available, 31.2 GB total (98.4%)

    PYTHON PACKAGE INFORMATION
    --------------------------
    jls                  0.9.4
    joulescope           1.1.13
    numpy                1.26.4
    pyjoulescope_driver  1.5.2


    JOULESCOPE INFORMATION
    ----------------------
    u/js220/002122: hw=1.0.0, fw=1.2.1, fpga=1.2.1

You should see pyjoulescope_driver 1.5.2. What does python -m pyjoulescope_driver info show for you?

To update:

python -m pip install -U pyjoulescope_driver joulescope pyjls

Running Joulescopes in a VM or WSL is not supported. While it may work, you may also find that the VM cannot keep up with the USB data rate from the Joulescope resulting in sample drops.

I was curious, so I took a look. Just getting WSL with Ubuntu working took a while. I already had WSL + Ubuntu installed.

I somewhat followed this guide. Here are my steps to get a JS220 working:

In Windows PowerShell as Admin:

winget install --interactive --exact dorssel.usbipd-win
usbipd list
usbipd bind --hardware-id 16d0:10ba
usbipd attach --wsl --hardware-id 16d0:10ba

In Ubuntu WSL:

sudo apt update
sudo apt upgrade
sudo vi /etc/wsl.conf

Edit the file to contain:

[boot]
command="service udev start"
wget https://raw.githubusercontent.com/jetperch/joulescope_driver/main/99-joulescope.rules
sudo mv 99-joulescope.rules /etc/udev/rules.d/

In Windows PowerShell as Admin:

wsl --terminate Ubuntu-22.04

In Ubuntu WSL:

lsusb
python3 -m venv ~/venv/joulescope
. ~/venv/joulescope/bin/activate
python -m pip install -U joulescope
python -m pyjoulescope_driver info
nano example.py

Copy / paste:

from joulescope import scan_require_one
import logging
logging.basicConfig(level=logging.DEBUG)

device = scan_require_one()
device.open()

# Perform a basic operation
print(device.info())

device.close()
python example.py
INFO:jsdrv:open_ll(opt=0)
INFO:jsdrv:device_open(u/js220/002557)
INFO:jsdrv:device_open(u/js220/002557) => 0
INFO:jsdrv:open(opt=0)
INFO:jsdrv:bulk_in_open(1677726264, endpoint=0x82)
INFO:jsdrv:port0 connect rsp
INFO:jsdrv:JS220 app_id=3, FW=1.2.1, HW=1.0.0, FPGA=1.2.1, protocol=1.0.0
INFO:jsdrv:publish to dev $ nul
INFO:jsdrv:publish to dev c/!ping u32    1
INFO:jsdrv:bulk_out_send(u/js220/002557) 48 bytes
INFO:jsdrv:bulk_out_send(u/js220/002557) 48 bytes
INFO:jsdrv:bulk_out_send(u/js220/002557) 48 bytes
INFO:jsdrv:open complete
INFO:jsdrv:on_sampling_frequency(2000000)
INFO:jsdrv:publish to dev s/i/range/mode  u8.R  4
INFO:jsdrv:bulk_out_send(u/js220/002557) 48 bytes
INFO:jsdrv:publish to dev s/v/range/select  u8.R  0
INFO:jsdrv:bulk_out_send(u/js220/002557) 48 bytes
INFO:jsdrv:publish to dev s/v/range/mode  u8.R  1
INFO:jsdrv:bulk_out_send(u/js220/002557) 48 bytes
{'type': 'info', 'ver': 2, 'model': 'js220', 'hardware_version': '1.0.0', 'serial_number': '002557', 'ctl': {'hw': {'rev': '1.0.0', 'sn_mcu': '002557', 'sn_mfg': '002557', 'ver': '1.0.0'}, 'fw': {'ver': '1.2.1'}}, 'sensor': {'fw': {'ver': '1.2.1'}, 'fpga': {'ver': '1.2.1'}}}
INFO:jsdrv:close
INFO:jsdrv:device_close(u/js220/002557)
INFO:jsdrv:close
INFO:jsdrv:jsdrv_finalize 0x563b4dc74db0
INFO:jsdrv:USB backend finalize
INFO:jsdrv:JS220 USB upper-level thread done u/js220/002557
INFO:jsdrv:backend finalize
INFO:jsdrv:libusb backend finalize
INFO:jsdrv:jsdrv_usb_backend_thread exit

I don't see the same warning as you do.

python -m pyjoulescope_driver statistics
... works ...
python -m joulescope statistics
... also works ...
python -m pyjoulescope_driver record /mnt/c/tmp/out.jls
Start recording.  Press CTRL-C to stop.
WARNING:2024-05-28 09:26:33,574:wr_fsr.c:561:pyjls.c:fsr 1 skip: in=56152979 expect=56141828, skipped=11151
WARNING:2024-05-28 09:26:33,576:wr_fsr.c:561:pyjls.c:fsr 2 skip: in=56152979 expect=56141702, skipped=11277
WARNING:2024-05-28 09:26:33,577:wr_fsr.c:561:pyjls.c:fsr 2 skip: in=56153735 expect=56153105, skipped=630
WARNING:2024-05-28 09:26:33,579:wr_fsr.c:561:pyjls.c:fsr 1 skip: in=56153735 expect=56153105, skipped=630
WARNING:2024-05-28 09:26:33,583:wr_fsr.c:561:pyjls.c:fsr 2 skip: in=56169800 expect=56169737, skipped=63
WARNING:2024-05-28 09:26:33,999:wr_fsr.c:561:pyjls.c:fsr 1 skip: in=56498282 expect=56496455, skipped=1827
WARNING:2024-05-28 09:26:34,001:wr_fsr.c:561:pyjls.c:fsr 2 skip: in=56498282 expect=56496392, skipped=1890
WARNING:2024-05-28 09:26:34,002:wr_fsr.c:561:pyjls.c:fsr 1 skip: in=56518631 expect=56518442, skipped=189
WARNING:2024-05-28 09:26:34,002:wr_fsr.c:561:pyjls.c:fsr 2 skip: in=56518631 expect=56518316, skipped=315
WARNING:2024-05-28 09:26:34,002:wr_fsr.c:561:pyjls.c:fsr 1 skip: in=56519387 expect=56518757, skipped=630
WARNING:2024-05-28 09:26:34,004:wr_fsr.c:561:pyjls.c:fsr 2 skip: in=56519387 expect=56518757, skipped=630
WARNING:2024-05-28 09:26:34,045:wr_fsr.c:561:pyjls.c:fsr 1 skip: in=56604878 expect=56587805, skipped=17073
WARNING:2024-05-28 09:26:34,046:wr_fsr.c:561:pyjls.c:fsr 2 skip: in=56604878 expect=56587679, skipped=17199

somewhat works. I get sample drops. I can open this JLS file in the Joulescope UI under Windows.