E4 means the indoor and outdoor units have lost communication. Each half runs its own board and passes settings and status between them, so when that link fails the system cannot coordinate and shuts down. The comms pair carries a low voltage signal, which is why a marginal connection causes this long before anything expensive fails.
The interconnecting cable is the most common culprit. A terminal that was never fully tightened, a core that has corroded inside a coastal ceiling, or a cable pinched behind a casing will break the link. Because the signal is low voltage, even a slightly high resistance joint is enough to lose it entirely.
Either board can fail on its communication port while the rest of it still works. The outdoor board lives with heat, rain and salt air and fails more often than the indoor one. A board is only condemned after the cable and the supply have been proved good, because those are far cheaper to fix and far more often the answer.
Both boards need a stable supply to hold a signal. Voltage that sags when the compressor starts, or a circuit shared with a large load, will drop the comms link and produce E4 intermittently. Repeat codes at the same time of day are the giveaway, because that is when the other equipment on the property runs.
Turn the unit off at the isolator for a full five to ten minutes, then restore power and watch the restart. A link that re-establishes and stays up suggests a transient event. One that drops again within minutes is a live fault, and repeated resets will not fix it or tell you anything new.
The interconnecting cable is checked terminal to terminal for tightness, corrosion, correct cores and continuity on each conductor. Any joint along the run is opened and inspected. This finds most E4 codes and costs nothing but time, so it comes before any board is considered for replacement.
With the cable proved sound and the supply stable, each board’s comms output is measured against what it should be sending. A board that is silent on a known good circuit has failed. Testing the port rather than replacing the board on suspicion is what protects the cost of the part.