(Off the top of my head) Try setting the printer's IP address to a static one. It may not solve the problem but it eliminates a potential cause.
Your router assigns IP addresses in an ad hoc manner. Every X amount of hours it intentionally "forgets" about devices. After that period, when a device reconnects, it assigns a new IP address. Domestic routers can only deal with 32 wifi clients, hence the need to periodically flush the IP tables.
Let's assume that your router's IP address is 192.168.0.1, it will potentially dole out 192.168.0.2 to 192.168.0.255 as IP addresses, it does so however on a first come, first served basis. If you don't use your printer for X days, when it next asks the router for a new IP address, that IP address may be different.
I normally tell my router to only dynamically assign IP addresses in the lower part of the potential range. Devices such as IP based webcams and printers, I physically assign to the upper part of the range. So for example, I tell it to only assign up to 192.168.0.100 to dynamic IP addresses, I would then set the printer to be fixed at 192.168.0.101. That address is now set in "stone". It will not change every X hours. It makes it easier for other device to "find" it.
The above is easier to do than it sounds. Unfortunately, I have no idea which router/MODEM you have.