The car cranks but do not start. It is a ECM problem? After many cranks it start on 2002 Hyundai Sonata

First the car was not starting in the morning but afternoon it was starting .Now does not start at all but the self cranks. Once the car starts it works perfectly, while changing gears and even the idling speed is about 900 aprox,witout any fluctuations

Asked by for the 2002 Hyundai Sonata
1 answer
scan codes and post so we can adv poss crankshaft sensor issue