Superkootz is on to something. I recently had all sorts of problems with my printer randomly going offline. It did it with the computer, laptop, iPads, iPhones, everything. I tried resetting, setting ports, changing Firewall settings, then broke down and bought a new printer. Same problem. My router is newish, bought it in April.
So, checked and sure enough there was a firmware update. Updated it, no, no issues. Printer is online all the time. The point being, Firmware can make a huge difference.