I have kept working on and improving the same Open Source project for over twenty-five years. One of the most repeated questions to me is:
How do you stay motivated?
That is a hard question to answer because I just do without it having been an effort or something I have had to specifically work on.
A project that has lots of users that appreciate it has made it fun for me to fix the occasional reported bugs. I want to keep users happy and if possible grow the user base even more.
I happen to enjoy the challenge of researching and digging really deep into a weird behavior or seemingly explainable side-effect in order to adjust the code.
Of course I too have the regular ups and downs and periods during which I feel that working on the project does not feel like fun. Then I can spend more time on another project (having more than one project really helps) or perhaps even in a forgotten corner of the project that might not actually be the most important thing to work on, but that is fun and feels meaningful right now.
I have learned that my enthusiasm for the project is not evenly distributed over all the different tasks and areas and this uneven distribution changes over time. I can adjust where I focus my efforts depending on what I think feels fun and interesting for the moment and do less of what I am tired of or bored by.
In projects I spend my efforts as a volunteer and nobody pays me for specific tasks it is important to have a laid back attitude and remember that they can always just fix it themselves if they really need to. I do not have to work on the bug or answer the questions immediately unless I want to. I can actually spend time implementing a silly new feature instead of doing user support over a weekend just because it is fun. It helps me keeping the joy of development alive.
I also find that having a "real life", with a family, friends and other spare time activities help me take my mind off my Open Source work during periods and help me recharge and maintain motivation.