I've worked as contractor for equity in the past. And advisor. And I've friends who did that kind of consulting, usually as favor, e.g. MySQL performance tuning. For me that work was extra to an already existing contract/work (one that covered my rent).
The most frustrating part were the emails back and forth on the equity. Not the amount/percentage, but the founder are (of course?) new to the topic, didn't know how to add that to an existing contract, added many "what happens when" clauses and I can only imagine every contract looks slightly different. To give an example: bonus equity when a certain series-A valuation is reached (because I've build the MVP that was presented to VCs).