- 다음 파일을 /home/agx 디렉토리에 복사
- mavproxy.service, run-mavproxy.sh, mavproxy.sh
mavproxy.service
# /lib/systemd/system/mavproxy.service
[Unit]
Description=PX4 TELEM2 MAP TO UDP 14550
Wants=network-online.target
After=network-online.target
StartLimitIntervalSec=0
[Service]
Type=oneshot
RemainAfterExit=yes
#Type=simple
ExecStartPre=
ExecStart=/home/agx/run-mavproxy.sh
ExecStartPost=
#ExecStop=
ExecStop=/usr/bin/tmux kill-server
ExecReload=
#Restart=on-failure
User=agx
KillMode=none
[Install]
WantedBy=multi-user.targeta
run-mavproxy.sh
#!/bin/bash
tmux new-session -d -s agx 'cd /home/agx; ./mavproxy.sh'
mavproxy.sh
#!/bin/bash
sleep 10
sudo chgrp dialout /dev/ttyTHS0
sudo chmod 770 /dev/ttyTHS0
/usr/bin/python3 $HOME/.local/bin/mavproxy.py --master=/dev/ttyTHS0 --baudrate 921600 --out=udpin:0.0.0.0:14550 --daemon
- mavproxy 설치
sudo apt-get install python3-dev python3-opencv python3-wxgtk4.0 python3-pip python3-matplotlib python-pygame python-serial python3-lxml libxml2-dev libxslt-dev tmux git -y
pip3 install PyYAML mavproxy --user
sudo adduser $USER dialout
echo "%$USER ALL=NOPASSWD: ALL" | sudo tee -a /etc/sudoers
- mavproxy 자동 실행 서비스 설치
sudo cp mavproxy.service /lib/systemd/system/mavproxy.service
sudo systemctl daemon-reload
sudo systemctl enable mavproxy.service
sudo systemctl start mavproxy.service
sudo systemctl status mavproxy.service
- 부팅 후 mavproxy 실행 확인
다음 명령을 실행하여 mavproxy 프로세스가 실행 중인지 확인
ps aux |grep mavproxy