Welcome! Log In Create A New Profile

Advanced

Dockstar as a host bridge for a Rpi0 configured as a USB gadget

Posted by habibie 
Dockstar as a host bridge for a Rpi0 configured as a USB gadget
August 28, 2018 08:59AM
Based on this Ethernet Gadget tutorial, I configure my Raspberry Pi Zero (Rpi0) as a USB gadget. When I plugged it into one of the USB ports on my Seagate Dockstar running on Linux debian 4.12.1-kirkwood-tld-1, my Dockstar crashes and leaves me with a useless shell prompt. In other words, trying to execute basic commands, i.e. ls, df, etc., ended up with a command not found and/or Input/output error as shown below.
[root@debian:/root 22%] # dmesg
dmesg: Command not found.
[root@debian:/root 23%] # ls
/usr/bin/ls: Input/output error.
[root@debian:/root 24%] # top
/usr/bin/top: Input/output error.
[root@debian:/root 25%] #

If I powered up my Dockstar with an Rpi0 plugged into one of its USB2 ports, I have no problem to SSH into my Dockstar. And, dmesg report indicates that my Dockstar recognizes the Rpi0 as a USB gadget, but with some error messages as shown below. At this point, I don't know how to reach my Rpi0. If I execute ssh rpi@raspberrypi.local, I get an error message saying Could not resolve hostname raspberrypi.local (see below). Anyone?
[   10.084568] usb 1-1.4: new high-speed USB device number 4 using orion-ehci
[   10.245767] usb 1-1.4: New USB device found, idVendor=0525, idProduct=a4a2
[   10.252706] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   10.274542] usb 1-1.4: Product: RNDIS/Ethernet Gadget
[   10.279634] usb 1-1.4: Manufacturer: Linux 4.14.52+ with 20980000.usb
[   10.515935] usbcore: registered new interface driver uas
[   11.045603] scsi 0:0:0:0: Direct-Access     USB 2.0  USB Flash Drive  0.00 PQ: 0 ANSI: 2
[   11.059816] sd 0:0:0:0: [sda] 7892992 512-byte logical blocks: (4.04 GB/3.76 GiB)
[   11.074199] sd 0:0:0:0: [sda] Write Protect is off
[   11.084179] sd 0:0:0:0: [sda] Mode Sense: 00 00 00 00
[   11.084816] sd 0:0:0:0: [sda] Asking for cache data failed
[   11.090356] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   11.109034]  sda: sda1
[   11.125822] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   20.889111] EXT4-fs (sda1): INFO: recovery required on readonly filesystem
[   20.896151] EXT4-fs (sda1): write access will be enabled during recovery
[   21.675118] EXT4-fs (sda1): recovery complete
[   21.783818] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   22.567026] systemd[1]: System time before build time, advancing clock.
[   22.693889] NET: Registered protocol family 10
[   22.699467] Segment Routing with IPv6
[   22.715051] ip_tables: (C) 2000-2006 Netfilter Core Team
[   22.730633] cgroup: cgroup2: unknown option "nsdelegate"
[   22.756197] systemd[1]: systemd 239 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[   22.782439] systemd[1]: Detected architecture arm.
[   22.835677] systemd[1]: Set hostname to <debian>.
[   29.035357] systemd[1]: File /lib/systemd/system/systemd-journald.service:36 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[   29.052597] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[   29.617214] systemd[1]: Listening on Journal Socket.
[   29.659870] systemd[1]: Mounting RPC Pipe File System...
[   29.695990] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[   29.735679] systemd[1]: Listening on udev Control Socket.
[   29.775503] systemd[1]: Listening on Journal Audit Socket.
[   29.815716] systemd[1]: Created slice User and Session Slice.
[   29.859310] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[   29.905154] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[   30.937033] random: crng init done
[   31.450605] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[   31.706114] systemd-journald[191]: Received request to flush runtime journal from PID 1
[   34.128760] orion_wdt: Initial timeout 21 sec
[   34.447884] marvell-cesa f1030000.crypto: CESA device successfully registered
[   35.050194] cdc_subset: probe of 1-1.4:1.0 failed with error -22
[   35.257184] cdc_ether 1-1.4:1.0 usb0: register 'cdc_ether' at usb-f1050000.ehci-1.4, CDC Ethernet Device, b6:7a:54:e7:9a:9b
[   35.405583] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   35.565128] usbcore: registered new interface driver cdc_subset
[   35.572415] usbcore: registered new interface driver cdc_ether
[   38.116143] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   41.367100] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   41.377027] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[root@debian:/root 3%] # ssh rpi@raspberrypi.local
ssh: Could not resolve hostname raspberrypi.local: Name or service not known
[root@debian:/root 4%] #
Re: Dockstar as a host bridge for a Rpi0 configured as a USB gadget
August 28, 2018 07:44PM
Below is some additional error messages captured from dmesg output before my Dockstar crashes with an unusable shell prompt. I don't understand why it reported with a Maybe the USB cable is bad? error message. The USB cable I use is only 6.5" length from tip-to-tip.

