I have mavproxy running in a screen session as a systemd service on a raspberry pi 4 running 64bit bullseye, that’s connected to a CubeOrange+ over serial0, and takes commands from another service running my companion computer software over a udpin:127.0.0.1:14551. About 90% of the time, the mavproxy service connects cleanly with the cube, and everything works right out of the gate. However, randomly 10% of the time mavproxy will start up and show “link 1 down” and until it’s restarted (manually through systemd, or by removing and then adding back the serial link) it will stay that way, but after it’s restarted it comes right back up. I’ve tried delaying the start of the mavproxy service by several seconds, making it a dependency of the serial port, triggering its start with a udev rule, but none of this seems to work to make it connect 100% of the time.
My next steps are going to be trying to put in the .mavinit.scr to restart the link immediately every time, and to have my companion computer software include a watchdog that tracks if we’re getting any packets and restarts the mavproxy service, but I was hoping to get to the bottom of the why instead of just papering over it.
Any ideas?