forked from jeroends/velserv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
mkdir /opt/velserv | ||
cd /opt/velserv | ||
wget http://www.mdar.co.uk/dl/velserv1.5.zip | ||
apt install gcc unzip | ||
unzip velserv1.5.zip | ||
ln -s /opt/velserv/velserv.service /etc/systemd/system/velserv.service | ||
|
||
gcc -o velserv velserv.c -lpthread | ||
|
||
systemctl daemon-reload | ||
systemctl enable velsev.service | ||
systemctl start velserv.service | ||
systemctl status velserv | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file is part of systemd. | ||
# | ||
# systemd is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation; either version 2.1 of the License, or | ||
# (at your option) any later version. | ||
|
||
# This unit gets pulled automatically into multi-user.target by | ||
# systemd-rc-local-generator if /etc/rc.local is executable. | ||
[Unit] | ||
Description=Velserv | ||
ConditionFileIsExecutable=/opt/velserv/velserv | ||
After=network.target | ||
After=network-online.target | ||
|
||
[Service] | ||
Type=forking | ||
ExecStart=/opt/velserv/velserv -d /dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00 -p 6000 | ||
#ExecStart=/opt/velserv/velserv -d /dev/ttyACM0 -p 6000 | ||
ExecStartPost=/bin/bash -c "/bin/touch /var/log/velserv.log" | ||
ExecStartPost=/bin/bash -c "/bin/echo Velserv Started $(date) >> /var/log/velserv.log" | ||
ExecStartPost=/bin/bash -c "/bin/pidof velserv >> /var/log/velserv.log" | ||
ExecStop=/bin/kill $MAINPID | ||
TimeoutSec=0 | ||
RemainAfterExit=yes | ||
StandardOutput=journal+console | ||
StandardError=journal+console | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cd /opt/velserv | ||
./velserv -d /dev/ttyACM0 -p 6000 | ||
|
||
# verbose output, add or remove v at end for different levels of output | ||
# can be run without any switches. ./velserv | ||
#sudo sh ./velserv -d /dev/ttyACM0 -p 6000 -vvvvvv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
sudo mkdir /opt/velserv | ||
cd /opt/velserv | ||
sudo wget http://www.mdar.co.uk/dl/velserv1.5.zip | ||
sudo apt-get install gcc unzip build-essential | ||
sudo unzip velserv1.5.zip | ||
sudo gcc -o velserv velserv.c -lpthread | ||
sudo ln -s /opt/velserv/velserv.service /etc/systemd/system/velserv.service | ||
sudo systemctl daemon-reload | ||
sudo systemctl enable velserv.service | ||
sudo systemctl start velserv.service | ||
systemctl status velserv |