Installation Using Manual Method

This article explains the steps and commands necessary to install the Edge local service manually.

📘

Note

The manual install process should only be a last resort if your device does not fulfill the requirements needed for an installation using edgectl. In all other cases using edgectl is much faster and less error-prone.

Step 1 - Change folders to the /opt directory. If you need to install to a custom location, replace /opt with your location.

cd /opt

Step 2 - Download the edge-assets package.

wget --max-redirect=10 http://api.edgeiq.io/api/v1/platform/downloads/latest/edge-assets-latest.tar.gz

📘

Note

BusyBox replaces wget in some environments with a compact implementation of its own, which does not support all the security features and options such as https redirects.

Step 3 - Extract the archive. You should see an edge folder inside the /opt folder.

tar -zxvf edge-assets-latest.tar.gz

Step 4 - Download the edge binary and make an executable.

Options for device architecture are: arm5, armhf, arm64, arm7, or amd64.

wget --max-redirect=10 http://api.edgeiq.io/api/v1/platform/downloads/latest/edge-linux-[YOUR_DEVICE_ARCHITECTURE]-latest -O ./edge/edge && chmod +x ./edge/edge

📘

Note

BusyBox replaces wget in some environments with a compact implementation of its own, which does not support all the security features and options such as https redirects.

Step 5 - Change to the edge directory and remove the default conf files.

cd ./edge
rm ./conf/bootstrap.json ./conf/conf.json

Step 6 - Create new json config files using the following commands (example configuration).

cat >./conf/bootstrap.json <<EOF
{
  "company_id": "[YOUR_ORGACCOUNT_ID]",
  "identifier_filepath": "/opt/edge/conf/id.json",
  "platform": "",
  "init_system": "",
  "network_configurer": "",
  "local": false,
  "install_dir": "/opt",
  "network_configuror": ""
}
EOF
cat >./conf/conf.json <<EOF
  {
  "edge": {
    "manufacturer": "generic",
    "model": "linux",
"company":"[YOUR_ORGACCOUNT_ID]",
    "env": "prod",
    "local": false,
    "bypass_and_relay": false,
    "init_system": "systemd",
    "identifier_path": "/opt/edgeiq_bootstrap.json",
    "ui_port": 9001,
    "api_port": 9000
  },
  "mqtt": {
    "broker": {
      "protocol": "ssl",
      "host": "mqtt.ms-io.com",
      "port": "443",
      "password": "Dmn2LKZNcYSBd1PAbRMcmEKBG8EDpRjxc0BB5A==",
      "escrow_token_path": "/opt/escrow_token"
    },
    "topics": {
      "upstream": {
        "report": "reports",
        "heartbeat": "reports/hb",
        "config": "config",
        "action": "action",
        "new_version": "new_version",
        "lwt": "lwt",
        "status": "status",
        "log": "logs",
        "gateway_command_status": "gateway_command_status",
        "deployment_status": "deployment_status",
        "error": "error",
        "escrow_request": "escrow_request"
      },
      "downstream": {
        "config": "config",
        "command": "commands",
        "new_version": "new_version",
        "gateway_command": "gateway_commands",
        "escrow": "escrow"
      }
    }
  },
  "platform": {
    "url": "https://api.edgeiq.io/api/v1/platform/"
  },
  "aws": {
    "greengrass": {
      "heartbeat_port": 9002
    }
  }
}
EOF

Step 7 - Start edge manually

Option A: Use MAC address as unique device id

By default, edge will use the MAC address of the device as the unique device id, so please make sure to create a corresponding device in the portal first. You can then start edge like this:

./edge

Option B: Specify company id and/or unique device id

To test edge with a specific company id or unique device id, you can specify both via environment variables, like this:

EDGE_COMPANY=your-company EDGE_UNIQUE_ID=your-unique-device-id ./edge

Option C: Create an identity file

For a more permanent solution, you can create an identity file to specify these parameters:

cat >./conf/id.json <<EOF
{
  "company_id": "[company-id]",
  "unique_id": "[unique_device_id]"
}
EOF

At this point edge should start up and after a few seconds pull down an updated configuration. If you receive an error, please copy and paste it into a support ticket or send it to [email protected].