5

I have a Pi Zero that I would like to use to communicate with a B+. In theory I can connect an adaptor cable and a WiFi or Ethernet USB dongle to the Zero, and do the same on the B+.

However, as an alternative, it is theoretically be possible to connect the two together either using USB or GPIO (e.g. off the top of my head, using PPP over the serial).

I would imagine the following may exist:

  • USB to USB (with special hardware & kernel drivers) - up to 400 Mbit/s

  • Serial to Serial (e.g. PPP) - up to 3.5 Mbit/s (Raspberry Pi: Increase UART speed)

  • SPI (with additional hardware) - ?? Mbit/s

  • I2C (with additional hardware) - 30 Mbit/s (What bitrate can I get from an i2c bus?)

  • Bit Banging GPIO - ?? Mbit/s

  • USB/Ethernet - 400 Mbit/s - e.g. with a USB 2 Gigabit Ethernet Adaptor - are there any already supported by the kernel, or use pi compatible drivers?

Could you confirm if they do exist, and if there are mature implementations (e.g. can be relatively easily used to transfer IP datagrams).

I am looking to implement a backup camera (camera on the zero, screen on the B+) so would need to transfer a fair amount of data fairly quickly.

  • 1
    Hello and welcome. I doubt that 30 Mbit/s for I2C are a real world thing. – Ghanima Dec 11 '16 at 21:59
  • Also worth noting, regardless of the adapter used, actual max payload transfers with USB 2.0 are probably limited to 280 Mbps, and while it's something I've never put to a rigorous test, anecdotally after years of Pi usage I've never seen one exceed that 30-40 MB/s boundary, nor anyone here claim otherwise. – goldilocks Dec 12 '16 at 13:02
  • Other factors to consider are length of the cable run and environmental noise. SPI and I2C aren't really designed for long-distance communication, and will likely not be able to run at full speed, particularly in a noisy automotive environment. Shielding properly may help a bit. Even the USB standards say cables should not exceed something like 10ft/3.3m, though longer cables often do work. Ethernet is designed for long runs, so it may be more performant. – hampercm Dec 14 '16 at 15:17
1

Based on similar experimentation I'm going to second the conclusions in the link about UART, namely, at 1 Mbps it is reliable, above that less so.

If you want speeds that are anywhere near networking speeds, you need to use a networking interface -- ethernet or wifi. That you want to do datagram based transfers pretty much locks that down.

Something missing from your list is connecting the Zero to the B+ via USB as an OTG ethernet gadget, which means:

  • No additional hardware needed besides a standard microUSB cable.
  • High speed (100 Mbps+).
  • IP network based.

In light of that I don't see any point in monkeying around with the sketchy, and in context much more awkward, GPIO based options, none of which even promise anything like 100 Mbps anyway (although as a caveat I'll admit while I use the eth gadget setup, I have not payed enough attention to say exactly what the max transfer rate is -- but there's no reason to believe it should fall short).

You will find many explanations of how to configure the ethernet gadget setup here and elsewhere online, including the Foundation's own docs. It is simple enough from there to test how fast it potentially is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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