[  332.317297] hub 1-1:1.0: hub_ext_port_status failed (err = -71)
[  332.327282] usb 1-1-port4: cannot reset (err = -71)
[  332.336300] usb 1-1-port4: cannot reset (err = -71)
[  332.345288] usb 1-1-port4: cannot reset (err = -71)
[  332.354288] usb 1-1-port4: cannot reset (err = -71)
[  332.359192] usb 1-1-port4: Cannot enable. Maybe the USB cable is bad?
[  332.370534] usb 1-1-port4: cannot disable (err = -71)
[  332.380161] usb 1-1-port4: cannot reset (err = -71)
[  332.389540] usb 1-1-port4: cannot reset (err = -71)
[  332.398910] usb 1-1-port4: cannot reset (err = -71)
[  332.408285] usb 1-1-port4: cannot reset (err = -71)
[  332.417161] usb 1-1-port4: cannot reset (err = -71)
[  332.422064] usb 1-1-port4: Cannot enable. Maybe the USB cable is bad?
[  332.433322] usb 1-1-port4: cannot disable (err = -71)
[  332.442406] usb 1-1-port4: cannot reset (err = -71)
[  332.452160] usb 1-1-port4: cannot reset (err = -71)
[  332.463375] usb 1-1-port4: cannot reset (err = -71)
[  332.473863] usb 1-1-port4: cannot reset (err = -71)
[  332.488980] usb 1-1-port4: cannot reset (err = -71)
[  332.505954] usb 1-1-port4: Cannot enable. Maybe the USB cable is bad?
[  332.527940] usb 1-1-port4: cannot disable (err = -71)
[  332.545125] usb 1-1-port4: cannot reset (err = -71)
[  332.561776] usb 1-1-port4: cannot reset (err = -71)
[root@debian:/root 19%] # dmesg
dmesg: Command not found.
[root@debian:/root 20%] # dmesg
dmesg: Command not found.
[root@debian:/root 21%] #
Re: Dockstar as a host bridge for a Rpi0 configured as a USB gadget
September 10, 2018 07:21PM
Finally, I managed to fix the above issued. So, I ordered this USB Mini 5Pin Female to Micro 5Pin Male 90 Degree Angle Adapter and my Rpi0 fits to a Dockstar docking port as shown in the attached picture. Unfortunately, it does NOT work because the adapter is NOT OTG capable (see here on how to convert a non-OTG to OTG). I was thinking to fix this by inserting a tiny sleeve of aluminum foil to shunt the Sense pin to the GND pin on the micro USB side. But, this is very tiny and am afraid to fry it.
Attachments:
open | download - Rpi0 on Dockstar.jpeg (96.3 KB)
Re: Dockstar as a host bridge for a Rpi0 configured as a USB gadget
September 15, 2018 07:15AM
habibie Wrote:
-------------------------------------------------------
> Finally, I managed to fix the above issued.
>
Looks like I spoke too soon. The above problem persists. I suspect the g_ether kernel module may have some bugs that causes the rootfs partition on a USB storage to corrupt in memory (RAM). Power cycling the Dockstar will definitely get the USB memory stick cleaned again by removing some dirty inodes during the power boot and then boots into a normal mode thereafter.

> So, I ordered this USB Mini 5Pin Female to Micro 5Pin Male 90 Degree Angle Adapter and my Rpi0 fits to a Dockstar docking port as shown in the attached picture. Unfortunately, it does NOT work because the adapter is NOT OTG capable (see here on how to convert a non-OTG to OTG).
>
Looks like the same thing here: I spoke too soon, too.

I did some further tests by connecting my Rpi0 to the Dockstar docking port through its USB power port and the Rpi0 boots OK. However, since it is a power USB port, it won't be able to communicate with the Dockstar to get the IP Address from my router. Anyway, I then shutdown the Dockstar, unplugged and/or replugged the Rpi0 to the Dockstar docking port through its USB data port (see the attached snapshot). LOL and behold, the Rpi0 now boots OK, assigned with a dual-stack IPv4 and IPv6 addresses from my router, and I now am able to access it through my LAN. TBH, I am clueless how power cycling an Rpi0 through its USB power port activates its USB data port to power the Rpi0. Perhaps, it was just a fluke.

Looks like this is the least cost to get an Rpi0/W up running.
Attachments:
open | download - Rpi0 on Seagate Dockstar docking port.jpeg (171.1 KB)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: