USB network


HelenF

Very Active Member
Joined
Jun 22, 2013
Messages
615
Location
UK
How do I connect the Pandora USB network from Fedora? When I plug it in, a new Ethernet network appears in the NetworkManager applet, but there's no option to connect to it.
 
There's different ways to do that.

I usually go that way :

I create a static connection on the OP side, with a fixed IP.

Then on the PC side, i do an ifconfig usb0 another fixed IP.

If modules on PC are not loaded, modprobe those :

$ lsmod
Module                  Size  Used by
cdc_acm                17433  0
cdc_ether               4708  0
usbnet                 19461  1 cdc_ether
 
 
The Pandora seems to have let me set an IP. On the PC side, those modules are loaded, but ifconfig says there is no such device as usb0. NetworkManager is now "requesting an ethernet network address".
 
On the PC, try ifconfig -a to see if usb0 isn't actually ethX.

Maybe you should disable the network on the OP and go manual with ifconfig also.

At least until someone responds here with a more accurate procedure ^^.
 
Network Manager on the pandora doesn't seem to recognize USB networking, so you have to set it up manually on the Pandora with ifconfig or dhclient before Network Manager on the other machine will establish a connection. 

Something else to be aware of is that by default USB networking on the pandora uses a random MAC address, Which Network Manager on the PC will see as a new connection each time it changes.

You can fix this by specifying the Host and Device MAC addresses in modprobe.conf on the Pandora with a line that looks like:


options g_cdc dev_addr=XX:XX:XX:XX:XX:XX host_addr=YY:YY:YY:YY:YY:YY

You can populate these with the most recently selected random addresses which you can find with:


dmesg | grep usb0
Hope this helps

- Neelix
 
Last edited by a moderator:
Apparently ifconfig on the PC thinks the network is called "enp0s29f7u3".

I was able to configure the Pandora MAC addresses, connect to the USB network from the Pandora side using ifconfig, and connect from the PC side using NetworkManager's "Edit connections". Then I could SSH into the Pandora over USB.

How can I make the Pandora connect automatically with a fixed IP address? And how do I stop the PC trying to get internet access through the Pandora?
 
And how do I stop the PC trying to get internet access through the Pandora?
Go back to Edit Connections, and click on the IPv4 tab.  Change "Method:" to something other than "Automatic". 

I have mine set to "Shared to other computers" which sets up a DHCP server on the PC.  Then when I want to start the connection on the pandora I just run "sudo dhclient usb0" from the terminal.  (I usually only have to do it once per boot and I rarely reboot the Pandora)

- Neelix
 
I changed the Method from "Manual" to "Shared to other computers", but it didn't help. The PC seems to prioritise "Ethernet networks" over "Wi-Fi Networks" for internet connection.

Just tested: for PC to Pandora connection, I'm getting about 2Mbps over wifi or 16Mbps over USB network, so that's a big improvement if I can configure it reasonably.
 
Last edited by a moderator:
That's never been an issue for me, so I don't understand what's going wrong.

On my machine Network Manager is perfectly happy to connect to either the Pandora via USB, the WiFi, or both at the same time, and it always goes to the WiFi for internet access, and relays it to the Pandora.

Maybe one of your earlier attempts to connect is interfering somehow?  I'd try rebooting. (EDIT:  Rebooting the PC that is.)

- Neelix
 
Last edited by a moderator:
Thanks, you're right. I rebooted them and connected the Pandora using dhclient, and can SSH into the Pandora, and use the PC's internet from either.

If I try to connect from the Pandora with ifconfig to get a fixed IP address, it can't use the PC's internet connection - I guess I'd need to set up the DNS and gateway IPs correctly? But the Pandora always seems to be 10.42.0.54 anyway, so I might be OK unless I want to connect two Pandoras at once (and even then it would have a second network for the other one's MAC address, so might change the earlier digits instead).

I wish I could do this from the university computers, where the Pandora can't connect to wifi, but I suspect not. The networking is pretty locked down there.
 
Last edited by a moderator:
I think you'll find that if you hook up another pandora the same way at the same time it will probably end up as 10.42.1.54.  (Or something like that.  Mine usually gets 10.42.43.10 and when I tried that the second one ended up as 10.42.44.10)

I haven't really bothered looking into fixing it up with a fixed IP, as I haven't really found a need to, so I don't really have an answer there.

- Neelix
 
It doesn't seem to be very well behaved with two Pandoras (having to rerun dhclient on both to make them connect, and getting unpredictable IPs), but I don't really need to do that, so I won't worry about it. Thanks for the help everyone :)
 
Back
Top