Get the hardware right first
I assume that the hardware at each end will have their own power supplies. Sometimes that means each end will be driven from a different phase of the mains and this can lead to significant earth potential differences. I have measured over 40 volts between the earth pins on two adjacent power outlets in a factory where one power outlet was on one phase and the other on a separate phase. The power outlets were only a metre apart but that was where the electrician split the feeds. The potential difference varied with factory electrical loading and it took days to track down the intermittent errors.
If you try to connect TTL over 40 metres you can only tolerate about one volt of earth difference before the system stops working. No amount of checksum, CRC or retransmission scheme will save you if the earth potential difference is higher than that.
I suggest you use an opto coupler at each end and two twisted pair wires for transmit and receive. Ethernet UTP is high grade cable and the different twist rates for each pair minimise crosstalk and noise pickup. Optocouplers are generally not as good as transformers at all terminations but the transformer approach needs a proper modulation scheme to eliminate any DC component (Google Bi-Phase modulation)which is another layer of complexity best avoided unless you are in a very high electical noise or lightning prone environment.
At one end the transmitter is direct connected to the line with a current limiting resistor. The corresponding receiver at the other end is driven by an optocoupler. The system is then a current loop and the maximum distances can be several hundred metres.
Only AFTER you have reliable communications do you think about adding a checksum or CRC. The end application will dictate how robust the error checking needs to be. If human life is at stake a 32 bit CRC might be wise. If you are just turning a lamp on or off simply sending the command information repeatedly, with no error checking will be fine. I personally use an 8 or 16 bit simple addition checksum for scientific instruments and data loggers and this makes the error rate vanishingly small for a tiny code overhead.
HTH
BrianT