Watched the interview with Iran's FM tonight which confirms my view on the weakness of Obama's original agreement - the agreement was never ratified in accordance with the US constitutional provisions regarding treaties. It was a pretty interesting interview. In Iran's view, "a deal is a deal" (his words) and it was a made with an elected official, namely Obama. In the view of US law, it was an "Agreement Pursuant to Treaty" which was never ratified by the Senate and so carries no real weight in accordance with law. So, though in Iran's view "a deal is a deal," in US law no real deal was made, and I think it could be argued that it wasn't even an Executive Agreement. This could be a structural flaw in the US constitution, or it could be that (a) Obama made a mistake by not ratifying it in the Senate and (b) Trump made a mistake by not sticking by the deal anyway.
Some here don't think that Obama was susceptible to mistakes though - only his successor is. I think they're both only human and each perfectly capable of making their own errors. Obama made a strategical error in not ratifying the deal in the Senate, probably because he understood that any deal wouldn't be ratified by a Republican Senate. But he made the deal anyway, probably understanding the risk that his successor might not abide by it. In most normal circumstances, he would have been correct - his risk wouldn't have materialized and so it would have been a risk worth taking - but Trump isn't normal and the risk materialized. In short, Obama made a miscalculation about his successor. He calculated it would be someone more like Hillary or Jeb, who would have stuck by the agreement anyway. He simply miscalculated the actual degree of commitment of his successor.