Using Teensy as a relay between two Raspberry Pis

Status
Not open for further replies.

RyanS

New member
I am looking for advice on building a "relay" between two Raspberry Pi's.

The scenario is that I need to be able to send data from one Pi to the other, in each direction, and I need a device in the middle (in this case, the Teensy) to act as a filter that will decide whether or not to allow the data to transit - something like the following:

[Network #1] ===== [RPi] ------ [Teensy] ----- [RPi] ===== [Network #2]

Each RPi will be attached to a different physical network via the on-board Ethernet connection. The Teensy (along with code running on the Pis) will manage moving the data back and forth.

My question here is: What type of connection between the RPis and the Teensy would provide the most bandwidth in this scenario?

The Raspberry's are physically close (in fact they are right next to each other), so distance isn't a concern.

I have looked at SPI and I2C, but serial would appear (on paper, at least) to be much faster. The PRi has an on-board serial connection, but from this post it sounds like it would be limited in bandwidth.

Based on PaulStoffregen's post #5, it sounds like a USB-to-TTL adapter would provide a higher amount of bandwidth.

Does this sound correct? Is there a better option (for speed) than serial? If using serial, would something like this be better than using the RPis on-board serial?

Thanks in advance,

Ryan
 
The fastest way I could think of would be to connect one of the RPis to the Teensy directly via USB serial and the other by hardware serial, but I'm mostly wondering if this is an XY problem....off the top of my head I can't think of any case where I'd do communications between two RPis with an MCU in the middle, instead of just having them talk to each other directly.
 
USB definitely provides the most bandwidth. But so far we only support 1 port in device mode, even on Teensy 3.6 & 4.0 where there is a 2nd port.
 
Status
Not open for further replies.
Back
Top