Skip to content

Starter scripts to help you get started using EdgeIQ

License

Notifications You must be signed in to change notification settings

nickdwhite/evaluation_kit

 
 

Repository files navigation

EdgeIQ Evaluation Kit

Requirements

Bash scripts are executed from a host, and will use SSH to connect & install the edge software on your gateway device. these scripts can be run from the gateway device itself, but this has not been thoroughly tested.

Setup

Update the setenv.sh file with your

  • EdgeIQ username and password
  • SSH username for your gateway device
  • Your gateway device MAC address and associated IP address
  • Configure EdgeIQ Device Type - defaults to Raspberry Pi 3/4 running recent Debian/Ubuntu linux

Examples

The EdgeIQ local service is installed as a systemd managed service called edge.service so for example you can stop it using this command, sudo systemctl stop edge. The EdgeIQ local service is installed into /opt/edge and log files are located in a day time stamped file, e.g. /opt/edge/log/edge.log.2020-05-18.

Warning: these test scripts do not currently protect against creating duplicate artifacts, nor do they detect if devices are present with the same target Unique ID. EdgeIQ will prevent you from creating duplicate devices with the same unique ID (which is good), however this may cause issues with the correct configuration by the scripts.

Note: you will need to run the cleanup-demo-<timestamp>.sh script between running each example as only one EdgeIQ Device can exist against a single Unique_Id.

Simple Gateway example

Expand In `simple_gateway` subdirectory, run the following commands.
  1. Run create_edgeiq_configuration.sh. This will configure an EdgeIQ Device that can be used to remotely manage your gateway
  2. Run gateway_provision.sh. This will install the EdgeIQ SmartEdge software onto the gateway and associate it with the EdgeIQ Device configured in the previous step.

The create_edgeiq_configuration.sh script will create a cleanup-demo-<timestamp>.sh file that contains API commands to delete EdgeIQ artifacts created by the create script. The cleanup scripts will delete themselves upon successful completion.

There is a helper script query_entities.sh that provides examples of various ways to query artifacts from EdgeIQ.

Gateway with ModBus Sensor Device

Expand This example shows how EdgeIQ can be configured to manage an edge gateway device with a connected Modbus sensor. The sensor data will be forwarded to an HTTP listener. The [`httpprint.py`](gateway_with_modbus_sensor/instance_files/httpprint.py) is an example of such a listener that will print out all HTTP messages that it receives.

Notes:

  • These scripts were tested against the free diagslave Modbus simulator, e.g. diagslave -m tcp.
  • To use the included httpprint.py, you need to have a recent version of Python 3 installed. e.g. python3 httpprint.py
  • To see the httpprint.py output, run on the gateway device, e.g. Raspberry Pi, the following command journalctl -f -all -u httpprint.

In gateway_with_modbus_sensor subdirectory, run the following commands.

  1. Run create_edgeiq_configuration.sh. This will configure an EdgeIQ Device that can be used to remotely manage your gateway
  2. Run gateway_provision.sh. This will install the EdgeIQ SmartEdge software onto the gateway and associate it with the EdgeIQ Device configured in the previous step.

The create_edgeiq_configuration.sh script will create a cleanup-demo-<timestamp>.sh file that contains API commands to delete EdgeIQ artifacts created by the create script. The cleanup scripts will delete themselves upon successful completion.

There are some helper scripts:

  • query_entities.sh provides examples of querying EdgeIQ for specific devices based on unique_id and that have a demo tag. More details on Query parameters here
  • diagslave_install.sh is an example of how to install diagslave Modbus simulator as a systemd service. Must be run as root, e.g., sudo ./diagslave_install.sh. You can then use journalctl -f --all -u diagslave to follow logs. Note the --all options overcomes the [xxB blob data] by converting the binary output from diagslave.

The Modbus sensor/simulator and the HTTP Listener should be running BEFORE running these scripts.

Gateway with Attached ModBus Sensor Device

Expand This example shows how EdgeIQ can be configured to manage an edge gateway device with a connected Modbus sensor. The ModBus sensor is modeled as an attached device to the Gateway device. Otherwise this example is identical to Gateway with ModBus Sensor example. The sensor data will be forwarded to an HTTP listener. The [`httpprint.py`](gateway_with_attached_sensor/instance_files/httpprint.py) is an example of such a listener that will print out all HTTP messages that it receives.

Notes:

  • These scripts were tested against the free diagslave Modbus simulator, e.g. diagslave -m tcp.
  • To use the included httpprint.py, you need to have a recent version of Python 3 installed. e.g. python3 httpprint.py
  • To see the httpprint.py output, run on the gateway device, e.g. Raspberry Pi, the following command journalctl -f -all -u httpprint.

In gateway_with_attached_sensor subdirectory, run the following commands.

  1. Run create_edgeiq_configuration.sh. This will configure an EdgeIQ Device that can be used to remotely manage your gateway
  2. Run gateway_provision.sh. This will install the EdgeIQ SmartEdge software onto the gateway and associate it with the EdgeIQ Device configured in the previous step.

