Created
July 30, 2018 21:56
-
-
Save svet-b/7d22803917b99a24b8021566920b466a to your computer and use it in GitHub Desktop.
Set up AMMP-edge without snapd
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
# Ensure that package dependencies are met (specifically python3, libsnmp-dev, and python3-netifaces) | |
# Create user under which software will be run. | |
# Enter user directory. In this example this is /opt/datalog | |
# Pull the codebade | |
git clone https://github.com/ammpio/ammp-edge.git | |
# Install python package | |
cd ammp-edge | |
./setup.py install --user | |
# One of the lines should be as follows: | |
# > Installing ammp_edge script to /opt/datalog/.local/bin | |
# After that one, dependencies will be installed | |
# Make some required symlinks to configuration and driver files | |
cd .. | |
ln -s ammp-edge/remote.yml | |
ln -s ammp-edge/drivers/ | |
# Also expose the executable (now in /opt/datalog/bin/ammp_edge) | |
ln -s .local/bin/ | |
# Create a service that will run the software. Put the following text in a new file | |
# /etc/systemd/system/ammp-edge.service | |
### Start | |
[Unit] | |
Description=AMMP-edge datalogging service | |
Documentation=https://www.ammp.io/ | |
After=network-online.target | |
[Service] | |
ExecStart=/opt/datalog/bin/ammp_edge -d | |
Restart=always | |
WorkingDirectory=/opt/datalog | |
User=datalog | |
TimeoutStopSec=30 | |
Type=simple | |
[Install] | |
WantedBy=multi-user.target | |
### End | |
# (you can remove the -d from ExecStart if you don't want debug info) | |
# Enable the service with | |
sudo systemctl enable ammp-edge.service | |
# Start with | |
sudo systemctl start ammp-edge.service | |
# Check logs | |
sudo journalctl -u ammp-edge.service -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment