Skip to main content

sysfstree_raspbian displayes gadget usb information from the ConfigFS and SysFS

Project description

SysFSTree Raspbian

sysfstree_raspbian is a wrapper for sysfstree that provides numerous shortcuts to interesting data (mostly gadget related) in SysFS on the Raspberry PI running Raspbian

sysfstree implements a generator function that will recursively iterate a file system, typically /sys, retrieving the contents of the files, and displaying the path names and data in a fashion similar to the tree(1) command.

sysfstree_raspbian Assumes these modules are loaded to get active configfs gadget:

  • dwc2
  • libcomposite

SYSFS

Current configuration: --usb_gadget - /sys/kernel/config/usb_gadget --udc - /sys/class/udc/fe980000.usb --soc - /sys/devices/platform/soc/fe980000.usb/gadget

Show gadget configuration: --gadget - /sys/kernel/config/usb_gadget

Show loaded modules:

  • /sys/module/usbf_f*
  • /sys/module/udc_core
  • /sys/module/dwc2
  • /sys/module/libcomposite

Gadget Function Modules available

--usb_f - /lib/modules/$(uname --kernel-release)/kernel/drivers/usb/gadget/function/usb_f_*

Examples

# sysfstree_raspbian --soc-udc
[/sys/devices/platform/soc]
┣━[fe980000.usb]
┃   ┣━[udc]
┃   ┃   ┗━[fe980000.usb]
┃   ┃       ┣━device -> /sys/devices/platform/soc/fe980000.usb
┃   ┃       ┣━subsystem -> /sys/class/udc
┃   ┃       ┣━[power]
┃   ┃       ┃   ┣━runtime_suspended_time: 0
┃   ┃       ┃   ┣━runtime_active_time: 0
┃   ┃       ┃   ┣━control: auto
┃   ┃       ┃   ┗━runtime_status: unsupported
┃   ┃       ┣━current_speed: UNKNOWN
┃   ┃       ┣━is_selfpowered: 0
┃   ┃       ┣━b_hnp_enable: 0
┃   ┃       ┣━is_otg: 1
┃   ┃       ┣━function: g1
┃   ┃       ┣━state: not attached
┃   ┃       ┣━a_hnp_support: 0
┃   ┃       ┣━uevent: DRIVER=configfs-gadget
┃   ┃       ┃       : USB_UDC_NAME=fe980000.usb
┃   ┃       ┃       : USB_UDC_DRIVER=g1
┃   ┃       ┣━is_a_peripheral: 0
┃   ┃       ┣━a_alt_hnp_support: 0
┃   ┃       ┣━maximum_speed: high-speed

Installation

Install with pip or easy_install.

::

pip install followname

Running Tests

sysfstree_raspbian currently only has doctests.

Run tests with nose::

nosetests --with-doctest src/sysfstree_raspbian

Run tests with doctest::

python -m doctest -v src/sysfstree_raspbian/__init__.py

Author

Stuart.Lynne@belcarra.com Copyright (c) 2020 Belcarra Technologies (2005) Corp.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sysfstree-raspbian, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size sysfstree_raspbian-0.1.1.tar.gz (7.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page