My keyboard doesnot work when it is connected

When connected the connection light just pops up and down and suddenly after few minutes or even hours the keyboard is connected . At first used to work now the buttons don't work properly. Any solution for fixing?

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0