Code Monkey home page Code Monkey logo

iio-capture's People

Contributors

fdreux avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ptitiano

iio-capture's Issues

ERROR: "Device or resource busy" when writing on acme_probe::in_oversampling_ratio

While using an ACME CAPE for long running experiments, it happens quite frequently that we need to reboot the device because of iio-capture failing to write the in_oversampling_ratio attribute of a device.

Not sure what's the reasons for that problem, maybe it's the driver stuck or this tool sending a wrong sequence of commands.

Have you ever noticed anything similar? If not, which kind of feedback can be useful to debug the issue.

What I can share so fare is that, once the problem occurs and the iio-capture command fails on the HOST side, if I login to the ACME cape and I try a write I still get the same error, e.g.:

± % ssh [email protected]                                                                                                                                  !10052
root@drk-acme:~# cd /sys/bus/iio/devices/iio:device0
root@drk-acme:/sys/bus/iio/devices/iio:device0# cat in_oversampling_ratio 
4
root@drk-acme:/sys/bus/iio/devices/iio:device0# echo 4 > in_oversampling_ratio
-sh: echo: write error: Device or resource busy
root@drk-acme:/sys/bus/iio/devices/iio:device0# 

The device has these tasks running:

root@drk-acme:/sys/bus/iio/devices/iio:device0# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.7  13168  3908 ?        Ss   Sep21   0:27 /sbin/init
root         2  0.0  0.0      0     0 ?        S    Sep21   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    Sep21   0:04 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   Sep21   0:00 [kworker/0:0H]
root         6  0.0  0.0      0     0 ?        S    Sep21   0:00 [kworker/u2:0]
root         7  0.0  0.0      0     0 ?        S    Sep21   0:09 [rcu_sched]
root         8  0.0  0.0      0     0 ?        S    Sep21   0:00 [rcu_bh]
root         9  0.0  0.0      0     0 ?        S    Sep21   0:00 [migration/0]
root        10  0.0  0.0      0     0 ?        S<   Sep21   0:00 [lru-add-drain]
root        11  0.0  0.0      0     0 ?        S    Sep21   0:00 [cpuhp/0]
root        12  0.0  0.0      0     0 ?        S    Sep21   0:00 [kdevtmpfs]
root        13  0.0  0.0      0     0 ?        S<   Sep21   0:00 [netns]
root        15  0.0  0.0      0     0 ?        S    Sep21   0:00 [oom_reaper]
root        16  0.0  0.0      0     0 ?        S<   Sep21   0:00 [writeback]
root        17  0.0  0.0      0     0 ?        S    Sep21   0:00 [kcompactd0]
root        18  0.0  0.0      0     0 ?        S<   Sep21   0:00 [crypto]
root        19  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        20  0.0  0.0      0     0 ?        S<   Sep21   0:00 [kblockd]
root        21  0.0  0.0      0     0 ?        S<   Sep21   0:00 [ata_sff]
root        22  0.0  0.0      0     0 ?        S<   Sep21   0:00 [watchdogd]
root        23  0.0  0.0      0     0 ?        S<   Sep21   0:00 [rpciod]
root        24  0.0  0.0      0     0 ?        S    Sep21   0:00 [kswapd0]
root        25  0.0  0.0      0     0 ?        S<   Sep21   0:00 [vmstat]
root        26  0.0  0.0      0     0 ?        S<   Sep21   0:00 [nfsiod]
root        37  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        38  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        39  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        40  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        41  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        42  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        43  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        44  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        45  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        46  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        47  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        48  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        49  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        50  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        51  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        52  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        53  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        54  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        55  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        56  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        57  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        58  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        59  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        60  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        63  0.0  0.0      0     0 ?        S<   Sep21   0:00 [kpsmoused]
root        64  0.0  0.0      0     0 ?        S    Sep21   0:00 [irq/33-48060000]
root        67  0.0  0.0      0     0 ?        S<   Sep21   0:00 [deferwq]
root        68  0.0  0.0      0     0 ?        S    Sep21   0:23 [irq/159-44e0b00]
root        69  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        70  0.0  0.0      0     0 ?        S    Sep21   0:01 [mmcqd/0]
root        71  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        72  0.0  0.0      0     0 ?        S    Sep21   0:00 [mmcqd/1]
root        73  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        74  0.0  0.0      0     0 ?        S    Sep21   0:00 [mmcqd/1boot0]
root        75  0.0  0.0      0     0 ?        S<   Sep21   0:00 [bioset]
root        76  0.0  0.0      0     0 ?        S    Sep21   0:00 [mmcqd/1boot1]
root        77  4.3  0.0      0     0 ?        R    Sep21 830:25 [irq/160-4802a00]
root        78  0.0  0.0      0     0 ?        S    Sep21   0:00 [irq/161-4819c00]
root        79  0.0  0.0      0     0 ?        S<   Sep21   0:00 [kworker/0:1H]
root        80  0.0  0.0      0     0 ?        S<   Sep21   0:00 [ext4-rsv-conver]
root        81  0.0  0.0      0     0 ?        S<   Sep21   0:00 [ipv6_addrconf]
root        92  0.0  0.7   5668  3808 ?        Ss   Sep21   0:22 /lib/systemd/systemd-journald
root        97  0.0  0.0      0     0 ?        S    Sep21   0:00 [kauditd]
root       100  0.0  0.0      0     0 ?        S    Sep21   0:00 [kworker/u2:2]
root       117  0.0  0.5  10828  2644 ?        Ss   Sep21   0:07 /lib/systemd/systemd-udevd
root       154  0.0  0.3   2720  1568 ?        Ss   Sep21   0:00 /sbin/klogd -n
avahi      155  0.0  0.5   4896  2796 ?        Ss   Sep21   1:06 avahi-daemon: running [drk-acme.local]
message+   157  0.0  0.5   4424  2740 ?        Ss   Sep21   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
avahi      158  0.0  0.3   4896  1612 ?        S    Sep21   0:00 avahi-daemon: chroot helper
systemd+   160  0.0  0.5   3360  2508 ?        Ss   Sep21   0:04 /lib/systemd/systemd-networkd
root       161  0.0  0.2   2192  1460 ttyO0    Ss+  Sep21   0:00 /sbin/agetty -8 -L ttyO0 115200 xterm
root       162  0.0  0.3   2784  1548 ?        Ss   Sep21   0:01 /sbin/syslogd -n -C
root       163  0.0  0.3   2192  1512 tty1     Ss+  Sep21   0:00 /sbin/agetty --noclear tty1 linux
root       175  0.0  2.5  15704 12692 ?        Ss   Sep21   6:08 python3 /usr/bin/pyacmed
systemd+   177  0.0  0.4   3704  2396 ?        Ss   Sep21   0:04 /lib/systemd/systemd-resolved
root       193  0.0  0.4   2764  1988 ?        Ss   Sep21   0:00 /bin/sh /usr/bin/acme-usbgadget-udhcpd
root       200  0.0  0.3   2720  1744 ?        S    Sep21   0:00 udhcpd -f /etc/udhcpd.conf
root       205  0.0  0.3   2192  1584 ttyGS1   Ss+  Sep21   0:00 /sbin/agetty -8 -L ttyGS1 115200 xterm
root       206  0.0  0.3   2192  1584 ttyGS0   Ss+  Sep21   0:00 /sbin/agetty -8 -L ttyGS0 115200 xterm
root      3260  0.3  0.0      0     0 ?        S    Oct03   5:33 [kworker/0:1]
root      5195 12.4  0.0      0     0 ?        D    Oct03 138:58 [ina226:0-8800us]
root      5199 12.4  0.0      0     0 ?        D    Oct03 138:58 [ina226:1-8800us]
root      6692  0.0  0.7   4912  3624 ?        Ss   13:06   0:00 sshd: root@pts/0
root      6694  0.0  0.6   3628  2988 pts/0    Ss   13:06   0:00 -sh
root      6707  5.0  0.2   2720  1424 pts/0    D+   13:20   7:21 grep  in_active in_allow_async_readout in_current3_raw in_current3_scale in_oversampling_ratio in_power2_raw in_power2_scale in_sampling_frequency in_shunt_resistor in_voltage0_integration_time in_voltage0_raw in_voltage0_scale in_voltage1_integration_time in_voltage1_raw in_voltage1_scale
root      6821  0.0  0.0      0     0 ?        S    15:31   0:00 [kworker/0:0]
root      6855  0.0  0.0      0     0 ?        S    15:44   0:00 [kworker/0:2]
root      6858  0.2  0.7   4912  3504 ?        Ss   15:46   0:00 sshd: root@pts/1
root      6860  0.5  0.6   3728  3020 pts/1    Ss   15:46   0:00 -sh
root      6875  0.0  0.3   3028  1656 pts/1    R+   15:47   0:00 ps aux
root@drk-acme:/sys/bus/iio/devices/iio:device0# 

