Installing the weeve Agent
A step-by-step guide to installing the weeve agent.
The weeve Agent is the edge software that is responsible for executing the deployed Edge Applications. It can be installed on edge hardware like gateways, industrial computers or smart machines and turns them into weeve Edge—Nodes, a manageable asset in the weeve Manager. The minimal requirements for hardware and operating system to run the weeve Agent are the following and include a working connection to the internet.
Before starting with the installation process it is recommended to get to know the hardware and software requirements for the weeve agent.

Quick-start

Using weeve Agent installer

Before you can run the weeve Agent installer, you need to create a file named .weeve-agent-secret and add your GitHub access token to this file. When you generate your token, the scope to read the repos is enough.
1
sudo nano .weeve-agent-secret
Copied!

weeve Agent installer & un-installer

1
curl -s https://raw.githubusercontent.com/weeveiot/weeve-agent-installer/main/weeve-agent-installer.sh | sudo sh -s NodeName=<name of the node>
Copied!
1
curl -s https://raw.githubusercontent.com/weeveiot/weeve-agent-installer/main/weeve-agent-uninstaller.sh
Copied!

Manual installation

Pre-installation process [ specific to Debian-based ]

For RedHat-based distributions checkout this section before starting the process
  1. 1.
    Create a new directory mkdir weeve-agent where all the weeve Agent related contents would go, follow the steps with that in mind.
  2. 2.
    Grab the weeve Agent binary from our GitHub repository https://github.com/weeveiot/weeve-agent-binaries and change the permission for the binary to make it executable chmod u+x <name-of-the-binary> .
  3. 3.
    Create a file named "nodeconfig.json" nano nodeconfig.json with the following content: { "AWSRootCert": "", "Certificate": "", "PrivateKey": "", "NodeId": "", "NodeName": "" } and update the name of the certificates and node ( make sure the name of the node is unique for easy identification in weeve Manager), while the id of the node can be left empty.
  4. 4.
    Have all the bootstrap certificates within the directory.
At this point, the binary can be executed as such, with the proper CLI arguments mentioned below. Not the recommended method.

Creating and running systemd service

  1. 1.
    Create a file named "weeve-agent.argconf" in the specific path "/lib/systemd/system" sudo nano /lib/systemd/system/weeve-agent.argconf with the following content: ARG_VERBOSE=-v ARG_BROKER=--broker tls://asnhp33z3nubs-ats.iot.us-east-1.amazonaws.com:8883 ARG_SUB_CLIENT=--subClientId nodes/awsdev ARG_PUB_CLIENT=--pubClientId manager/awsdev ARG_PUBLISH=--publish status ARG_HEARTBEAT=--heartbeat 150 these are the default arguments for the weeve Agent.
  2. 2.
    Create a file named "weeve-agent.service" in the specific path "/lib/systemd/system" sudo nano /lib/systemd/system/weeve-agent.service with the following content: [Unit] Description=Weeve Agent [Install] WantedBy=multi-user.target [Service] Type=simple Restart=always RestartSec=60s EnvironmentFile=/lib/systemd/system/weeve-agent.argconf WorkingDirectory=<path-to-newly-created-directory-for-the-weeve-agent> ExecStart=<path-to-the-binary-of-the-weeve-agent> $ARG_VERBOSE $ARG_BROKER $ARG_SUB_CLIENT $ARG_PUB_CLIENT $ARG_PUBLISH $ARG_HEARTBEAT
  3. 3.
    Enable the weeve Agent systemd service to start at start-up sudo systemctl enable weeve-agent.service.
  4. 4.
    Start the weeve agent sudo systemctl start weeve-agent.service.

Pre-installation process tweaks for RedHat based distributions

  • binary and dependencies should go in this specific path /usr/local/bin
  • Enable docker on start-up systemctl enable docker
  • Following commands are to add rule to SELinux, allowing the binary to be executed: sudo ausearch -c '(ux_amd64)' --raw | audit2allow -M my-uxamd64 sudo semodule -X 300 -i my-uxamd64.pp
  • Following command is to change permissions of the specific directory: /sbin/restorecon -v /usr/local/bin/<name-of-the-binary>

weeve Agent CLI arguments

Arguments
Short
Required
Description
Default
verbose
v
false
Show verbose debug information
broker
b
true
Broker to connect
pubClientId
c
true
Publisher ClientId
subClientId
s
true
Subscriber ClientId
publish
t
true
Topic Name
heartbeat
h
false
Heartbeat time in seconds
30
mqttlogs
m
false
For developer - Display detailed MQTT logging messages
notls
false
For developer - disable TLS for MQTT
loglevel
l
false
Set the logging level
info
logfilename
false
Set the name of the log file
logs
logsize
false
Set the size of each log files (MB)
1
logage
false
Set the time period to retain the log files (days)
1
logbackup
false
Set the max number of log files to retain
5
logcompress
false
To compress the log files
nodeId
i
false
ID of this node
register
name
n
false
Name of this node to be registered
rootcert
r
false
Path to MQTT broker (server) certificate
cert
f
false
Path to certificate to authenticate to Broker
key
k
false
Path to private key to authenticate to Broker
config
false
Path to the .json config file