First try rebooting both the imac and the ipad.
Have you tried all usb ports on back of imac?
Its not recommended to use external usb ports such as on keyboard or hub to connect the ipad.
Do you have any other devices that you can use to test the usb ports on the imac, such as an iphone or ipod?
Do you have another usb cord?
Hi GrumpyGator, thanks for your help.
Yes, I did reboot both, imac and ipad, and I tried all usb ports on the back of imac.
i do not have another lightning to usb cable to try, however, my ipod nano works perfectly with the 30-pin to usb cable.
As the lightning cable does charge the ipad on the imac usb connectors, and gets connection (although no charge) through the usb hub, i tend to think it is more of a software trouble rather than hardware.
Anyway, if in a couple of dais it does not get solved by itself, I will get another lightning to usb cable to try.
Isn't it funny that the connection works fine through the non-recommended devices, such as the keyboard or the usb hub?