toprobin
Posts: 23
Joined: Wed Jan 09, 2013 1:34 pm

2 Raspberry Pis, 1 USB hub

Fri Apr 19, 2013 11:46 pm

I have recently connected a second RPi to my USB hub. The first is working fine, with a mounted NAS on /mnt/share. If I connect the second RPi alone, I see the share. When I connect the two, the second doesn't see the share, in fact it doesn't see the device. The situation is:

+ Connecting to the USB hub produces no output in dmesg, no device to recognize
+ I can't manually mount, as there is no device.
+ Both RPis can get power from the hub and connect to the NAS if they are the only ones on it.

Is this expected? How should I mount the drive from the 2nd RPi?

Thanks.

User avatar
skidoobond
Posts: 40
Joined: Mon Feb 25, 2013 8:26 pm

Re: 2 Raspberry Pis, 1 USB hub

Sat Apr 20, 2013 12:05 am

I don't believe you can use a USB hub like a network switch. AFAIK the USB hub will only register itself to one RPi at a time. This is a behavior of USB. My understanding is that when you plug in a USB device, it runs what could be called a boot loader. This identifies itself to the host among other things. Once this is done, I don't believe the device will identify itself again until it looses power. I believe this ties it to the first host you plug it into. You need to run a LAN between the 2 RPis to be able to access NAS devices and other network enabled devices.

Also, power on USB is separate from the signal. This means you can power both RPis from the same powered USB hub, but only one with identify it.

toprobin
Posts: 23
Joined: Wed Jan 09, 2013 1:34 pm

Re: 2 Raspberry Pis, 1 USB hub

Sat Apr 20, 2013 12:26 am

Makes sense. Can someone confirm?

In this case can I share the directory by modifying /etc/exports on the main RPi? Is this the best way for the two hosts to see the share?

User avatar
skidoobond
Posts: 40
Joined: Mon Feb 25, 2013 8:26 pm

Re: 2 Raspberry Pis, 1 USB hub

Sat Apr 20, 2013 12:35 am

I would give this a try.

http://www.ianrolfe.com/raspberry-pi/co ... as-server/

I used a more command line NAS option that doesn't use Samba, but I can't find it right now.

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: 2 Raspberry Pis, 1 USB hub

Sat Apr 20, 2013 12:46 am

USB operates in a Master-Slave configuration. Traditionally Masters had the "flat rectangular" socket, Slaves had the "square" socket and the connecting leads had one of each type of plug. So you could connect a Master (eg a PC) to a Slave (eg a printer) but never a Master to a Master nor a Slave to a Slave. The introduction of mini and micro USB connectors muddied that a bit and some USB ports can be switched to either Master or Slave but the Master-Slave configuration must still be observed.

A USB hub 'expands' its single Slave port to multiple Master ports which can be connected to other Slave devices. A USB hub can only have one Slave port.

The USB ports on RPis are Masters. So you cannot connect RPis together directly via their USB ports. You cannot connect more than one RPi to a USB hub - because hubs have only one Slave port. You cannot connect a Slave port on a USB hub to a Slave port on another USB hub. Thus, there is no way even with USB hubs that you can connect two RPis for data transfer from one to the other. (There do exist devices which will connect a Master to a Master - eg http://www.amazon.co.uk/StarTech-com-Da ... B003V4TVAW - but these are not mere cables.)

You can connect a second RPi to a Slave port on a USB hub if the only purpose is to power the RPi from it. But the data wires must be disconnected somewhere.

toprobin
Posts: 23
Joined: Wed Jan 09, 2013 1:34 pm

Re: 2 Raspberry Pis, 1 USB hub

Sat Apr 20, 2013 4:24 am

I got this to work by mounting the share as an nfs mount, and editing /etc/exports on the master. Thanks!

Return to “Troubleshooting”