Get a reputation as a writer who asks for payment, and you will get paid. Simple as that. Hard to do sometimes, because feelings can be involved. Women writers in particular cheat themselves because of feelings. Writing is a business and you have expertise and should be paid for it.
I hope that by now every writer asks to be paid for writing articles, requests an advance when negotiating a book contract, and at the very least prices his or her e-book at a princely 99 cents.