Board to board communication with interrupted connection

I'm looking to establish a data connection between two Arduino compatible boards (flexible on specific make/model), where I expect the wires carrying the data connection to be physically disconnected and reconnected regularly as part of the use case. The data is extremely light weight, just a simple two way binary status message at around 5Hz.

I'm thinking a simple UART connection may work fine, but I'm not certain what behavior to expect when the TX/RX lines are plugged in mid-packet. Seems like a recipe for garbled data.

I've also considered just doing a direct connection between GPIO pins set to PULLUP, I could get by with only being able to pull a pin low to communicate status, but not being able to tell the difference between "true" and "disconnected" isn't ideal.

My physical wiring is long enough that I'm wary of I2C capacitance issues.

Any other protocols I should look in to?

Thanks in advance!

I am. This is an absolute disaster in the making. Never connect or disconnect circuit components while power is applied.

It takes a great deal of engineering and technical expertise to design specific circuits that allow you to plug/unplug while power is applied (e.g. thumb drives).

Instead, use optocouplers to completely isolate connections that may be turned on and off.

Take a look at the Serial Input Basics tutorial to learn how to properly deal with potentially interrupted serial communications.

Great point, thanks for the insight. I'll definitely implement some isolation to keep electrical issues at bay.

You will need to devise a serial protocol that allows you to detect whether you have a complete message or not. For example, you might have:
Start marker > message > end marker
Only if you receive all 3 do you consider the message to be complete and use it, otherwise you discard the message. The tutorial @jremington linked to should tell you more.