Inside or outside, I think lightning is a consideration that I forgot about. For that reason I will try some inexpensive fiber to Ethernet [URL="https://www.amazon.com/gp/product/B07896T2SF/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1"]convertors[/URL]
I am a retired technician and I have seen what lightning will do as I had to repair the damage it caused to broadcast intercom equipment, when possible. In my case there is about 20' of Ethernet outside and about 8' is exposed in plastic waterproof flex, the rest is in underground plastic pipe. The convertors will stop a closeby ground strike or direct strike to the generator from inducing a current flow in the cable.
At $29 for the pair of convertors and the cost of a fiber, I'll give it a try. Serial media convertors are available as well but I think they are more expensive but distance and grounding issues will be solved for most serial applications. Your approach has the advantage of protecting the Pi as anything in the generator, including the generator can be damaged by lightning.
I will post how these work out.
Those should work fine.
The longer the outside run the greater chance of lightning being a risk. The two generators I had connected are 5 feet from the houses, with the exterior cable runs only about 6-7 feet.
I did see pair of RS232 convertors on AliExpress for about $45.00 plus shipping.