From 41d06c54db1c9a1037fac258cc1a2b32aecae8ea Mon Sep 17 00:00:00 2001 From: Chris Roadfeldt Date: Tue, 26 Sep 2017 02:14:40 +0000 Subject: [PATCH] Added systemd service file. --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 2218144..c748553 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ Example: MAVLink groundstation via radio connected to UART4 and GPS connected to If ArduCopter should start automatically at boot time follow the instructions below: +SYS V init based startup + Edit `/etc/rc.local` with `sudo nano /etc/rc.local` Modify file to: ``` @@ -100,6 +102,33 @@ exit 0 2. Exit nano: `Strg + x` 3. Reboot BegaleBone with `sudo reboot` +Systemd based startup, useful with arducopter packages from debian/rcnee repo. + +Edit systemd startup vi with vi command below, or use sudo nano command from above + +sudo vi /lib/systemd/system/arducopter.service + +Replace contents of service file with below. Use ESC, then :wq to exit. + +[Unit] +Description=ArduCopter Service +After=networking.service +Conflicts=arduplane.service ardupilot.service ardurover.service + +[Service] +EnvironmentFile=/etc/default/arducopter +ExecStartPre=/bin/bash -c "/bin/echo uart > /sys/devices/platform/ocp/ocp:P9_21_pinmux/state" +ExecStartPre=/bin/bash -c "/bin/echo uart > /sys/devices/platform/ocp/ocp:P9_22_pinmux/state" +ExecStartPre=/bin/bash -c "/bin/echo uart > /sys/devices/platform/ocp/ocp:P9_24_pinmux/state" +ExecStartPre=/bin/bash -c "/bin/echo uart > /sys/devices/platform/ocp/ocp:P9_26_pinmux/state" +ExecStartPre=/bin/bash -c "/bin/echo pruecapin_pu > /sys/devices/platform/ocp/ocp:P8_15_pinmux/state" +ExecStart=/usr/bin/ardupilot/blue-arducopter $TELEM1 $TELEM2 $GPS + +Restart=on-failure + +[Install] +WantedBy=multi-user.target + # License Creative Commons License
BeagleBone Blue ArduPilot by Mirko Denecke is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.