sorry I have realised I have put the wrong thread I used to fix the first controller.
trimmtrabb’s code worked for the single controller
sudo chown pi /opt/retropie/configs/all/retroarch.cfg
sudo ./retroarch-joyconfig -j 0 >> /opt/retropie/configs/all/retroarch.cfg
but i cant seem to get it to work for a second controller, when i change the “-j 0” to “-j 1” it puts player ones controller on a different joystick but still wont let me configure it anyway. hope this helps.