Youd know if wiring was bad. or i hope. Knock senors take a awhile to
How long were the knocks out? And how long have drove since?
Unplug the battery when you go to bed, put it back it back in, in the AM. Computer stores data, it'll figure itself out, now that it running right.
You'd know if the plugs where bad if you changed the sensors.