Packet Broker Getting Started Commands

Getting Started

    Overview
  • Quick Start
  • What Is Packet Broker?
  • Network Configuration
  • Command-Line Interface
    • Installation
    • Configuration
    • Networks and Tenants
    • Routing Policies
    • Reports
    • Test Traffic
  • Terminology
  • API

Test Traffic

You can subscribe to Packet Broker traffic flows to test is everything works correctly. Likewise, you can publish test traffic as if you were a Forwarder or Home Network.

Publish and Subscribe to Traffic

To subscribe to traffic, use the pbsub tool. For example, to subscribe to routed downlink traffic as network, tenant, and with or without named cluster:

$ pbsub --forwarder-net-id 000042 --group debug
$ pbsub --forwarder-net-id 000042 --forwarder-tenant-id tenant-a --group debug
$ pbsub --forwarder-net-id 000042 --forwarder-cluster-id eu1 --group debug
$ pbsub --forwarder-net-id 000042 --forwarder-tenant-id tenant-a \
    --forwarder-cluster-id eu1 --group debug

To subscribe to traffic, use pbsub. For example, to subscribe to routed uplink traffic as network, tenant, and with or without named cluster:

$ pbsub --home-network-net-id 000042 --group debug
$ pbsub --home-network-net-id 000042 --home-network-tenant-id tenant-a --group debug
$ pbsub --home-network-net-id 000042 --home-network-cluster-id eu1 --group debug
$ pbsub --home-network-net-id 000042 --home-network-tenant-id tenant-a \
    --home-network-cluster-id eu1 --group debug

Important: When using pbsub, specify a shared subscription group that is different from the group used in production. Otherwise, traffic gets split to your production subscriptions and your testing subscriptions.

To publish an uplink message in uplink.json as Forwarder network, tenant, and with or without named cluster:

$ pbpub --forwarder-net-id 000042 < uplink.json
$ pbpub --forwarder-net-id 000042 --forwarder-tenant-id tenant-a < uplink.json
$ pbpub --forwarder-net-id 000042 --forwarder-cluster-id eu1 < uplink.json
$ pbpub --forwarder-net-id 000042 --forwarder-tenant-id tenant-a \
    --forwarder-cluster-id eu1 < uplink.json
Show an example uplink.json
{
  "gatewayId": {
    "eui": "1234605616436508552",
    "plain": "my-gateway"
  },
  "phyPayload": {
    "teaser": {
      "hash": "SFDudlmz+5nnIEppPoocAYQtauhCubioxqpl9sIHoG4=",
      "mac": {
        "confirmed": false,
        "devAddr": 648675328,
        "fOpts": false,
        "fCnt": 35449,
        "fPort": 5,
        "frmPayloadLength": 16
      }
    },
    "plain": "QALNATCAeYoF9HfprTT/AMmv8KC2cn0GqGgQIDg="
  },
  "forwarderReceiveTime": "2020-01-24T16:46:01Z",
  "gatewayReceiveTime": "2020-01-24T16:46:00Z",
  "gatewayRegion": "EU_863_870",
  "dataRate": {
    "lora": {
      "spreadingFactor": 7,
      "bandwidth": 125000,
      "codingRate": "4/5"
    }
  },
  "frequency": 868100000,
  "gatewayMetadata": {
    "teaser": {
      "terrestrial": {
        "fineTimestamp": false
      }
    },
    "plainSignalQuality": {
      "terrestrial": {
        "antennas": [
          {
            "index": 0,
            "value": {
              "channelRssi": -125.2,
              "signalRssi": -121.5,
              "rssiStandardDeviation": 5.6,
              "snr": 10.5,
              "frequencyOffset": -5
            }
          }
        ]
      }
    },
    "plainLocalization": {
      "terrestrial": {
        "antennas": [
          {
            "index": 0,
            "location": {
              "latitude": 52.5464,
              "longitude": 4.8521,
              "altitude": 15.6,
              "accuracy": 3
            },
            "signalQuality": {
              "channelRssi": -125.2,
              "signalRssi": -121.5,
              "rssiStandardDeviation": 5.6,
              "snr": 10.5,
              "frequencyOffset": -5
            }
          }
        ]
      }
    }
  },
  "forwarderUplinkToken": "AQID",
  "gatewayUplinkToken": "AQID"
}

To publish a downlink message in downlink.json, as Home Network network, tenant, and with or without named cluster:

$ pbpub --home-network-net-id 000042 < downlink.json
$ pbpub --home-network-net-id 000042 --home-network-tenant-id tenant-a < downlink.json
$ pbpub --home-network-net-id 000042 --home-network-cluster-id eu1 < downlink.json
$ pbpub --home-network-net-id 000042 --home-network-tenant-id tenant-a \
    --home-network-cluster-id eu1 < downlink.json
Show an example downlink.json
{
  "region": "EU_863_870",
  "phyPayload": "YJNnjgCAJwAinVl6k6U=",
  "rx1": {
    "frequency": "868100000",
    "dataRate": {
      "lora": {
        "spreadingFactor": 7,
        "bandwidth": 125000
      }
    }
  },
  "rx2": {
    "frequency": "869525000",
    "dataRate": {
      "lora": {
        "spreadingFactor": 12,
        "bandwidth": 125000
      }
    }
  },
  "rx1Delay": "5s",
  "class": "CLASS_A",
  "forwarderUplinkToken": "AQID",
  "gatewayUplinkToken": "AQID",
  "priority": "NORMAL"
}
← Reports Terminology →

On this page

  • Publish and Subscribe to Traffic

Packet Broker

Packet Broker

Getting Started

Commands

About Us

The Things Network

The Things Industries

About this page

Last changed on 01 Jan 0001.