You are not logged in.

#1 2019-06-25 18:07:20

Registered: 2019-06-25
Posts: 1

Systemd and CAN message pauses

I'm making a system that communicates with hardware over CAN bus. When I start my program via CLI, everything seems to run fine, I'll quantify this in a second.
Then I created systemd services, like below, to autostart the process on system power up.

Description=Piccolo AP service for Avida/Robopilot

# or always, on-abort, etc


By plotting log timestamps, we noticed that there are periodic pauses in the CAN traffic, anywhere between 250ms to a few seconds, every 5 or so minutes (not a regular rate), within a 30 minute window. If we switch back to starting up via CLI, we might get one 100ms drop over a 3 hour period, essentially no issue.

Technically, we can tolerate pauses like this in the traffic, but the issue is that we don't understand the cause of these dropped messages (run via systemd vs starting up manually via command line). We don't use any environment variables or parameters (read in via config file).

Does anyone have an inkling what's going on here?

Additional notes:
- We've just watched CAN traffic with nothing running, no drops, so we're pretty confident it's not our hardware/socketCAN driver
- We've tried starting via services on an Arch laptop and didn't see this pausing behavior.


#2 2019-06-25 18:24:03

From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,421

Re: Systemd and CAN message pauses

Out of curiosity, what is the physical layer? Are you communicating with an asynchronous serial device in /dev, or are you using some kind of external microelectronic that is using something like IPsockets to talk to your system?

Are you always using the dzyne_can0 service under systemd, whether or not you are starting piccolo under systemd?
what is piccolo written in (java, python, C)  Mostly wondering wither it is byte code or native..

You have Restart on failure configured.  Any chance your code is crashing and restarting?
How do your memory resources look?  Are you swapping after page faults?

Any clues in dmesg or the journal?

Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
How to Ask Questions the Smart Way


Board footer

Powered by FluxBB