USB Gadget

After several fixes to our kernel, support for USB On-The-Go is working on sunxi. We can now use OTG and device ports to do some interesting things.

= USB Ethernet support =

This allows ethernet emulation over USB, allowing for all sorts of nifty things like charging, ssh, and nfs in one go over the same wire, at higher speeds than most Wifi connections.

Kernel support
Currently, the g_ether module is not compiled as part of our kernel configuration.

To enable this, follow the kernel building information of our first steps guide, but after making defconfig, run: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig

Then trawl down the options and set the "Ethernet Gadget" to "m": Device Drivers ---> USB support ---> USB Gadget Support --->     Ethernet Gadget (with CDC Ethernet support)

You can now continue following our first steps guide to continue kernel compilation and installation.

Setting up the usb ether device
We should now be able to run: modprobe g_ether successfully. We can then make this module autoload by adding it to /etc/modules.

Now we just need to set up networking to match, add the following to /etc/network/interfaces: auto usb0 iface usb0 inet static address 192.168.0.2 netmask 255.255.255.0

For this to work reliably, you might need to disable networkmanager, as it does not play nice with debian ifupdown.

Setting up the host
You can convince networkmanager to connect automatically to a specific MAC address, and you then need to hardcode the address to 192.168.0.1 for this connection.

If all goes well, you should now be able to just plug in the usb cable.

= USB storage support =

TODO.