1

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:

  1. 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.

  2. 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?

user5626466
  • 111
  • 3
  • Have you monitored memory usage? – CoderMike Sep 26 '20 at 21:13
  • How did you test the supply - it only needs a minor voltage drop or spike (or even noise) that will not show up on a multi-meter. I would talk to Mean Well and see if they have ideas or even if the unit is suitable for a Pi. –  Sep 26 '20 at 22:44
  • @Andyroo: I forgot to mention, I tested it by operating the pi with it. It runs for 7 days so far without issues. – user5626466 Sep 27 '20 at 08:17
  • @CoderMike no, I didn't. The pi is not running anything special yet, apart from sshd. Do you think mem usage could be an issue on a "stock" raspbian installation? Btw, the syslog did not show any signs of a problem. – user5626466 Sep 27 '20 at 08:21
  • Could be RAM, pi Zero only has 512MB. If it runs low it will start swapping memory to sd card and the Pi will look like it’s hung. – CoderMike Sep 27 '20 at 08:29
  • It seems to me you are wasting a lot of energy on guesses that might be better spent in actual diagnosis. https://en.wikipedia.org/wiki/Log_file – goldilocks Sep 27 '20 at 14:31

1 Answers1

1

The Pi Zero is a rather rudimentary design and not very robust. It is not something I would have chosen for a task designed to run unattended.

Any such device needs to be designed for its environment; a distribution board is a rather hostile environment and interfacing needs to incorporate protection, but EMI should not be an issue although this depends on what is being powered.

At the least any such project should include a watchdog. This is standard technique and is traditionally done with an external circuit, but the SOC includes a hardware watchdog. See https://raspberrypi.stackexchange.com/a/99585/8697

This needs some customisation to detect failure conditions. It includes some generic conditions, but ideally this should include an application specific test driven by your code.

Milliways
  • 59,890
  • 31
  • 101
  • 209