I had this happen to my D5160. I unplugged the power and USB and put in new cartridges and it solved my problem.]
Also make sure that no ink has leaked on the electrical contacts on the cartridge or in the printer. If so, clean well.
I don't trust HP support. After 18 hours on the phone with them when I initially purchased the printer, they finally said that their printing software would not work with my Windows XP MC SP3 system. That's why I now use Acoustica. I am now using it with Windows 7 in virtual XP mode since the W7 HP drivers won't work for me on my W7 machine.
I tried the cartridge trick and also checked to be sure everything was clean but no luck .... I got a few other tips from the HP forums, but none of them worked for me ... It's a pity there is no good way to troubleshoot the problem.
After reading some reviews I think I am going to get an Epson XP-850 ...