Help! My Miata has issues starting

I bought a '99 MX-5 in the fall with 100000 miles on it. Most of the time it runs fine. But about every two weeks when I go to start it it will run real rough like its only hitting on three cylinders then will eventually smooth out after anywhere from 5 seconds to 2 minutes. But today it wouldn’t start at all. Finally started just fine after trying for 15 min. My mechanic changed the EGR valve but it hasn’t helped. The check engine lite stays on all the time but when it starts rough the lite will flash. Any ideas? Sure hope someone knows what this problem is. My mechanic seems stumped. Thx in advance!

@brotom

“Finally started just fine after trying for 15 min.”

I believe you have low engine compression, due to insufficient valve lash

If your mechanic checks compression, he’ll probably find it to be low

When he checks valve lash, he’ll probably find it to be way tight

I believe on this engine you use different thickness shims to set the valve lash

Please ask your mechanic to consider what I just said

I’ve been wrenching for awhile, and I’ve seen this situation before

Flashing check engine light = severe misfire, which will damage the catalytic converter

You said the check engine light is on all the time . . . please post the code

Please post back with updates

How old is the battery?

Tester

Will do. Don’t know the code. Not sure how old the battery. Will find out tomorrow. Thx for the input!