As you can notice there is a "dead" grep (pid: 6707) for all the attributes of a device... which I don't where it comes from and I suppose it's part of the device-side of iio-capture.

Is there any other information I can provide to track down this issue?

[Building] Older version of libiio is needed

Latest version of libiio doesn't provide the iio_create_usb_context function anymore, in fact when trying to build iio-capture you get:

$ make
cc -o iio-capture iio-capture.o  -lpthread -liio
iio-capture.o: In function `main':
~/iio-capture/iio-capture.c:472: undefined reference to `iio_create_usb_context'
collect2: error: ld returned 1 exit status
make: *** [iio-capture] Error 1

To able to build the tool I had to revert libiio to the commit 59264672be.

[Energy] Discrepancy in energy computation with respect to another probe

Hello,

I'm trying to use iio-capture in order to measure energy consumption on a device and I got very different results in the energy value with respect to what I measure with a different probe. In particular, the energy value reported by iio-capture is 25 times lower than what is measured by the other probe.

In order to understand which is wrong (or more accurate), I measured the energy consumption of a 2.70 Ohm resistor over which I apply a 4.03 V voltage and a current of 1.50 A for roughly 20 seconds. Therefore, the energy value should be 120.90 J.

What I measure is:

  • 4.61 J with the ACME probe (Jack Power Probe)
  • 101.13 J with the other probe

All the other values reported be iio-capture look reasonable, except for energy:

<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=vbus_max RESULT=pass UNITS=mV MEASUREMENT=4030.00>
<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=energy RESULT=pass UNITS=mJ MEASUREMENT=4610.26>
<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=power_min RESULT=pass UNITS=mW MEASUREMENT=6025.00>
<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=power_max RESULT=pass UNITS=mW MEASUREMENT=6050.00>
<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=power_avg RESULT=pass UNITS=mW MEASUREMENT=6025.02>
<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=current_min RESULT=pass UNITS=mA MEASUREMENT=1496.00>
<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=current_max RESULT=pass UNITS=mA MEASUREMENT=1500.00>

Do you have any idea why I'm getting incorrect results?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.