As a point of interest, the 97-03 and some 04 trucks have no hubs. The front axles and CV joints always turn. The axles are disconnected inside the front differential rather than at the wheels. (For 04 and later vehicles, they used vacuum hubs at the wheel end of the axle).
First off, check the 4WD fuse. That has to be working before you can check out anything else.
The two solenoids behind the battery are always connected to battery voltage through the 4WD fuse, so there should always be voltage on them. The 12V is fed to each solenoid through a white wire with the light blue stripe. (W/LB)
There are relays built in to the GEM module (located above the fuse panel above the driver’s left knee). When you move the floor lever, or twist the dash knob, you activate these relays built inside the GEM module. They will ground one of the solenoids and un-ground the other. Grounding the solenoid completes the circuit and causes it to provide vacuum. Un-grounding the solenoid causes it to shut off the vacuum. The ground path for the 4WD solenoid is via the red ® wire… The ground path for the 2WD solenoid is via the grey wire with the black stripe (GY/BK) wire.
To check the operation of the GEM module, you can unplug the connector and connect a 12 volt test light across the 12V terminal and the ground terminal on the plug you just pulled off. The light will come on if the GEM is providing a path to ground. Test each solenoid connector and make sure the appropriate solenoid gets activated as you switch between 2WD and 4WD. If the test light isn’t coming on for one or both of the solenoids, then suspect a faulty GEM module.
If they’re working then you might have a vacuum problem. Make sure the vacuum lines are all OK. Pull out the battery and make sure none of the lines got crushed, cut or cracked by the last person who installed the battery. Also check the vacuum reservoir. It’s a thin black square thing with a vacuum line going to it. It’s fastened to the battery tray on the side closest to the fender. As a note… A bad leak in this area can cause the heater controls to malfunction or not work ‘quite right’… If your heater controls aren’t switching normally, then pay close attention to the vacuum lines.
If the vacuum is OK, then you need to check the actuator. You need to take of a plastic shield to see it. Watch the arm to make sure it’s working… If the actuator is OK, then the lever system that disconnects the axles inside the diff is not working. They do break from time to time. If that’s the case, then the front diff has to be pulled apart.
Look at the diagram of the actuator below and try visualize how the rod will move depending on which side of the diaphragm is receiving vacuum. Vacuum from the 4WD solenoid will push the rod out… Vacuum from the 2WD solenoid will pull the rod in.