Welcome to the HP Community
Note: Check the router band: Many routers can operate in both 2.4 GHz and 5.0 GHz frequency bands, but not all HP printers support both bands. Make sure the 2.4 GHz router band is enabled and broadcasting. If the router broadcasts separate network names (SSIDs) for each band, connect the printer to the 2.4 GHz band SSID.
I suggest you do a Hard Reset on the printer
(1) Turn the printer on, if it is not already on.
(2) Wait until the printer is idle and silent before you continue.
(3) With the printer turned on, disconnect the power cord from the rear of the printer.
(4) Unplug the power cord from the wall outlet.
(5) Wait at least 60 seconds.
(6) Plug the power cord back into the wall outlet.
NOTE: HP recommends connecting the printer power cord directly to the wall outlet.
(7) Reconnect the power cord to the rear of the printer.
(8) Turn on the printer, if it does not automatically turn on.
The printer might go through a warm-up period. The printer lights might flash, and the carriage might move.
Wait until the warm-up period finishes and your printer is idle and silent before you proceed.
Let's perform a network Defaults.
1. From the Home screen, touch (Wireless) and then touch (Settings).
2. Touch Restore Network Defaults.
Then run the wireless setup wizard to connect the printer to the network.
If the issue persists, update the firmware for the printer using this link: https://support.hp.com/in-en/product/hp-envy-4520-all-in-one-printer-series/5447920/document/c02919168
Restart the printer.
Try connecting the printer back to the network.
Keep me posted, how it goes!
If the information I've provided was helpful, give us some reinforcement by clicking the Accepted Solution and Kudos buttons, that'll help us and others see that we've got the answers!
Have a great day!
Cheers:)