Please add some more info about your setup, as detailed in https://retropie.org.uk/forum/topic/3/read-this-first.
I assume that by 'not detected', you mean you can't configure it in EmulationStation ? Can you try to test the gamepad with jstest (see here and see if it works ?
Please post the result of the following commands: