4

I'm attempting to get the g_multi mode to work on:

Raspberry Pi Zero W running a Fresh install of Raspbian Jessie (April 2017 kernel 4.4)

The goal is to have the device run as a g_mass_storage pointing to a local bootable ISO, and be able to SSH into the device using the g_ether mode.

So far, Ive been able to get g_multi up and running without error. The mass_storage system is recognized and is bootable as expected, however when I try to SSH in, the connection hangs. There is no timeout, or any other IP related error. It just sits there for over 5 minutes without status.

My setup:

cmdline.txt (after rootwait)

modules-load=dwc2

config.txt (at the end)

dtoverlay=dwc2

/etc/modules

dwc2
g_multi

Then i created a new modules config file

/etc/modprobe.d/multigadget.conf

options g_multi file=/bootable.iso

and on the first boot, i created an empty "ssh" file in the root of the boot partition

When the modules load at boot I get a nice happy Multifunction Composite Gadget initialized message, no errors. Open SSH is set up and working properly, and functions as expected when I drop the config down to just g_ether.

  • When doing a net stat and monitoring ports on the Pi there are zero incoming connections shown.
  • When doing an ssh -v(erbose) on the client side, there is zero errors or activity.
  • I'm using a USB A to micro B OTG cable
  • I've tried using the raspberrypi.local bonjour hostname, the internal IP it sets on boot, and configuring a static ip for the usb0 interface.
  • I've tried to connect it to my Mac Laptop, Windows Laptop and Unix desktop, all with exact same results.

I'm stuck. Thoughts?

Community
  • 1
  • 1
Matt
  • 41
  • 1
  • 4

3 Answers3

2

Based on this comment, I was able to get g_multi running with g_mass_storage and g_ether as follows:

config.txt:

dtoverlay=dwc2,dr_mode=peripheral

cmdline.txt:

... rootwait modules-load=dwc2,g_multi quiet ...

/etc/modprobe.d/g_multi.conf (on the RPi):

options g_multi file=/myfile.bin host_addr=11:22:33:44:55:66 dev_addr=aa:bb:cc:dd:ee:ff

Both - the mass storage as well as ethernet functionality work concurrently, as expected.

dqbydt
  • 73
  • 9
2

These setting "work" but the drive mounted in windows mounts as read only even when these settings are in /etc/modprobe.d/g_multi.config

options g_multi file=/myfile.bin removable=1 ro=0 stall=0
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
  • My question above was edited and removed the actual question. The drive mounts fine but is read only. How do you get it to be r/w?? – user2295224 Dec 30 '18 at 03:04
-1

I've tested g_multi and configFS solutions for multiple gadget (ecm+acm/acm_storage/ecm+storage--MSG--/etc) On kernels series 5.8.x,5.10.x,5.11.x, only the first device shows up, and it may not even connect to the other USB end point. Series 4.x do work (tested on 4.4.x and 4.14 and 4.19.) This has been tested on RPi Zero, RPi Zero 2 W, Radxa Zero, Banana Pi M2 Zero and PocketBeagle. And yes I do have that many key fob size SBCs. The linux USB gadget concept on a Key FOB sized SBC opens a large number of project opportunities.