iPhone 5 says accessory may not work etc. Pops up every few minutes, but no accessory is attached!

Earlier it did the same and the sound alerts were off. Poking around on the internet, I discovered it was in permanent earphone mode - as if there were earbuds attached. Per the advice I found, I cleaned the connection and everything went back to normal. But now the alert keeps coming back, but it's not the earphone jack anymore.
There may be some debris is the headphone port that moved enough to clear one issue that's causing another... Or there's something in the charging port...
Thanks Keith. Couldn't find any debris (using magnifier and flashlight), but I gently probed the areas and used compressed air. So far, so good. Thanks!
It's back :-(

Original thread: https://forums.imore.com/threads/iphone-5-says-accessory-may-not-work-etc-pops-up-every-few-minutes-but-no-accessory-is-attached.319279/