Phryctoria (Greek: φρυκτωρία) was a semaphore system used in Ancient Greece. The phryctoriae were towers built on selected mountaintops so that one tower (phryctoria) would be visible to the next tower (usually 20 miles away). The towers were used for the transmission of a specific prearranged message. Flames were lit on one tower and then the next tower in succession also lit flames.
In Aeschylus tragedy Agamemnon, a slave watchman character learns the news of Troy's fall from Mycenae by carefully watching a fire beacon. Thucydides wrote that during the Peloponnesian War, the Peloponnesians who were in Corcyra were informed by night-time beacon signals of the approach of sixty Athenian vessels from Lefkada.
Ιn the 2nd century BC, the Greek engineers from Alexandria, Cleoxenes (Greek: Κλεόξενος) and Democletus (Greek: Δημόκλειτος) invented the pyrseia (Greek: πυρσεία). Πυρσεία from πυρσός which means torch. The letters of the Greek alphabet were listed on a table. Each letter corresponded to a row and a column on the table. By using two groups of torches (five torches in every group), the left indicating the row and the right the column of the table, they could send a message by defining a specific letter through combination of light torches. 
The coding system was as follows:
When they wanted to send the letter O (omicron), they fired five torches on the right set and three torches on the left set.
καὶ νῦν φυλάσσω λαμπάδος τό σύμβολον, αὐγὴν πυρὸς φέρουσαν ἐκ Τροίας φάτιν ἁλώσιμόν τε βάξιν500-400BC
So now I am still watching for the signal-flame, the gleaming fire that is to bring news from Troy and tidings of its capture