I’m running a Python script using my JS110. At some point, the script seems to lockup after a “jsdrv_publish timed out” is printed.
I think this usually happens when I’m doing other things with the same computer (i.e. possibly a spike in CPU/memory usage).
What I want is to periodically sample current and voltage once every ~second. My needs do not require no dropped samples, etc. I do need this to last over a period of 2-3hrs.
Is there anything that could be suggested to change in my script to make this robust?
py -m pyjoulescope_driver info
driver info
SYSTEM INFORMATION ------------------ python 3.12.2 (tags/v3.12.2:6abddd9, Feb 6 2024, 21:26:36) [MSC v.1937 64 bit (AMD64)] python impl CPython platform Windows-10-10.0.19045-SP0 processor Intel64 Family 6 Model 142 Stepping 12, GenuineIntel CPU cores 4 physical, 8 total CPU frequency 801 MHz (0 MHz min to 2304 MHz max) RAM 4.2 GB available, 15.8 GB total (26.5%) PYTHON PACKAGE INFORMATION -------------------------- jls 0.9.2 joulescope 1.1.12 numpy 1.26.4 pyjoulescope_driver 1.4.7 JOULESCOPE INFORMATION ---------------------- u/js110/000650
sample extract of my .py script:
.py code
js_device = joulescope.scan_require_one(config="auto")
with js_device:
while:
data = js_device.read(duration=0.1)
current, voltage = np.mean(data, axis=0, dtype=np.float64)
# sleep so we only loop at 1 second intervals
time.sleep(x)