Skip to content

Instantly share code, notes, and snippets.

View reubenmiller's full-sized avatar

Reuben Miller reubenmiller

  • Hamburg, Germany
View GitHub Profile
@reubenmiller
reubenmiller / MULTI_TEDGE_AGENTS.md
Created August 21, 2025 13:15
thin-edge.io running multiple tedge-agent instances on a single device

Running a new tedge-agent instance to manage a child device

  1. Create systemd service template definition

    cat <<EOT > /lib/systemd/system/[email protected] 
    [Unit]
    Description=tedge-agent (device/%i//) is a thin-edge.io component to support operations.
    After=syslog.target network.target mosquitto.service
@reubenmiller
reubenmiller / tedge-tenant-migration-basic-auth.md
Created August 15, 2025 08:29
thin-edge.io tenant migration steps

Migrating thin-edge.io to a new Tenant with Basic Auth

  1. On 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}}, '')"
@reubenmiller
reubenmiller / UBUNTU_24.04.md
Created July 21, 2025 14:55
Yocto setup script

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
@reubenmiller
reubenmiller / config-minimal.yaml
Last active May 26, 2025 13:55
thin-edge.io Yocto Kirkstone minimal example (using Kas)
# 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: |
@reubenmiller
reubenmiller / TEDGE_ALPINE_LINUX_DEVICE.md
Last active March 5, 2025 19:10
How to get thin-edge.io working on a Raspberry Pi device running Alpine Linux

Running thin-edge.io on Alpine Linux on a Raspberry Pi

  1. Flash the latest Raspberry Pi alpine linux image to the SD CARD. See Alpine's Documentation for details

  2. 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)

  3. 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)

@reubenmiller
reubenmiller / TEDGE_CUSTOM_MQTT_KEEPALIVE.md
Created January 16, 2025 09:23
Setting a custom MQTT keep-alive interval using thin-edge.io and mosquitto

Set custom MQTT keep-alive value

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.

  1. Stop all thin-edge.io related services

    tedge disconnect c8y
    systemctl stop tedge-agent
@reubenmiller
reubenmiller / c8y-proxycommand.md
Created January 13, 2025 12:08
go-c8y-cli example on using ssh to forward a port from a device connected to Cumulocity using thin-edge.io
  1. Append the ssh config to your machine's ssh config file

    The following snippet creates

    cat <<EOT >> ~/.ssh/config
    Host rpi5-d83addab8e9f
            User root
            PreferredAuthentications publickey

IdentityFile ~/.ssh/id_ed25519

@reubenmiller
reubenmiller / nanomq.conf
Created October 16, 2024 14:20
Example nanomq configuration
# NanoMQ Configuration 0.18.0
#============================================================
# NanoMQ Broker
#============================================================
system {
daemon = false
num_taskq_thread = 0
max_taskq_thread = 0
parallel = 0
}

README

Create a custom operation which will map the operation to a thin-edge.io workflow (operation).

Pre-requisites

The following components must be installed for the scripts to work.

  • jq
  • tedge (>= 1.3.1-88-g09c1d4c)
@reubenmiller
reubenmiller / README.md
Created October 15, 2024 19:25
Building nanomq on MacOS

Building nanomq on MacOS

Pre-requisite

Install Xcode and accept the license

Building

export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)