Cannot connect my XP to HP printer

I want to use my 'retired' XP laptop as a 'server' for my HP printer / scanner but I cannot get it to connect. It is 'connected' by USB cable (not Wi-Fi), the PC pings when USB is plugged / unplugged ---- but HP Doctor etc says it is not connected, it does not display the problems menu and nothing prints. I have worked on it for weeks, everything seems OK now. The drivers are installed, the printer is installed and has a tick, but is listed as offline, which I have not been able to change. I have tried all the fixes suggested by HP. I feel I must be on the edge of success but it eludes me.

HP Deskjet 1510
Windows XP 3 Acer Laptop
I have a lexmark and mine is listed as offline if my printer is turned off and ready if I have the printer turned on.

are there any errors listed in event viewer and what does device manager say?
Thanks for your response. I will look n those two locations ---- as the printer is shown as 'not connected' I don't expect to find anything --- but it is best to try every possibility.
Sorry, I thought I had replied but it appears not. Yes, I know about the timing of plugging the USB cable. One suggestion I will try tomorrow is to see if I can scan to the XP --- if so the connection itself is OK and the problem lies elsewhere.
I had a problem with certain usb ports not working while other ports did, and only with HP printers. (now with samsung & no problems)
Success! After a lot more effort I finally made a breakthough in the last couple of days. The XP and HP connected, as shown in the Doctor errors menue which identified four faults, some but not all of which went away after reinstalling the HP software and continuing to check out various possibilites. The Scanner was the first thing to connect --- that was a useful tip.

I tried so many things in an 'arms flailing' (lack of) stratergy I am not certain precisely what did it but the following two were key (1) USB printer port settings were not right (the main thing I am sure) and (2 ) corrupt or missing elements in the driver software, hence the reinstall. Above, other users have suggested the ports especially with HPs ---- in future it will be one of the first things I check. Doctor still identifies a couple of errors but as at present everything seems to be working I am not going to carry out the fixes described by Doctor.