• USB monitoring on RasPiOS

    From bob prohaska@3:770/3 to All on Tuesday, May 03, 2022 18:00:26
    Does RasPiOS have any utilities to monitor usb activity
    and errors? FreeBSD has something called usbconfig, but
    nothing by that name is found via apt search on the Pi.

    Thanks for reading,

    bob prohaska

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Green@3:770/3 to bob prohaska on Tuesday, May 03, 2022 19:52:56
    bob prohaska <bp@www.zefox.net> wrote:
    Does RasPiOS have any utilities to monitor usb activity
    and errors? FreeBSD has something called usbconfig, but
    nothing by that name is found via apt search on the Pi.

    The first place I'd look is in syslog (/var/log/syslog), then maybe
    dmesg but that may have no more than syslog.

    --
    Chris Green
    ยท

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Dennis Lee Bieber@3:770/3 to All on Tuesday, May 03, 2022 15:18:26
    On Tue, 3 May 2022 18:00:26 -0000 (UTC), bob prohaska <bp@www.zefox.net> declaimed the following:

    Does RasPiOS have any utilities to monitor usb activity
    and errors? FreeBSD has something called usbconfig, but
    nothing by that name is found via apt search on the Pi.


    Closest seems to be

    pi@rpi3bplus-1:~$ apt show usbtop
    Package: usbtop
    Version: 0.2-1
    Priority: optional
    Section: misc
    Maintainer: Dmitry Smirnov <onlyjob@debian.org>
    Installed-Size: 102 kB
    Depends: libboost-atomic1.62.0, libboost-chrono1.62.0, libboost-date-time1.62.0, libboost-system1.62.0, libboost-thread1.62.0,
    libc6 (>= 2.15), libgcc1 (>= 1:3.5), libpcap0.8 (>= 0.9.8), libstdc++6 (>= 5.2), ca-certificates
    Homepage: https://github.com/aguinet/usbtop
    Download-Size: 28.4 kB
    APT-Sources: http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
    Description: utility to show bandwidth on USB buses and devices
    Top-like utility that shows an estimated instantaneous bandwidth on USB
    buses and devices.

    pi@rpi3bplus-1:~$


    --
    Wulfraed Dennis Lee Bieber AF6VN
    wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Martin Gregorie@3:770/3 to bob prohaska on Tuesday, May 03, 2022 19:57:21
    On Tue, 3 May 2022 18:00:26 -0000 (UTC), bob prohaska wrote:

    Does RasPiOS have any utilities to monitor usb activity and errors?
    FreeBSD has something called usbconfig, but nothing by that name is
    found via apt search on the Pi.

    Thanks for reading,

    bob prohaska

    USB access, errors etc. get logged in /var/log/messages so you can see all
    the gory detail of USB activity by running something like:

    sudo tail -f /var/log/messages | grep "USB"

    which can be very useful for debugging. However, If I wanted 24 hour
    monitoring of selected USB activity, I'd install the logwatch package and
    write a logwatch reporting module to capture exactly the detail I want to
    see. For instance I did that to report activations of the UPS that
    supports my house server and internet gateway. This setup by default sends daily reports to root on my house server, which is configured to forward logwatch reports to my usual login on a laptop. Logwatch modules are traditionally Perl scripts but I don't think there's anything preventing
    you from using awk or any other compiled or scripting language instead.

    USB equivalents of Wireshark, the TCP/IP message analyser/scanner, may
    also exist: I haven't needed them so haven't looked.


    --
    --
    Martin | martin at
    Gregorie | gregorie dot org

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From David Higton@3:770/3 to Martin Gregorie on Tuesday, May 03, 2022 22:49:36
    In message <t4s1f1$3fh$1@dont-email.me>
    Martin Gregorie <martin@mydomain.invalid> wrote:

    On Tue, 3 May 2022 18:00:26 -0000 (UTC), bob prohaska wrote:

    Does RasPiOS have any utilities to monitor usb activity and errors?
    FreeBSD has something called usbconfig, but nothing by that name is found via apt search on the Pi.

    USB equivalents of Wireshark, the TCP/IP message analyser/scanner, may
    also exist: I haven't needed them so haven't looked.

    Last time I looked (admittedly some years ago), Wireshark itself did
    USB captures. The decoding was rather rudimentary, though.

    So Wireshark is the first place I'd look. If it runs on RasPiOS, of
    course.

    David

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From bob prohaska@3:770/3 to Chris Green on Tuesday, May 03, 2022 23:23:09
    Chris Green <cl@isbd.net> wrote:
    bob prohaska <bp@www.zefox.net> wrote:
    Does RasPiOS have any utilities to monitor usb activity
    and errors? FreeBSD has something called usbconfig, but
    nothing by that name is found via apt search on the Pi.

    The first place I'd look is in syslog (/var/log/syslog), then maybe
    dmesg but that may have no more than syslog.


    Much to my surprise there was nothing in syslog and very little
    by way of dmesg | grep -i usb, all of it device discovery during
    boot. I guess that means USB works without problems......

    Thanks for writing!

    bob prohaska

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From A. Dumas@3:770/3 to bob prohaska on Wednesday, May 04, 2022 01:13:15
    bob prohaska <bp@www.zefox.net> wrote:
    Does RasPiOS have any utilities to monitor usb activity
    and errors? FreeBSD has something called usbconfig, but
    nothing by that name is found via apt search on the Pi.

    Monitor as in actively, or the current state? If the latter, then lsusb.
    See man lsusb after installing (not sure if it already is in the Lite or
    Full distro). Try:

    lsusb
    lsusb -tvv (tree view can have 0, 1 or 2 v's but doesn't need sudo)
    sudo lsusb -vs 2:2 (first external usb3 device)

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Dennis Lee Bieber@3:770/3 to All on Wednesday, May 04, 2022 12:25:11
    On Tue, 03 May 2022 22:49:36 +0100, David Higton <dave@davehigton.me.uk> declaimed the following:


    Last time I looked (admittedly some years ago), Wireshark itself did
    USB captures. The decoding was rather rudimentary, though.


    https://wiki.wireshark.org/CaptureSetup/USB

    So Wireshark is the first place I'd look. If it runs on RasPiOS, of
    course.

    md_admin@microdiversity:~$ apt search wireshark
    Sorting... Done
    Full Text Search... Done

    <SNIP>

    libndpi-wireshark/oldstable 2.6-3 armhf
    extensible deep packet inspection library - wireshark dissector

    libvirt-wireshark/oldstable 5.0.0-4+deb10u1 armhf
    Wireshark dissector for the libvirt protocol

    libwireshark-data/oldstable 2.6.20-0+deb10u3 all
    network packet dissection library -- data files

    libwireshark-dev/oldstable 2.6.20-0+deb10u3 armhf
    network packet dissection library -- development files

    libwireshark11/oldstable 2.6.20-0+deb10u3 armhf
    network packet dissection library -- shared library

    <SNIP>


    wireshark/oldstable 2.6.20-0+deb10u3 armhf
    network traffic analyzer - meta-package

    wireshark-common/oldstable 2.6.20-0+deb10u3 armhf
    network traffic analyzer - common files

    wireshark-dev/oldstable 2.6.20-0+deb10u3 armhf
    network traffic analyzer - development tools

    wireshark-doc/oldstable 2.6.20-0+deb10u3 all
    network traffic analyzer - documentation

    wireshark-gtk/oldstable 2.6.20-0+deb10u3 armhf
    network traffic analyzer - GTK+ version

    wireshark-qt/oldstable 2.6.20-0+deb10u3 armhf
    network traffic analyzer - Qt version


    Looks like a viable combination... Including a choice of GUI <G>



    --
    Wulfraed Dennis Lee Bieber AF6VN
    wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From bob prohaska@3:770/3 to A. Dumas on Thursday, May 05, 2022 06:18:02
    A. Dumas <alexandre@dumas.fr.invalid> wrote:
    bob prohaska <bp@www.zefox.net> wrote:
    Does RasPiOS have any utilities to monitor usb activity
    and errors? FreeBSD has something called usbconfig, but
    nothing by that name is found via apt search on the Pi.

    Monitor as in actively, or the current state? If the latter, then lsusb.
    See man lsusb after installing (not sure if it already is in the Lite or
    Full distro). Try:


    Restrspectively, as in how many errors (and on which device) since boot.
    Bonus points for what kind of errors.

    lsusb
    lsusb -tvv (tree view can have 0, 1 or 2 v's but doesn't need sudo)
    sudo lsusb -vs 2:2 (first external usb3 device)

    Looks like it's already installed. But, lsusb seems to report
    what devices are present. I don't see an option for seeing errors.

    Thanks for writing!

    bob prohaska

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Martin Gregorie@3:770/3 to bob prohaska on Thursday, May 05, 2022 10:54:14
    On Thu, 5 May 2022 06:18:02 -0000 (UTC), bob prohaska wrote:

    Looks like it's already installed. But, lsusb seems to report what
    devices are present. I don't see an option for seeing errors.

    Have you seen and/or captured any USB errors so far? If so, note which
    logfile they are written to (probably /var/log/messages since that is
    where connect/disconnect USB messages go on my (Fedora, not Pi) systems,
    and keep a copy of at least one.

    Then write a logwatch report script that reports matching messages. I'd
    try an awk script for starters ('sed & awk' is a very well written
    O'Reilly book and awk is a scripting language that was designed for
    quickly producing custom reports from file content), but you may prefer to
    use Perl or Python.


    --
    --
    Martin | martin at
    Gregorie | gregorie dot org

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From bob prohaska@3:770/3 to Martin Gregorie on Thursday, May 05, 2022 15:23:16
    Martin Gregorie <martin@mydomain.invalid> wrote:
    On Thu, 5 May 2022 06:18:02 -0000 (UTC), bob prohaska wrote:

    Looks like it's already installed. But, lsusb seems to report what
    devices are present. I don't see an option for seeing errors.

    Have you seen and/or captured any USB errors so far?

    Never on RasPiOS. I'd like to use it as a point of comparison.

    Perhaps it's a wild goose chase.....

    Thanks for writing!

    bob prohaska

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to bob prohaska on Saturday, May 07, 2022 16:04:37
    On 05/05/2022 16:23, bob prohaska wrote:
    Martin Gregorie <martin@mydomain.invalid> wrote:
    On Thu, 5 May 2022 06:18:02 -0000 (UTC), bob prohaska wrote:

    Looks like it's already installed. But, lsusb seems to report what
    devices are present. I don't see an option for seeing errors.

    Have you seen and/or captured any USB errors so far?

    Never on RasPiOS. I'd like to use it as a point of comparison.

    Perhaps it's a wild goose chase.....

    Thanks for writing!

    bob prohaska

    Enable usbmon in the kernel. Google is your friend.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)