Adding a new region (ma869)

Hello everyone !

I’m trying to add a new region “MA869” and hit a bit of a wall.
My initial ( very naive ) approach was to create a region file (region_ma869.toml) and added in the list of regions in chirpstack.toml.
When i restarted chirpstack i get an error that common_name “MA_869” is not recognized…

So my question is, how to add correctly a new region ?
Should I dig into the source code to register a new region? or is there a better way.

Would really appreciate if anyone who’s been down this road could share how they approached this (or if I’m completely off-track here).

Thanks in advance!

You’re absolutely on the right track. perhaps you just forgot to change the common_name= line at the top of the file to whatever the identifier you want to use in the mqtt topics and enabled regions array.

If that’s not it share your file and someone will be able to spot the issue.

Generally though you have the correct approach, create a new .toml, enable it in your chirpstack.toml, then create a gateway bridge that uses it’s MQTT topics.

Thank you for your reply, this is my region toml file :

[[regions]]
  # ID is an user-defined identifier for this region.
  id = "ma869"

  # Description is a short description for this region.
  description = "Morocco 869MHz"

# Common-name refers to the common-name of this region as defined by
  # the LoRa Alliance.
  common_name = ""

  # User-defined region information.
  user_info = ""
  ## Morocco 869MHz LoRaWAN Region

  # Gateway configuration.
  [regions.gateway]
    force_gws_private = false

    # Gateway backend configuration.
    [regions.gateway.backend]
      enabled = "mqtt"

      [regions.gateway.backend.mqtt]
        topic_prefix = "ma869"
        share_name = "chirpstack"
        server = "tcp://localhost:1883"
        username = ""
        password = ""
        qos = 0
        clean_session = false
        client_id = ""
        keep_alive_interval = "30s"
        ca_cert = ""
        tls_cert = ""
        tls_key = ""



# Gateway channel configuration for MA869
    [[regions.gateway.channels]]
      frequency = 869200000
      bandwidth = 125000
      modulation = "LORA"
      spreading_factors = [7, 8, 9, 10, 11, 12]

    [[regions.gateway.channels]]
      frequency = 869400000
      bandwidth = 125000
      modulation = "LORA"
      spreading_factors = [7, 8, 9, 10, 11, 12]

    [[regions.gateway.channels]]
      frequency = 869600000
      bandwidth = 125000
      modulation = "LORA"
      spreading_factors = [7, 8, 9, 10, 11, 12]

    # Downlink channel
    [[regions.gateway.channels]]
      frequency = 869525000
      bandwidth = 125000
      modulation = "LORA"
      spreading_factors = [7, 8, 9, 10, 11, 12]

  # Region specific network configuration.
  [regions.network]
    installation_margin = 10
    rx_window = 0
    rx1_delay = 1
    rx1_dr_offset = 0
    rx2_dr = 0
    rx2_frequency = 869525000
    rx2_prefer_on_rx1_dr_lt = 0
    rx2_prefer_on_link_budget = false
    downlink_tx_power = -1
    adr_disabled = false
    min_dr = 0
    max_dr = 5

    [regions.network.rejoin_request]
      enabled = false
      max_count_n = 0
      max_time_n = 0

    [regions.network.class_b]
      ping_slot_dr = 3
      ping_slot_frequency = 0

    # Extra channels configuration for MA869
    [[regions.network.extra_channels]]
      frequency = 869200000
      min_dr = 0
      max_dr = 5

    [[regions.network.extra_channels]]
      frequency = 869400000
      min_dr = 0
      max_dr = 5

    [[regions.network.extra_channels]]
      frequency = 869600000
      min_dr = 0
      max_dr = 5

    [[regions.network.extra_channels]]
    frequency=869100000
    min_dr=0
    max_dr=5

    [[regions.network.extra_channels]]
    frequency=869300000
    min_dr=0
    max_dr=5

    [[regions.network.extra_channels]]
    frequency=869500000
    min_dr=0
    max_dr=5

    [[regions.network.extra_channels]]
    frequency=869700000
    min_dr=0
    max_dr=5

    [[regions.network.extra_channels]]
    frequency=869900000
    min_dr=0
    max_dr=5

and in chirpstack toml file I modfied network configuration to add ma869 :

[network]

  # Network identifier (NetID, 3 bytes) encoded as HEX (e.g. 010203).
  net_id = "000000"

  # Enabled regions.
  
  enabled_regions = [
    "as923",
    "as923_2",
    "as923_3",
    "as923_4",
    "au915_0",
    "cn470_10",
    "cn779",
    "eu433",
    "eu868",
    "in865",
    "ism2400",
    "kr920",
    "ma869",
    "ru864",
    "us915_0",
    "us915_1",
  ]

If i summarise to add a region :

  • Add region in chirpstack.toml
  • Add a region file
  • restart chirpstack service and gateway service
    Is there anything I’m missing, or are these steps enough to enable a new region?

Thanks in advance, really appreciate it !

You also need to change the mqtt topic_prefix in your gateway bridge (or MQTT forwarder depending on your architecture) to use the new id of this region, so ma869.

This file looks okay, do you still have the error?