Sounds like the problem is the ground wire of your brake assemblies. If you have power to the assemblies but the ground wire isn't connected to a clean metal surface of the trailer frame then you would have the problems you described.
Also check the condition of the main trailer ground that goes from the trailer connector to the frame of the trailer. view full answer...