The Reichstag fire was blamed on the communists by the nazi party to brand them as traitors much like the coup is being blamed on the Gulen movement (which had a fall out with the AKP, Erdogan's ruling party). All signs point to the coup not being related to the Gulen movement at all and a lot of Erdogan's actions post-coup have been publicly justified with allegations about the Gulen movement that are obviously blatant lies.
Whether the coup itself was staged by Erdogan like the Reichstag fire was staged by the nazis is debatable. I personally think it was inevitable given the history of Turkey but it was carried out so incompetently and with little to no support from the military leadership that it's at least possible that it was intentionally made to happen the way it did (e.g. using agents provocateur to trigger the coup at a time when it was doomed to fail).
I don't think the actual soldiers who carried out the coup were knowingly working for Erdogan, them simply being "useful idiots" is far more likely. Either way, if you ask "cui bono?" all answers point to Erdogan and the AKP.
It's been reported that Turkish intelligence knew about it and did nothing.
It sounds like the perfect project for a intelligence team located in the president's basement tech bunker.
See http://www.al-monitor.com/pulse/originals/2015/03/turkey-big...
And it is not a unique event, perhaps just the most widely known. To my mind (having grown up in the Soviet Union), immediate historical references are the murder of Kirov, the murder of Uritsky, both followed by powerful persecution of the "unwanted elements" of the society. (I am sure everyone will recall something similar, either from the history of their nation, or from a textbook or a classical reference).
Every loss of life was tragic but it was entirely Erdogan and the mosques that told people to attack the soldiers. Otherwise this would have been purely between the military and the police. He was fully aware that he could be sending his people to certain death but he did it knowing that he would be able to use it for publicity no matter which way things played out (bloodbath = martyrs for democracy, surrender = victory of the people).
The coup didn't have to be staged to fail. It was doomed to fail to begin with. The only question is why the military either did not see that or didn't mind failing. Considering how much control Erdogan already had over his country (and even the military) before the coup, it's entirely within reason to consider the possibility that he triggered the coup because there was no way it would harm him.