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.
bash
- version 4.x or newercurl
- tested against curl version 7.64.1jq
- tested against version 1.6. See: https://stedolan.github.io/jq
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
- EdgeIQ Portal: https://app.edgeiq.io
- EdgeIQ API Base URL: https://api.edgeiq.io/api/v1/platform
- EdgeIQ Documentation: https://dev.edgeiq.io/
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
.
Expand
In `simple_gateway` subdirectory, run the following commands.- Run
create_edgeiq_configuration.sh
. This will configure an EdgeIQ Device that can be used to remotely manage your gateway - 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.
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 commandjournalctl -f -all -u httpprint
.
In gateway_with_modbus_sensor
subdirectory, run the following commands.
- Run
create_edgeiq_configuration.sh
. This will configure an EdgeIQ Device that can be used to remotely manage your gateway - 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 onunique_id
and that have ademo
tag. More details on Query parameters herediagslave_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 usejournalctl -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.
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 commandjournalctl -f -all -u httpprint
.
In gateway_with_attached_sensor
subdirectory, run the following commands.
- Run
create_edgeiq_configuration.sh
. This will configure an EdgeIQ Device that can be used to remotely manage your gateway - 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 onunique_id
and that have ademo
tag. More details on Query parameters herediagslave_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 usejournalctl -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.
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 bygateway_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 commandjournalctl -f -all -u httpprint
.
In gateway_with_attached_sensor_snmp
subdirectory, run the following commands.
- Run
create_edgeiq_configuration.sh
. This will configure an EdgeIQ Device that can be used to remotely manage your gateway - 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 onunique_id
and that have ademo
tag. More details on Query parameters here
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.- 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. - 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.
Expand
This example shows how to create and send a Software Update command in the EdgeIQ platform.- 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. - 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.
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:
- 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
- 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.