I tried to make a service that starts mavproxy in my rasperry. I made the service file and put it in systemd, i put the complete part in the exec of the service fie and user pi and all other settings. Once i start it with systemctl the service turns green and doesn’t throw any error but nothing comes out. If i use the same path i use in the service file in the command line it starts and does its things.
Is there anything special i have to add to make it work?
I am at home now and don’t have the file with me but i’ll post it tomorrow. Any help will be greatly appreciated.
Another little question, if i wanted to update my installed mavproxy to the latest release how should i proceed? pip install --upgrade MAVProxy?
Hi there!
I am trying to make a MAVProxy start as service as well, but it keeps crashes right away.
There is no error information except: “Process exit with error code” after calling systemctl status.
In the output file there is only standard starting info from MAVProxy and waiting for master.
Do you have any ideas what can be the issue?
P.S. I tried it on Navio image and clean raspbaian as well.
Isn’t is possible for you to start mavproxy simply in the /etc/rc.local ? That’s the way I’m doing this (also with different “on-the-fly” generated configurations).
@fingadar Main goal is to monitor mavproxy and restart it if it fail. Also second feature is control when it start, for example after network is working.
Hello, I am also trying to run mavproxy as a service. But the service exits with status 203, which says it could not find the path to the executable. Did you mange to solve it?
At the end, you can create configuration script at: /usr/local/bin/pixhawk_configure.sh or type everything by hand. In my opinion better way is to make script, you will have saved commands if you need to restart it.
#! /bin/bash
sudo systemctl daemon-reload
sudo systemctl enable pixhawkmavlink
sudo systemctl daemon-reload
sudo service pixhawkmavlink start
service --status-all
Launch script with sudo, which will launch the service. After every boot, it will wait for WiFi connection or Ethernet and then launch service.
In the /etc/default/pixhawkmavlink file you can change settings like baudrate or serial device and port for UDP. If you need, you can create your own settings and use it in service file.
You can also change names of files if needed.
Good luck!
Edit: I am working on Navio image with preinstalled mavproxy.
Thank you for the answer. I tried it and when I run the service with ExecStart=/usr/local/bin/mavproxy.py…, I get an error ‘No executable found’. I see the Mavproxy is installed in /home/pi/.local/bin/ in the pi. But when I use this path, the service still does not run and the service status says error 203. Is the Mavproxy in your system installed in /usr/local/bin/ ?
Yes, it’s preinstalled.
If in your case its installed in /home/pi seems like you only make installation for user, not root. In this case you could experience problem launching program from different user. Try start mavproxy with sudo, and see whats going on.
Hey, very cool setup here. Is there any way you can use mavproxy interactively after starting it as a service in daemon mode? For instance, checking for a certain parameter and setting it to a desired value via mavproxy once the deamon has started, either manually over ssh or automatically in ExecStartPost.
Hi, what I remember, interacting with systemd can be tricky, if sometimes not possible. If you have some set of settings and params you want to upload and set, you can try mavproxy scripts (https://ardupilot.org/mavproxy/docs/getting_started/mavinit.html). With them you can define all needed variables, params and mavproxy itself.