Closed foofel closed 4 months ago
Hi @foofel - I am not sure what CPU utilization is normal for a JS220 connected to a Raspberry Pi streaming data to another computer.
I want to make sure that I understand what you are doing:
With pyjoulescope_server, the data will be downsampled on the Raspberry Pi, which may be why you are seeing a high CPU utilization. Another possible approach is to capture statistics at 1 kHz. This "downsampling" is performed on the JS220 instrument which may reduce the Raspberry Pi's processing load.
Hi @mliberty1,
yes it is raspberrypi4 with the default 64 bit raspbian and a Joulescope JS220. I took the example from the read_by_callback.py. I haven't really looked at the server yet. Using statistics at 1Khz sounds promising, is there also an example for that?
When receiving data via streaming, is there a mechanism to know when samples were dropped/could not be delivered? As i said, it seems to work, i just want to make sure its working for a longer period and not silently failing.
The easiest way to get statistics is by running:
python -m pyjoulescope_driver statistics
You can provide the --frequency 1000
optional argument to get 1 kHz data. This command displays the statistics to stdout using the newer pyjoulescope_driver directly. You can also do the same from a python script. You can find the code for this pyjoulescope_driver entry point here.
You should get NaN (not a number) values if samples are being dropped when streaming full-rate samples or downsample samples.
Thanks!
I will look into the statistics and getting NaNs is easily detectable :)
Using statistics is a good solution. Closing as addressed.
Just as short feedback, the statistics work well, thanks :)
We are trying to create a setup for long term data collection using the joulescope and timescaledb. When trying to run the joulescope example data streamer on the raspberry one core is always at 100%, is this normal or does this mean the raspberry can not keep up with the data collected? (We are want to collect at 1000Hz). As far as i understand all data is streamed to the host computer at 1Msps and then reduced on the host? It looks like all data is arriving as expected but would i notice/ how do i notice if we had data drops?