Problem solved here! The ipad was in a protective case, and moist was accumulated in the bottom of the case. It shorted the keyboard connector. Cleaned it, dried the case and after applying some isopropyl to the said connector covered it with quality transparent tape ( I don't use an external keyboard). Problem solved. Thanks!