If upgrade didn't solve problem, first unistall AH and then try to install AH 5.1.1 again.
But before this action if you see you AH active or disable, first delete it and then try upgrade or re-install.
ePO and Agent Handler version should be same, So yes it will not communicate to ePO console if version mismatch.
Make sure you backup the db.properties file before Agent Handler upgrade.
Thank you guys for your reply.
@ansarias - we have deployed v5.1.1 update to both AH and ePO server. You are right about AH unable to talk to ePO server when there is a version mismatch. Appreciate you taking time to reply. Thank you and have a good one!