The following instructions detail how to connect to Cumulocity and the MQTT Service (i.e. port 9883) from a device.
Pre-requisites
The following pre-requisites are
- bash (or zsh)
- go-c8y-cli and an active go-c8y-cli session
The following instructions detail how to connect to Cumulocity and the MQTT Service (i.e. port 9883) from a device.
Pre-requisites
The following pre-requisites are
This describes how to migrate a tedge-standalone installation which is connected to Cumulocity using BASIC AUTH (e.g. username/password) to a new tenant.
The migration script does the following steps:
The following instructions can be used to configure the wayvnc service so that it is compatible with the Cumulocity VNC viewer. These instructions will disable the authorization, however to keep the setup secure, it will only establish a listener on localhost (127.0.0.1) which will not allow other devices/services/applications in the network to connect to it.
Create systemd service template definition
cat <<EOT > /lib/systemd/system/tedge-agent@.service
[Unit]
Description=tedge-agent (device/%i//) is a thin-edge.io component to support operations.
After=syslog.target network.target mosquitto.serviceOn your computer, register the device in Cumulocity using the bulk registration api to create a username/password for the device.
c8y deviceregistration register-basic \
--id tedge-flows-demo2 \
--outputTemplate "std.manifestTomlEx({c8y:{username: output.username, password: output.password}}, '')"Install Yocto and dependencies
sudo apt-get update
sudo apt install -y build-essential chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 liblz4-tool locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd kas
if ! locale --all-locales | grep -q en_US.utf8; then
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
sudo locale-gen
fi
| # yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/66261547b75885786777a0b9c8a4400ab81d432e/kas/schema-kas.json | |
| header: | |
| version: 14 | |
| bblayers_conf_header: | |
| meta-minimal: | | |
| POKY_BBLAYERS_CONF_VERSION = "2" | |
| local_conf_header: | |
| meta-minimal: | |
Flash the latest Raspberry Pi alpine linux image to the SD CARD. See Alpine's Documentation for details
Remount the sd hard on your computer (as you'll be adding some additional files to it before the SD card is inserted into your Raspberry Pi)
Download the headless.apkovl.tar.gz file from the alpine-linux-headless-bootstrap repo and add it to the to the root folder of the mounted sd card (e.g. the FAT partition).
Note: You don't need to extract the headless.apkovl.tar.gz file, just place it there (there is a magic service which will execute it on boot)
Warning: If you run tedge reconnect c8y or tedge connect c8y, you will need to re-edit the c8y-bridge.conf file again (as it is auto generated). thin-edge.io will be added support to configure this value, but it hasn't been implemented yet, see issues/3153.
Stop all thin-edge.io related services
tedge disconnect c8y
systemctl stop tedge-agentAppend the ssh config to your machine's ssh config file
The following snippet creates
cat <<EOT >> ~/.ssh/config
Host rpi5-d83addab8e9f
User root
PreferredAuthentications publickeyIdentityFile ~/.ssh/id_ed25519