Agree on the switch. Likely.
Another option would be to see if you have a fuel filter to your generator. When they get gunked up and the gunk moves around under pressure they it can't intermittently cut off fuel supply, which would shut down the generator. That being said, it likely wouldn't just cut out, but rather sputter out.
Lastly, many RV generators have an overheat sensor. If it is faulty, or for some other reason working properly and sensing an overheat condition, it could shutdown the generator.
|