4

I know it's possible to connect a computer to a wireless adapter via ethernet and/or USB, likewise for the Raspberry Pi. Is it possible to connect my (Ubuntu) laptop to my Raspberry Pi via a double male USB cable and make them talk like it's an ethernet cable? Also, obviously, if it's possible how do I do it? I've been trying to find an answer and I'm having no luck. Thanks in advance :)

1
  • 1
    As lenik points out, you CANNOT do this with a normal usb cable. Essentially: when you plug a USB cable in, it is not a parallel relationship. The host adapter in the computer expects there to be a (slave) device on the other end. If you plug that into another computer, its host adapter is doing the same thing -- looking for a slave. There is no way out of that using just software, which is why they make those special USB-USB cables: notice there is some hardware in the middle to handle the relationship. That's a slave device for the two adapters.
    – goldilocks
    Commented Sep 17, 2013 at 13:06

2 Answers 2

1

I used to use RNDIS drivers for that purpose, but there are better alternatives available today: http://www.linux-usb.org/usbnet/

Usbnet support is supposed to be included in the latest kernels.

6
  • I've stumbled across this page a few times in my search but unfortunately I'm not savvy enough to fully understand it. I can follow it mostly but I'm still not sure how exactly I can use this to achieve my goal. Also, I'm not using one of those funky transfer cables mentioned in the document. I just want to use a plain USB cable with two male ends. I figure it will require configuration on the Pi, but I'm not sure what configurations are needed. Commented Sep 17, 2013 at 5:00
  • 1
    Doesn't that require that at least one of the two ends support USB host mode? Commented Sep 17, 2013 at 5:55
  • 1
    @FatalKeystroke you may not use two HOST USB endpoints, they won't be able to talk to each other. therefore you need a special cable, that looks like a slave or peripheral to each host.
    – lenik
    Commented Sep 17, 2013 at 7:56
  • @ThorbjørnRavnAndersen if you have only one host, you don't need fancy cables -- it will work straight from the box. however, connecting two hosts (like RasPi and another PC) is tricky.
    – lenik
    Commented Sep 17, 2013 at 7:58
  • 1
    Could you expand on your answer. I am quite interested in how that works? An example, reference or video that it will work with a Pi? Otherwise we might be shooting in the dark :(
    – Piotr Kula
    Commented Sep 17, 2013 at 8:28
3

This is only possible with the model A/A+ hardware, which is capable of both host and device mode on the single USB port it has. However, it doesn't currently work due to kernel bugs1,2,3,4.

If device mode did work, then you could use the gadget drivers such as g_ether, which would make the model A appear as a USB ethernet device when connected to a PC with a double male cable.

2
  • This would be very interesting for the #pizero to hook up a bunch of them behind a device with ethernet (a Pi 2 perhaps). Is there any chance of getting these bugs fixed soon?
    – neuhaus
    Commented Nov 26, 2015 at 19:42
  • 1
    I don't know, but I hope so. Commented Nov 27, 2015 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.