Welcome to the HP Support Community. I'd be happy to assist you with the connectivity issue.
To better assist you - May I have the exact model name of the printer? Refer to this document for steps to find the product details. Do not share any of your personal information such as serial, phone number, email ID, etc.
Let me know.
Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!