Problem: OP does not have the freedom to pursue what he finds interesting.
Tactic: Given existing work arrangements, attempt to negotiate a setup where he can just work on what he wants. If the employer changes its mind, OP gets to restart the cycle.
Strategy: Avoid having this problem in the first place.
Pursuing the strategy means taking a high-paying job, saving a large fraction (https://www.mrmoneymustache.com/2012/01/13/the-shockingly-si...) and having the financial freedom to never worry about this problem again.