Manual Usb Networks


chris_c

Member
Joined
Jun 25, 2010
Messages
393
Age
55
As its not automagical(tm) I thought I'd put together this mini howto on manually configuring USB networking.

first off just use a normal usb "mini" B connector not any special kind of usb-on-the-go type adaptor - remember that we are using the mini port for networking - you probably use this type of cable with your usb hardrive...

first plug in the usb cable (connect at both ends!) and check dmsg on your desktop you should see something like:
Code:
[ 1469.420014] usb 2-4: new high speed USB device using ehci_hcd and address 6
[ 1469.618505] cdc_ether 2-4:1.0: usb0: register 'cdc_ether' at usb-0000:00:1d.7-4, CDC Ethernet Device, 5e:bc:14:d2:91:c0
[ 1469.619267] cdc_acm 2-4:1.2: This device cannot do calls on its own. It is not a modem.
[ 1469.619377] cdc_acm 2-4:1.2: ttyACM0: USB ACM device
[ 1480.038147] usb0: no IPv6 routers present
Its just possible you could have other usb networking devices so check for the device! it should normally be usb0

then on the pandora run:
Code:
sudo /etc/init.d/usb-gadget start
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up 
sudo route add -host 192.168.0.100 usb0
This enables the usb networking modules and other stuff, we are then setting up the pandora with an ip address of 192.168.0.200
(as a side note it is possible to use the same sub net as your wifi lan (with an extra step) but I would recommend using a separate one - they are different networks...)
we're also telling the pandora if it wants to connect with 192.168.0.100 the address we are using for the desktop (on the usb networking network) then it should use the usb0 device

on your desktop host the network configuration is the same with the addresses swapped round
Code:
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up 
sudo route add -host 192.168.0.100 usb0
so now from the pandora you should be able to ping 192.168.0.100 and from the desktop you should be able to ping 192.168.0.200

and the main reason for using wired is faster file transfer usually to aid with cross compile development
Code:
chris@chris-desktop:~/Videos$ scp strawberryswitchblade_sinceyesterday.mpg 192.168.0.100:/dev/null
strawberryswitchblade_sinceyesterday.mpg      100%   28MB   2.0MB/s   00:14
and the reason for spending extra on a nice class 6 sd card....
Code:
chris@chris-desktop:~/Videos$ scp strawberryswitchblade_sinceyesterday.mpg 192.168.0.100:~
strawberryswitchblade_sinceyesterday.mpg      100%   28MB   1.9MB/s   00:15
and yes I *am* old enough to remember that track coming out :eek:
 
Are you saying you cheaped out on your SD card? The transfers only ran at class 2 speeds.
 
Back
Top