This repository contains sample scripts to automatically setup nodes for Open Horizon as provided in the IBM Cloud. Detailed [documentation][edge-fabric] for the IBM Cloud Edge Fabric is available on-line. A Slack [channel][edge-slack] is also available. You may create and publish your patterns to your organization. Refer to the examples available on GitHub.
You will need an IBM Cloud account and IBM MessageHub credentials available in the Slack [channel][edge-slack].
A target device or virtual environment is required; either of the following are sufficient.
Download a Debian/Ubuntu image and start a new virtual machine, e.g. using VirtualBox, with the CD/DVD image as the boot device; change networking from NAT
to Bridged
. Note: Install the VirtualBox Extensions Pack. Connect to VM using ssh
or use the GUI to start a Terminal session.
- TX2 - with Ubuntu 18.04 and JetPack 2.3.3/4.1.1
- Nano - with Ubuntu 18.04 and JetPack 4.2
- Xavier - with Ubuntu 18.04 and JetPack 4.2
It is recommended, but not required, to change the default pi
password, as well as identify the device with a unique name for use in testing (e.g. test-arm-1
); run the following commands on the target device:
sudo passwd pi
export DEVICE_NAME=test-arm-1
sudo sed -i "s|raspberrypi|${DEVICE_NAME}|" /etc/hosts
sudo sed -i "s|raspberrypi|${DEVICE_NAME}|" /etc/hostname
sudo hostname ${DEVICE_NAME}
The device will need to be rebooted for the name change to take effect on the LAN; then the device can be referenced by the name, e.g. test-arm-1.local
.
For any Debian-based LINUX environment, e.g. Ubuntu or Raspbian.
If docker
command is not installed, log into the device and run the commands below to install Docker:
wget -qO - get.docker.com | sudo bash
Then run the following commands to install Open Horizon:
wget -qO - ibm.biz/get-horizon | sudo bash
If the device is to be used for development and testing it will need to be configured with the appropriate account, privileges, and change sudo
policy for that user to not require a password. Run the following commands to create a new user:
export USERID=<your-userid>
sudo adduser ${USERID}
Then add the user to both the sudo
and docker
groups:
sudo addgroup ${USERID} sudo
sudo addgroup ${USERID} docker
Finally, change the permissions for the user to enable password-less sudo
with the following commands:
echo "${USERID} ALL=(ALL) NOPASSWD: ALL" > /tmp/nopasswd \
&& sudo chown root /tmp/nopasswd \
&& sudo chmod 400 /tmp/nopasswd \
&& sudo mv /tmp/nopasswd /etc/sudoers.d/010_${USERID}-nopasswd
The development host (e.g. Apple iMac or MacBook) will also need to be configured with SSH credentials (n.b. ~/.ssh/
) which are then copied to the device from the host; run the following command on the development host as <your-userid>
:
ssh-copy-id <device-name>.local
After credentials are established, the device may be used to test services and patterns. Refer to BUILD.md
.
Installations can be automated over the network as new devices are discovered. This technique is suitable for local-area network (LAN) deployments. Please refer to these instructions.
System level installation modifies the operating system image boot sequence to install the Open Horizon software. This technique is suitable for replication in mass quantities. Please refer to these instructions.
Add the repository https://github.com/dcmartin/hassio-addons
to the Add-on Store. Install and start the following addons (n.b. both require MSGHUB_API_KEY
to listen
for Kafka messages):
- cpu2msghub: specifies the IBM published cpu2msghub pattern, which sends CPU load from
/sys/proc
and GPS location to a private Kafka topic; optionally listens to the private Kafka topic and publishes a JSON payload to topickafka/cpu-load
on designated MQTT server, e.g.core-mosquitto
- sdr2msghub: specifies the IBM published sdr2msghub pattern, which sends software-defined-radio (SDR) audio and GPS location to a shared Kafka topic; optionally listens to the shared Kafka topic and publishes a JSON payload to topic
kafka/sdr-audio
on designated MQTT server, e.g.core-mosquitto
- Optional: Converts audio received into text using IBM Watson Speech-to-Text (STT) service.
- Optional: Parses text into language using IBM Natural Language Understanding (NLU) service.
Releases are based on Semantic Versioning, and use the format
of MAJOR.MINOR.PATCH
. In a nutshell, the version will be incremented
based on the following:
MAJOR
: Incompatible or major changes.MINOR
: Backwards-compatible new features and enhancements.PATCH
: Backwards-compatible bugfixes and package updates.
David C Martin ([email protected])