Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,22 @@ password: temppwd
```

### Run program

Run directly
```
sudo ./kpi_rover_ecu -a 0.0.0.0 -p 6000
```

Run like systemd service
```
sudo systemctl start kpi_rover_ecu.service
```

Stop systemd service
```
sudo systemctl stop kpi_rover_ecu.service
```

## Code Style Check and Static Code Analysis

### Importance
Expand Down
4 changes: 4 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ if [ -z "$BBB_HOST" ]; then
fi

# Deploy the software using scp
BBB_HOST_ROOT="${BBB_HOST/debian/root}"

scp build/Target/src/kpi_rover_ecu/kpi_rover_ecu "$BBB_HOST":~
scp system/kpi_rover_ecu.service "$BBB_HOST_ROOT":/etc/systemd/system
ssh "$BBB_HOST_ROOT" 'systemctl daemon-reload'

# Check if scp was successful
if [ $? -eq 0 ]; then
Expand Down
16 changes: 16 additions & 0 deletions system/kpi_rover_ecu.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=KPI Rover ECU Service
After=network.target

[Service]
ExecStart=/home/debian/kpi_rover_ecu -a 0.0.0.0 -p 6000
WorkingDirectory=/home/debian
Restart=always
User=root
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

PermissionsStartOnly=true
ExecStartPre=/bin/sleep 2

[Install]
WantedBy=multi-user.target