The first long-distance messaging systems were optical: they relied on visual images. The telegraph used electric impulses that shot across longer distances than the eye could see and put optical systems out of business. But much later, a different kind of optics would make electrical cables obsolete.
In 1792, decades before the electric telegraph, Claude Chappe invented an optical system for sending messages. He equipped towers with mechanical arms whose positions indicated numbers that stood for words. The signals could be seen by telescope and relayed from tower to tower.