The create_edgeiq_configuration.sh script will create a cleanup-demo-<timestamp>.sh file that contains API commands to delete EdgeIQ artifacts created by the create script. The cleanup scripts will delete themselves upon successful completion.

There are some helper scripts:

  • query_entities.sh provides examples of querying EdgeIQ for specific devices based on unique_id and that have a demo tag. More details on Query parameters here
  • diagslave_install.sh is an example of how to install diagslave Modbus simulator as a systemd service. Must be run as root, e.g., sudo ./diagslave_install.sh. You can then use journalctl -f --all -u diagslave to follow logs. Note the --all options overcomes the [xxB blob data] by converting the binary output from diagslave.

The Modbus sensor/simulator and the HTTP Listener should be running BEFORE running these scripts.

Gateway with Attached SNMP Sensor Device

Expand This example shows how EdgeIQ can be configured to manage an edge gateway device with a connected SNMP sensor. The SNMP sensor is modeled as an attached device to the Gateway device. The sensor data will be forwarded to an HTTP listener. The [`httpprint.py`](gateway_with_attached_sensor_snmp/instance_files/httpprint.py) is an example of such a listener that will print out all HTTP messages that it receives.

Notes:

  • These scripts were tested against the Raspberry Ri Raspian (Raspberry Pi OS) running a gateway local snmpd installed by gateway_provision.sh
  • To use the included httpprint.py, you need to have a recent version of Python 3 installed. e.g. python3 httpprint.py
  • To see the httpprint.py output, run on the gateway device, e.g. Raspberry Pi, the following command journalctl -f -all -u httpprint.

In gateway_with_attached_sensor_snmp subdirectory, run the following commands.

  1. Run create_edgeiq_configuration.sh. This will configure an EdgeIQ Device that can be used to remotely manage your gateway
  2. Run gateway_provision.sh. This will install the EdgeIQ SmartEdge software onto the gateway and associate it with the EdgeIQ Device configured in the previous step.

The create_edgeiq_configuration.sh script will create a cleanup-demo-<timestamp>.sh file that contains API commands to delete EdgeIQ artifacts created by the create script. The cleanup scripts will delete themselves upon successful completion.

There are some helper scripts:

  • query_entities.sh provides examples of querying EdgeIQ for specific devices based on unique_id and that have a demo tag. More details on Query parameters here

Gateway with Attached Ping/Latency Sensor Device Using Shell Polling

Expand This example shows how EdgeIQ can be configured to manage an edge gateway device with a connected latency sensor (i.e. ping a downstream device from the gateway). The latency sensor is modeled as an attached device to the Gateway device, with an attached Ingestor that performs the shell polling.
  1. Run create_edgeiq_configuration.sh. This will configure an EdgeIQ Device for Gateway and Sensor, Device Types for each, Ingestor, Translator, and Policies that can be used to remotely manage your gateway and endpoint devices.
  2. Run gateway_provision.sh. This will install the EdgeIQ SmartEdge software onto the gateway and associate it with the EdgeIQ Device configured in the previous step.

The create_edgeiq_configuration.sh script will create a cleanup-demo-<timestamp>.sh file that contains API commands to delete EdgeIQ artifacts created by the create script. The cleanup scripts will delete themselves upon successful completion.

Gateway with Software Update

Expand This example shows how to create and send a Software Update command in the EdgeIQ platform.
  1. Run create_edgeiq_configuration.sh. This will configure an EdgeIQ Device for Gateway and Sensor, Device Types for each, Ingestor, Translator, and Policies that can be used to remotely manage your gateway and endpoint devices.
  2. Run gateway_provision.sh. This will install the EdgeIQ SmartEdge software onto the gateway and associate it with the EdgeIQ Device configured in the previous step.

The create_edgeiq_configuration.sh script will create a cleanup-demo-<timestamp>.sh file that contains API commands to delete EdgeIQ artifacts created by the create script. The cleanup scripts will delete themselves upon successful completion.

Transferring Escrow Devices

Expand

This example walks through the process to onboard and transfer an Escrow Device. See documentation for workflow details. In this example, 3 accounts are involved: your main account ("MAIN") and two subaccounts ("MFG" and "CUS").

Steps involved:

  1. Run step1_gateway_provision.sh. This will:
  • MAIN: Install the EdgeIQ SmartEdge software onto the gateway`
  • MAIN: Load ESCROW_TOKEN onto device at /opt/escrow_token
  1. Run step2_create_edgeiq_configuration.sh. This will:
  • MAIN: Create two company subaccounts under your account: "Demo MFG" and "Demo CUS"
  • MAIN: Create a User for each subaccount with randomly generated passwords
  • MFG: Create Device Type
  • MFG: Create Escrow Device
  • MFG: Create Device Transfer Request
  • MFG: Issue Transfer Request
  • CUS: Accept Transfer Request & copy Device Type from MFG
  • CUS: Create Software Update & execute on device using CUS credentials

The create_edgeiq_configuration.sh script will create a cleanup-demo-<timestamp>.sh file that contains API commands to delete EdgeIQ artifacts created by the create script. The cleanup scripts will delete themselves upon successful completion.

About

Starter scripts to help you get started using EdgeIQ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 96.5%
  • Python 3.5%