It's over. A badly organized coup and a miserable failure. Even though I think Erdogan is a maniacal dictator and I wouldn't be upset if he was deposed, I don't think military coups are the way. But, not only the planning was bad, they miscalculated the reaction of the people and even within the armed forces. Frankly if there were elements who might have supported a coupe against Erdogan, they wouldn't risk their lives unless the coup would seem to be successful. If the leadership, especially the prez and pm and some other key power heads aren't arrested, usually there's no chance for a coup to succeed.
Further, let's assume the challengers were honest in wanting to "restore democracy", did they realize that if they failed Erdogan would emerge even more of an brutal authoritarian? He now has an excuse for more retribution against his enemies, including those who had nothing to do with this coup....
Amateurs... I can hear some Greeks saying "the colonels" knew how to make a successful coup!