Skip to content

Commit

Permalink
Added systemd service file.
Browse files Browse the repository at this point in the history
  • Loading branch information
croadfeldt committed Sep 26, 2017
1 parent 0c8b4e2 commit 41d06c5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
Expand Down Expand Up @@ -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

<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">BeagleBone Blue ArduPilot</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/mirkix" property="cc:attributionName" rel="cc:attributionURL">Mirko Denecke</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
Expand Down

0 comments on commit 41d06c5

Please sign in to comment.