USB networking?


ZXDunny

Deep avatar
Joined
Oct 12, 2010
Messages
2,585
Ok, so I set up my Samba share to my compiler's output directory, and after installing cifs on the Panda I can navigate to that folder just nicely over the WiFi. Problem is that my executable is about 15mb in size (Lazarus only does static linking at present) and so takes about 3 or 4 minutes to transfer over the network. File transfers on other machines are lightning fast, so I assume the dodgy Pandora WiFi strikes again.


So can I transfer files over USB? I've tried the whole "set SD to mass storage" thing and that's almost as much use as the wifi - random file corruption and I'm lucky if my linux box can even see the SD card sometimes, not to mention the whole clat involved in setting it to mass-storage, copying the file, setting it back to normal mode etc.


Can a network be set up over USB so I can share directories via the USB cable? That has got to be much more useful if so!


D.
 
Hm, the SD Mass Storage never had any file corruptions for me, and I copied 16GB Data on my card at once... sure you're properly unmounting on your PC before stopping the Mass storage connection?


Also, be sure the SD Card is not dodgy, that's what caused most of the SD Problems here.


Anyways, you can enable USB Networking in the Startup-Settings :)
 
it also requires the proper drivers be installed on your computer. I think WinXP has them standard, but not Vista and 7. Or the other way around.
 
it also requires the proper drivers be installed on your computer. I think WinXP has them standard, but not Vista and 7. Or the other way around.

He mentioned he got a Linux box. I'm not sure - do Win drivers exist?
 
usbnet should already be installed. It should "just work" from the desktop side, but it may need to be brought up manually. If you can't get it, I'll experiment tonight when I'm at home and see what I can figure out.
 
I've had at least a half dozen dodgy SD cards.. Sometimes they just go bad.
 
usbnet should already be installed. It should "just work" from the desktop side, but it may need to be brought up manually. If you can't get it, I'll experiment tonight when I'm at home and see what I can figure out.

I've had a look around the web, but can't find how to enable it. What exactly do I need to do (both on my linux box and the pandora)?


D.
 
He mentioned he got a Linux box. I'm not sure - do Win drivers exist?
I did use ethernet over USB with my GP2X-F100 to a W98 PC. As far as i can remember i used the RNDIS Driver.


A weird guy is keeping some kind of file archive for the GP2X, you can find some of the Windows drivers here. <gd&r>


btw, Linux driver here with hint to more information. hth, 77
 
Last edited by a moderator:
Argh.


So I can get it to network just fine, but I can't figure out how to get it to bridge the two networks.


1) Activate the USB Network in the Startup settings and reset the Pandora


2) Plug the Pandora into your desktop


If all is working so far, you should be able to type "dmesg | tail" in Ubuntu (ie, your desktop) and get something like



Code:
[52830.595968] usb 1-8: new high speed USB device using ehci_hcd and address 14

[52830.757026] usb 1-8: configuration #1 chosen from 1 choice

[52830.766357] usb0: register 'cdc_ether' at usb-0000:00:0b.1-8, CDC Ethernet Device, 76:18:7d:2b:b9:da

[52830.766822] cdc_acm 1-8:1.2: This device cannot do calls on its own. It is not a modem.

[52830.766993] cdc_acm 1-8:1.2: ttyACM0: USB ACM device

Your desktop recognizes there's an ethernet device connected! Should be named USB0 or something. Verify with "ifconfig -a" (it doesn't start connected)


And this is where it gets tricky. If you give both your desktop and Pandora an IP address (ifconfig usb0 up 192.168.1.100, for example, make sure the IPs are different) they can ping, they can telnet, they can talk to each other just fine. As far as my desktop is concerned, it has two network cards: one to my router to the internet, one to the Pandora. You can even configure it in the gui: System->Preferences->Network Connections, edit Auto USB0, ipv4 Method="Manual", and set your IP address. If you do that, it'll automatically connect the USB network in the future whenever you plug it in.


This is probably enough for your purposes, yeah? You can ssh/sftp between the two, etc, whatever. It isn't enough to get the Pandora on the internet though. I can't figure out the missing piece. I followed a guide to set USB0 to be a shared connection, but the Pandora refuses to get a new IP from the dhcp server, so that's no good. Bah.
 
Abridged version that works


On Pandora: Activate USB Network on the Pandora. Restart. Plug Pandora into PC. Open a terminal and type "sudo ifconfig usb0 up".


On PC: System->Preferences->Network Connection. Edit Auto usb0 (or possibly Auto Ethernet, in my experiments I ended up with both for some reason, probably because I screwed something up the first time), ipv4 settings, method=Shared to Other Computers. This should only have to be done once, then every time you plug in it'll "just work". If you don't see "Auto usb0" (or "Auto Ethernet") then you forgot to ifconfig usb0 up on the Pandora. Go back and make sure.


Back on Pandora: start a terminal and type "sudo dhclient usb0".


Badda bing badda boom, they're connected, you can ssh, samba, whatever between the two, and the Pandora can get online through it's USB port.


In the future, to get your Pandora to connect, just plug it in. You may need to open a terminal and type "sudo ifconfig usb0 up; sudo dhclient usb0" to actually bring up the network and then force it to renew it's dhcp license, especially after a reboot. Now that it's configured, simply unplugging it and later plugging it back in should "just work", but if it doesn't, that command should get things back to normal.
 
