Chaining muliple XON/XOFF devices

Hello everyone,

I’m working on a project that involves an embedded device implementing the XON/XOFF protocol for flow control. This device, which I’ll refer to as Device A, is a real-time sensor system designed to be accessed via a USB-to-serial adapter using tools like GNU Screen. This setup works well under normal conditions.

However, due to the mobile nature of our platform, we need to access Device A remotely. The current communication setup is as follows:

  1. Device A starts up and communicates with a microcontroller via UART.
  2. The Arduino collects data from Device A and other sensors, then sends it via UART to a custom radio module.
  3. The radio module transmits 16 bytes every 4 ms to a twin radio module on the receiving side.
  4. This twin module is connected to a Raspberry Pi 4 via SPI.
  5. At the Raspberry Pi, I want to use GNU Screen to interact with Device A as if it were directly connected via USB.

The Challenge:

Since XON/XOFF flow control is essential for communication, it must be handled correctly at every step in the chain (UART, RF, and SPI). My main concerns are:

  • Has anyone implemented XON/XOFF across multiple devices in a chain, similar to port forwarding but for flow control?
  • Has anyone worked with XON/XOFF in a lossy environment, such as RF communication? I worry that dropped packets could lead to buffer overruns or missed flow control signals.
  • Am I setting myself up for frustration, or is this feasible?

If anyone has experience or insights on how to ensure reliable XON/XOFF handling in such a setup, I’d love to hear your thoughts!

Thanks in advance!

Your question doesn't make a lot of sense, especially with generic terms like "Device A".

Do you have a specification for this protocol?

1 Like

Its a protocol for terminal type devices. The device I am working with is in development as well. I cannot really share that much about it other than, it implements this specific protocol and has an RTOS

That's not a protocol, it's a flow control method.

If you can't provide any more info, all I can say is good luck with your coursework.

1 Like

I see. I am sorry I was unfamiliar with the jargon. Is this the right place to ask this kind of questions with respect to architecture or should I ask in other parts of the forum?

Your architecture is probably ok, there are many systems implementing communication between multiple devices. But without specifics, it's impossible to give any further advice. You've just described very generic things, "a protocol", "a device", "a radio module", etc.

1 Like

You already seem frustrated! The whole reason for xon-xoff was because of very slow electronic devices, which we eliminated in the 1970's.
Your description tells me you do not have any error detection and correction protocol between any of the devices in the project. Why not!

1 Like

Never attempted to do anything like this (at least not remotely).

You will need to insert something smart between the Pi and the radio module. That "smart thing" will implement a reliable protocol between it and the other microcontroller at the remote end. Those two will ensure that your XON/OFF gets received reliably. You could probably implement this "smart thing" in code on the Pi and make it look like a serial port to GNU Screen, but I suspect that will be a much bigger job.

That's really the only way for this to work.

An alternative is to ask yourself why you're trying to send a decades-old serial flow control over a radio link when there are many alternatives in 2025...

1 Like

Yes, XON/XOFF over chains has been done. Notably in the days before network connectivity, when "terminal servers" would be used in "milking machine" mode to access some computer over r232, using XON/XOFF, transmiting the data over a network, and talking to a terminal that also used XON/XOFF.

Yeah, lossy environments suck. The XON/XOFF stuff should be happening on the local (non-lossy) links, right? That's somewhat helpful. Losing an XON is bad. You should have some sort of other error correction or at least detection in the transmitted data (if you're repeatedly sending sensor data, missing an update now and then should be OK, right?)

Yeah, I'd expect it to be frustrating. The XON/XOFF bit doesn't sound as fraught as that SPI connection to the RPI that you're expecting to appear as a tty, somehow. (or is that a known capability of the RPi?)

1 Like

Be careful which adapter you use. I have implemented Xon/Xoff communication between Arduinos and PCs; only boards that use the FT232 serial-to-usb adapter work properly with Xon/Xoff. This might be a driver issue, I do not know; tested in Windows (and probably Linux).

Beware! Your description seems to show at least one device is transmit only. To use XON.XOF, all devices must be able to receive and process a message between transmissions. ON/XOF are just like any other message, except this one is ONE character, only.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.