Depression? Assuming all your workup to rule out medical causes has been done, getting evaluated by a mental health professional will help clarify the diagnosis.
Evaluation? You could start with seeing a board certified psychiatrist to determine if you have major depression. Than, after your feeling better mentally after a few weeks, ask yourself if you feeling better physically as well. If you do feel better. You're right about problems with your mood causing or at least contributing to the pain. As you feel better, it would seem great to get some exercise.Good luck, .
Depression/ pain. Depression is related to the mood usually. It can be stand alone or part of a syndrome or disease. Usually there are disturbances in emotions( loss of interest), ideation (guilt, worthlessness) and somatic( bodily function related) functions. Pain can be exacerbated or can be part of a syndrome as mentioned early.