Ford Repair: 1995 Ford Ranger Start problems, dpfe sensor, crankshaft sensor


Question
1995 ranger.

132k miles.

I have been having an intermittent starting problem.
I replaced the battery which was 3+ years old.

I thought that cured the issue because the truck started without a problem
then, the same problem occurred.

I started the truck and drove about 10 miles. Parked it for about 2 hrs.

Went out and tried to start it. The engine cranked, but would not start.

Tried a second time and would not start.
I turned on the lights and proved the battery was good.
Tried to start it and it turned over.
I took it to a shop and they could not fine the problem.
I asked if it was a possible problem with the Solenoid , alternator,
They said if it was those the engine would not turn and you would just hear a click.
They drove it for a week and it happened to their technician but he said he did not have his equipment to check it.

He got it started after a few tries as I did and got it back to the shop.
R an a scan.

Four codes returned that really did not identify the issue - P0231, P1701, P0340, P1270.
They cleared the codes and drove it again. They checked the codes.
It showed code P0340. The shop says the code states to replace the cam position sensor and installing an updated DPFE sensor.

They wanted $650 and would not guarantee it would correct the start problem.
I have been driving it for about a week on and the problem has not resurfaced yet.

A friend whom I work with does some car maintenance told me it is a dead spot on the starter and to replace it.

Any Ideas?  

Answer
well dont listen to friend and replace starter because its not that , it maybe the cam sensor, the shop should test that , this  is hard to tell because r u loosing fuel presure , r u loosing spark , could be 100s  of things , i would check the wiring going to the crankshaft sensor which r know to rub throug by the timimg cover