Skip to content

Deutsch

Step 7: Put the agent on the gateway

Tested on a lab gateway, not on a Yocto image

Steps 7 and 8 are written from test runs on a lab gateway with the signed release cproto-v0.2.0-rc.2, installed by hand. They have not been run on an image built with the Yocto recipe.

Why this step

The gateway needs one small program, the Bootstrap-Agent, to talk to the platform. It runs as one service, proves the gateway's identity with its TPM, fetches the settings from your template, stores them, and calls in regularly, by default once an hour. Your own gateway software is started by your image, not by the agent.

You need

  • The agent on the gateway, one of two ways: in your gateway image, see Install with Yocto and RAUC (for gateways in series), or installed by hand on a single gateway, see Install manually on one gateway. Both pages show how you check the download.
  • A command line on the gateway as the administrator (root), over SSH or a local console.
  • The platform address for gateways, from your support contact.

Do this

All commands run on the gateway, as root.

  1. Tell the agent where the platform is. This creates a small settings file:

    mkdir -p /etc/bootstrap-agent
    
    cat > /etc/bootstrap-agent/agent.env <<'EOF'
    BOOTSTRAP_AGENT_URL=https://bootstrap.ztd.dev.pxdc.io
    BOOTSTRAP_AGENT_TRUST_BUNDLE=
    EOF
    

    Leave BOOTSTRAP_AGENT_TRUST_BUNDLE= empty unless support gave you a file, see Settings.

  2. Restart the agent so it reads the file:

    systemctl restart bootstrap-agent.service
    
  3. Make sure your image starts your gateway software when the configuration is stored, and writes the confirmation marker once it is connected. Both are described in Start your software and confirm.

You should see

The service running, and the agent's state:

systemctl is-active bootstrap-agent.service
curl -s --unix-socket /run/bootstrap-agent/api.sock http://localhost/v1/status

The first command prints active. In the second, "state" is no_config while the platform has not set the gateway up yet, and ready once it has.

If not

If state is error, the fault is on the gateway itself: a missing address, the TPM or the storage. Read the log with journalctl -u bootstrap-agent.service -n 50 and see Troubleshooting.