Abridged version that works


On Pandora: Activate USB Network on the Pandora. Restart. Plug Pandora into PC. Open a terminal and type "sudo ifconfig usb0 up".


On PC: System->Preferences->Network Connection. Edit Auto usb0 (or possibly Auto Ethernet, in my experiments I ended up with both for some reason, probably because I screwed something up the first time), ipv4 settings, method=Shared to Other Computers. This should only have to be done once, then every time you plug in it'll "just work". If you don't see "Auto usb0" (or "Auto Ethernet") then you forgot to ifconfig usb0 up on the Pandora. Go back and make sure.


Back on Pandora: start a terminal and type "sudo dhclient usb0".


Badda bing badda boom, they're connected, you can ssh, samba, whatever between the two, and the Pandora can get online through it's USB port.


In the future, to get your Pandora to connect, just plug it in. You may need to open a terminal and type "sudo ifconfig usb0 up; sudo dhclient usb0" to actually bring up the network and then force it to renew it's dhcp license, especially after a reboot. Now that it's configured, simply unplugging it and later plugging it back in should "just work", but if it doesn't, that command should get things back to normal.

Ok, tried this and can't get going - System->Preferences->Network Connection doesnt't seem to exist on my system :) Possibly because I'm in Kubuntu?


Auto Usb0 appears on my network manager popup, so I go to activate it and get it "activating" for a while, before it stops without an error. using dhclient from a terminal gives up after a while.


Any ideas?


D.
 
Auto Usb0 appears on my network manager popup, so I go to activate it and get it "activating" for a while, before it stops without an error. using dhclient from a terminal gives up after a while.


Any ideas?
My guess would be that DHCP isn't getting through - not sure how that's meant to work unless you actually set up a DHCP server on the PC end to serve the USB network. Personally I'd just use a static address and switch on IP forwarding at the PC end if you need a route to the Internet (i.e. use the PC as your default gateway).


Maybe worth checking the modules are loaded though too: cdc_ether and usbnet IIRC. I remember having to put them in /etc/modules.conf or whatever it might be in Kubuntu. I'm not at my Ubuntu box at the moment, otherwise I'd paste you a working /etc/network/interfaces.
 
Ok, tried this and can't get going - System->Preferences->Network Connection doesnt't seem to exist on my system :) Possibly because I'm in Kubuntu?


Auto Usb0 appears on my network manager popup, so I go to activate it and get it "activating" for a while, before it stops without an error. using dhclient from a terminal gives up after a while.


Any ideas?
That's because there is no dhcp server :p


Editing the connection and changing the method to "Shared with other computers" turns your PC into the dhcp server that the Pandora can connect to. From a google search, the command you're looking for is knetworkmanager (when in doubt, just add a k to the front of the command :p ) Some further googling tells me you need to change the Configure drop down to Shared (still on the ipv4 tab) and it should accomplish the same thing.
 
That's because there is no dhcp server :p


Editing the connection and changing the method to "Shared with other computers" turns your PC into the dhcp server that the Pandora can connect to. From a google search, the command you're looking for is knetworkmanager (when in doubt, just add a k to the front of the command :p ) Some further googling tells me you need to change the Configure drop down to Shared (still on the ipv4 tab) and it should accomplish the same thing.

Yeah, I tried that and I get the same result.


DHCPDISCOVER on usb0 to 255.255.255.255 port 67 interval 6/10/10/11 etc


No DHCPOFFERS received


Dunno about you, but that 255.255.255.255 address looks wrong to me :)


D.
 
Dunno about you, but that 255.255.255.255 address looks wrong to me :)
:lol: Its the broadcast address :p


How would it know where the DHCP server is before hearing from it? :p


Just to be in-topic (and distro-neutral),


Here's a short guide on bridging usb0 and eth0 on a PC - beware you will lose connections for a moment, and I havent tested this.


Your host PC's interface to the net will change from eth0 to br0.



Code:
ifconfig # take a look at the eth0 parameters

ifconfig eth0 down 0.0.0.0 # clear eth0

brctl addbr br0 # create br0

brctl setfd br0 1 # drop forward delay to 1 (so you dont need to wait 30s for the bridge to start working)

brctl addif br0 eth0 # add the interfaces to be bridged

brctl addif br0 usb0

ifconfig br0 up # add your eth0 parameters here (minimum example: ifconfig br0 up 192.168.0.2)

# I dont remember whether you need to do the next ones, but anyways, shouldnt hurt:

ifconfig eth0 up

ifconfig usb0 up


Then your pandora should be able to participate in the network like any other device you have in it.
 
Last edited by a moderator:
Thanks for the guide - I followed your instructions but I get the same problem - no DHCPOFFERS received (after checking 255.255.255.255) - should that address be changed to my laptop's local IP address (192.168.0.2)?


D.
 
First dummy check: Do you have a DHCP server somewhere in the LAN? (==your intelligent router or ADSL box usually).


Second: that 192.168.0.2 was just a dummy example local IP, you had the same ? :eek:


Connectivity testing:


Set your PC (br0 now) and pandora to static free IPs (192.168.0.3 for pandora if you go by my example) in the network, and try to ping


them all around (PC to pandora?, pandora to PC?, PC to router? if possible other PC to PC and finally other PC to pandora :p ).
 
Back
Top