Setup
I am operating an Raspberry Pi Zero inside a distribution board. The pi is powered via usb using a din rail power supply and it connected to an usb-rs485-adapter to get modbus data from a smart meter. The pi runs Raspbian 10
Problem
I noticed after several hours (5-15hrs) the pi looses network connectivity. As I don't have any other console or gui connected, I assume it crashes. After powercycling the pi boots normally.
At first I suspected a faulty sd-card, but this was not the case. I tested the pi with a different powersupply and the same card, it ran fine. So I assumed the din rail power supply (a Mean Well HDR-15-5) is faulty. However, I removed the very same power supply from the distribution panel and tested it outside without issues.
Now I have only two options left that are different when the pi is inside the distribution board:
The pi is located next to (~2cm distance) the main AC supply wiring (230V, 40A max). The pi is in a plastic case. Can electromagnetic interference cause this issue? I know that this could theoretically be an issue (as with every circuit). The question aims to how likely this could be the case.
Inside the breaker panel, the pi was connected to the rs485 interface. Could a faulty / low quality usb-rs485 device cause this behaviour? If yes, how can this be diagnosed?
Is there any other possibility I am overlooking?