IoT

Build the ForgeRock IoT Gateway

ForgeRock doesn’t provide binaries for the IoT Gateway. There are simply too many operating system and architecture combinations to support. The IoT Gateway and the IoT SDK are developed in the Go programming language primarily because it has easy build tooling and good support for cross-compilation to target systems.

Build the IoT Gateway on a target system

  1. On your target system, go to the gateway directory:

    cd /path/to/iot-edge/cmd/gateway
  2. Build the IoT Gateway binary:

    go build -o ./bin/gateway .

    The IoT Gateway binary is now available at bin/gateway

  3. Run the IoT Gateway with the --help flag for available command-line options:

    ./bin/gateway --help
    Usage:
      gateway [OPTIONS]
    
    Application Options:
          --url=      AM URL
          --realm=    AM Realm
          --audience= JWT Audience
          --tree=     Authentication tree
          --name=     Gateway name
          --address=  CoAP Address of Gateway
          --key=      The file containing the Gateway's signing key
          --kid=      The Gateway's signing key ID
          --cert=     The file containing the Gateway's certificate
          --timeout=  Timeout for AM communications (default: 5s)
      -d, --debug     Switch on debug
    
    Help Options:
      -h, --help      Show this help message

Cross-compile the IoT Gateway for a target system

You can specify a target system with a combination of the $GOOS and $GOARCH environment variables. This lets you build the IoT Gateway for a variety of operating system and architecture combinations.

This example runs the IoT Gateway on an arm 32-bit processor (for example, a Raspberry Pi 3 running in 32-bit mode).

  1. Build the IoT Gateway for linux/arm, as follows:

    GOOS=linux GOARCH=arm go build -o ./bin/linux_arm/gateway .
  2. For a complete list of environment and cross-compilation targets, refer to the go Documentation.

    For more build options, refer to the go command environment variables.

Copyright © 2010-2023 ForgeRock, all rights reserved.