apiVersion: v1
kind: ConfigMap
metadata:
  name: chirpstack-simulator
  labels:
    app: chirpstack-simulator
data:
  chirpstack-simulator.toml: |
    [general]
    # Log level
    #
    # debug=5, info=4, warning=3, error=2, fatal=1, panic=0
    log_level=4


    # Application Server configuration.
    [application_server]

      # API configuration.
      #
      # This configuration is used to automatically create the:
      #   * Device profile
      #   * Gateways
      #   * Application
      #   * Devices
      [application_server.api]

      # JWT token.
      #
      # The JWT token to connect to the ChirpStack Application Server API. This
      # token can be generated using the login API endpoint. In the near-future
      # it will be possible to generate these tokens within the web-interface:
      # https://github.com/brocaar/chirpstack-application-server/pull/421
      jwt_token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcGlfa2V5X2lkIjoiNmViNWQxOTItMTIyYi00ZjExLWJjMmUtYWZjMjIwMDg0NTQ0IiwiYXVkIjoiYXMiLCJpc3MiOiJhcyIsIm5iZiI6MTYwOTk4MzkzMSwic3ViIjoiYXBpX2tleSJ9.BJGF5UMLKTXvw81rPUk8gVb-eRXwGw2UlYIPBqnV82k"

      # Server.
      #
      # This must point to the external API server of the ChirpStack Application
      # Server. When the server is running on the same machine, keep this to the
      # default value.
      # server="https://chirpstack-us915.v2dev.vutiliti.io"
      server="chirpstack-application-server:443"

      # Insecure.
      #
      # Set this to true when the endpoint is not using TLS.
      # insecure=false
      insecure=true


      # MQTT integration configuration.
      #
      # This integration is used for counting the number of uplinks that are
      # published by the ChirpStack Application Server integration.
      [application_server.integration.mqtt]

      # MQTT server.
      server="tcp://mosquitto:1883"

      # Username.
      username=""

      # Password.
      password=""


    # Network Server configuration.
    #
    # This configuration is used to simulate LoRa gateways using the MQTT gateway
    # backend.
    [network_server]

      # MQTT gateway backend.
      [network_server.gateway.backend.mqtt]

      # MQTT server.
      server="tcp://mosquitto:1883"

      # Username.
      username=""

      # Password.
      password=""


    # Simulator configuration.

    # Example:
    [[simulator]]

    # Service-profile ID.
    #
    # It is recommended to create a new organization with a new service-profile
    # in the ChirpStack Application Server.
    service_profile_id="207510a5-d8a0-4281-a781-ecaf04bd5930"

    # Duration.
    #
    # This defines the duration of the simulation. If set to '0s', the simulation
    # will run until terminated. This includes the activation time.
    duration="5m"

    # Activation time.
    #
    # This is the time that the simulator takes to activate the devices. This
    # value must be less than the simulator duration.
    activation_time="10s"

      # Device configuration.
      [simulator.device]

      # Number of devices to simulate.
      count=10

      # Uplink interval.
      uplink_interval="30s"

      # FPort.
      f_port=10

      # Payload (HEX encoded).
      payload="B554F2EDB6B1F62456FB95"

      # Frequency (Hz).
      frequency=902300000

      # Session key
      # app_key="578AEE2D8FC7999FECD3DFFD25F66A0F"

      # Bandwidth (Hz).
      bandwidth=125000

      # Spreading-factor.
      spreading_factor=7

      # Gateway configuration.
      [simulator.gateway]


      # Event topic template.
      event_topic_template="gateway/{{ .GatewayID }}/event/{{ .Event }}"

      # Command topic template.
      command_topic_template="gateway/{{ .GatewayID }}/command/{{ .Command }}"

      # Min number of receiving gateways.
      min_count=1

      # Max number of receiving gateways.
      max_count=1


    # Prometheus metrics configuration.

    # Using Prometheus (and Grafana), it is possible to visualize various
    # simulation metrics like:
    #   * Join-Requests sent
    #   * Join-Accepts received
    #   * Uplinks sent (by the devices)
    #   * Uplinks sent (by the gateways)
    #   * Uplinks sent (by the ChirpStack Application Server MQTT integration)
    # [prometheus]

    # IP:port to bind the Prometheus endpoint to.
    #
    # Metrics can be retrieved from /metrics.
    bind="0.0.0.0:9000"
