Serial port between two Pis
Simon Willcocks (1499) 513 posts |
I’d like to connect two Raspberry Pis together with a crossover “cable” (in practice three wires, Rx<-Tx, Tx→Rx, and Gnd-Gnd) and read the serial output from one on the other running RISC OS. What do I need to make that happen? What’s the highest baud rate I can expect? Thanks, |
Rick Murray (539) 13840 posts |
Between my mobile phone (Xiaomi Mi10T) and an ESP32 I get 921,600 bps, so that ought to be possible. I think the first question is can the protocol you’ll be using cope with errors or not? I’ve read that the Pi hardware can cope with up to 45Mbps, but the OS is usually the limiting factor as it can’t deal with the serial port and “everything else” that quickly. So… you’ll need to just keep cranking up the speed to see how far it can go… |
Simon Willcocks (1499) 513 posts |
That’s good to know, although my radom bits of wire and chewing gum connecting the two probably won’t cope with nearly that much! It’s just a few pages of text and any errors can safely be ignored. What software should I be using on the RO end? |
Simon Willcocks (1499) 513 posts |
It’s *Type Serial1:isn’t it? Edit: But not in a task window. |
Rick Murray (539) 13840 posts |
The ESP32 is just a USB to TTL serial gizmo, like one of the many PL2303 clones. It has only TX/Rx/Gnd.
TaskWindows are “fragile”. ;) If it were me, I’d throw together some BASIC to do it (SerialOp SWIs). Send data in, say, 1K chunks and follow that with a simple checksum from the data sent. The receiver can perform the same test and acknowledge for the next chunk or say “nope, resend it”. |
Simon Willcocks (1499) 513 posts |
Oh, there are dark age protocols like Kermit that would do that, but I’m just after boot-sequence debug information, a simple stream of bytes and a Mk1 eyeball to spot errors. I’m trying minicom on Linux to receive, but I’ve messed something up, nothing’s coming through. |
Jean-Michel BRUCK (3009) 359 posts |
You can use !Hearsay on Risc Os and terminal on another OS. At least to do the connection tests. |
Simon Willcocks (1499) 513 posts |
Thanks, I tried, it but it failed. I tried Linux, instead but had to jump through loops to get anything, using minicom. I think I have a problem with the clock to the UART, now. |
Rick Murray (539) 13840 posts |
Set 1200bps 8N1 and no flow control. If that doesn’t work, connect Tx to Rx locally (on the same machine) and see if that works (loopback should). Once the basics are sorted, then you can look at faster speeds and such. If you have an old Windows box around, try HyperTerminal. One of its features is that it is kind of brain-dead and doesn’t try to do anything clever, so you point it at a COM port with a speed and protocol (remember no flow control) and it’ll just show you what it sees. |