usb networking


dbluelle

Still Fresh
Joined
Nov 22, 2011
Messages
39
Hi,


Is there a possibility to get network access through an usb ethernet adapter with the .next image?


AFAIK the scripts and tools for USB networking


(/etc/init.d/usb-gadget and /etc/init.d/usbhost (?) ) are not available in the current image.


Thanks in advance


dbluelle
 
Forgive me if the following doesn't help you at all, but I thought it's worth a try to help you. ;)


When I want to connect my Pandora (latest standard-OS: SuperZaxxon1.51) to the my Gentoo-PC by using a normal miniUSB<->USB-cable, then I currently do it the manual way (since I reflashed NAND and didn't yet modify system-configuration). I noticed that for a connection over USB the USB-Host-Script doesn't even have to be run. All you need is the g_ether-module and two ifconfig-lines.


As root do:



Code:
modprobe g_ether

ifconfig usb0 xxx.xxx.xxx.xxx (to be replaced with an IP for a new subnetwork between your PC and the Pandora)

ifconfig usb0 up

dropbear (only needed for ssh-connections)



Since my PC is still configured to set up usb0 automatically as soon as I plug in a USB-network-device (my Pandora), after that i can directly connect to the Pandora by using



Code:
ssh <username>@<IP_you_specified_above>



The kernel of my Gentoo-PC had to be configured properly for this, too. In addition to this I also configured iptables to start with a configuration that passes on Internet to USB0 (the Pandora). So if i type in some more lines on the Pandora as root, then I also get Internet:





Code:
route add default gw <ip_of_usb0_of_my_PC>

echo "nameserver <ip_of_my_router_since_it's_the_DHCP-server> >> /etc/resolv.conf


That's it. No need for an adapter in such a setup. Unfortunately I have no experience with USB-Networking (and passing on Internet) from a Windows/Mac-PC as well as with usb-ethernet-adapters in general.
 
Last edited by a moderator:
I've tried the direct usb connection before on SuperZaxxon and couldn't get it to work. :(


ping always says "destination host unreachable" from both sides,


although wireshark shows that indeed some data is transferred between


my desktop (Archlinux) and the pandora and vice versa.


(ssh says "no route to host" form both sides)


So I tried using an usb-ethernet adapter and that works on SuperZaxxon.


However on .next this doesn't work (I think because of the missing scripts).


But thanks for your help anyway, I will experiment with the direct connection :)


dbluelle
 
Try to configure the Pandora like described in the first 3-4 lines, then connect the Pandora to the ArchLinuxPC.


Login as root on your PC and type "ifconfig -a". You should see a device usb0. If you do not see it then try to run "modprobe usbnet" on the PC. Also be sure to use a USB-cable that allows data-transfer. Some cables are just for charging and don't transfer data. If you have a USB-cable that fits into the Pandora/PC and that you used for data-transfer before (from a phone, cardreader, externalHDD), then use that.


Once you managed to get "usb0" in the output of "ifconfig -a", you can configure that device and bring it up, just like you did on the Pandora:



Code:
ifconfig usb0 xxx.xxx.xxx.xxx

ifconfig usb0 up


Also i recommend to use a different sub-network for the connection between the Pandora<->PC, than you use for connecting the PC to your router or other hardware. For example:


- your PC-ethernet-card (or wlan) and your router use 192.168.1.xxx


- your Pandora-USB0 and PC-USB0 should use 192.168.2.xxx


For testing connections you should start with directly pinging the IPs and not the hostnames, which will not work unless you already configured some more stuff. For example:


- ping 192.168.2.14 (from the pandora, if that is the IP of your PC-USB0)


Once that works, try the ssh-connection as stated above (remember to run "dropbear").


Edit: I corrected a mistake that I made in the first post.
 
Last edited by a moderator:
Okay, now I had time to experiment again ;)


On SuperZaxxon I now got the network running with both methods (usb-ethernet adapter / miniUSB<->USB to PC connection).


I don't know what I did wrong previously, maybe it was just a typo in some ip adress :wacko:


On .next the usb-ethernet adapter works if you do "modprobe usbnet" before setting up the network.


I didn't get the miniUSB<->USB connection working. The connection is established but pinging from either side doesn't work.


Wireshark shows that indeed some data is sended and received, but the data is somehow garbled


(e.g. the sender/receiver ip adresses are mostly decoded as "ff ff ff ...")


As networking with usb-ethernet adapter was my original question I didn't investigate the miniUSB<->USB issues.


Thanks for the help.
 
Back
Top