"The Oxford English Dictionary says the first published use of 'hello' goes back only to 1827. And it wasn't mainly a greeting back then. Ammon says people in the 1830's said hello to attract attention ('Hello, what do you think you're doing?'), or to express surprise ('Hello, what have we here?'). Hello didn't become "hi" until the telephone arrived.
The dictionary says it was Thomas Edison who put hello into common usage. He urged the people who used his phone to say 'hello' when answering. His rival, Alexander Graham Bell, thought the better word was 'ahoy.'
-NPR's "A Shockingly Short History of Hello"