Connecting a UG65 Milesight to Chirpstack V4

Hello everyone,

I’m making this post because I’m stuck in the process of adding my UG65 Milesight gateway to my chirpstack server, a bit of context :

  • My gateway is physically connected to my computer with RJ45 Ethernet cable, I can access to the configuration webpages with my VM or my computer at “111.222.3.4”.
  • I have built a chirpstack server V4 on a Debian VM, I’m using the NAT network in the configuration of the VM. I can access this chirpstack server by using the IP of my computer and the port 8080 like this “my_computer_ip:8080”
  • I have followed the guide of Milesight ( How to Connect Milesight LoRaWAN Gateway to ChirpStack : IoT Support (milesight-iot.com)) to configure my gateway for Chirpstack V4.
  • I didn’t touch the “chirpstack-gateway.tolm” file, expect to set the region.
  • I add the gateway on my chirpstack server.

When I check the gateway on my chirpstack server, there is no log showed in the LoRaWAN frame section.

What should I do ?

Thank you very much.

Hi,
Where is you gateway bridge installed? On the gateway or on the server side?
If it is on the server, you have to open the 1700 port, and make sure that you can reach this udp port from the gateway.

Hi @Jerome73,

My gateway bridge is installed on my server side.

It seems that I have opened the port 1700 :
Capture

How can I be able to test if I can reach the port or not ?

Thank you very much.

Port 1700 is UDP instead.

Thank you @datnus, I will try with it.

What is the difference in this case ?

Adding port 1700 udp didn’t change the problem.

I noticed that the Lora LED on my gateway is ON and the “Connect status” on my server is “Connected” but still, I’m not receiving any frames.

Can you send a screenshot of the packet forwarder conf screen on the GW?

[EDIT]I have one UG65 connected to a local Chirpstack v4 instance, so I’m sure it works[/EDIT]

Yes, here it is :


I’m suspecting maybe it is because the port 1700 is not open on the gateway, but I don’t know how to open it.

image

I’m glad that you have been able to connect your gateway, so it means that it’s possible :grin:.

All the same for me (except that I’m using the local network and a “real” server to host Chirpstack):

The 1700 is naturally open without the need to configure the Firewall.

For me, this is typically a network configuration problem between your computer and the gateway.

Yes, it seems more of a network issue here.

My Chirpstack server is on a Virtual Machine hosted on my computer. This VM can access my network with the configuration “bridge to bridge”, so the VM actually “see” the gateway, but I don’t know why the gateway can’t reach the server.

I will keep investigating, and I’m also in communication with milesight IOT support. I will keep you in touched.

It didn’t take too long, haha, I find my issue.

I put the same IP on my VM as my computer, which misled the gateway, I supposed.

Thanks for your help everyone !

Hello Everyone,

my Chirpstack v4 can’t see my UG65 gateway after following Milesight guide but the gateway say it is connected… any idea what im doing wrong?

Gateway Page

Chirpstack Page

chirpstack-gateway-bridge.toml

[general]
# debug=5, info=4, warning=3, error=2, fatal=1, panic=0
log_level=4

# Log in JSON format.
log_json=false

# Log to syslog.
#
# When set to true, log messages are being written to syslog.
log_to_syslog=false

# NetIDs filters.
#
# The configured NetIDs will be used to filter uplink data frames.
# When left blank, no filtering will be performed on NetIDs.
#
# Example:
# net_ids=[
#   "000000",
#   "000001",
# ]
net_ids=[
]

# JoinEUI filters.
#
# The configured JoinEUI ranges will be used to filter join-requests.
# When left blank, no filtering will be performed on JoinEUIs.
#
# Example:
# join_euis=[
#   ["0000000000000000", "00000000000000ff"],
#   ["000000000000ff00", "000000000000ffff"],
# ]
join_euis=[
]


# Gateway backend configuration.
[backend]

# Backend type.
#
# Valid options are:
#   * semtech_udp
#   * concentratord
#   * basic_station
type="semtech_udp"


  # Semtech UDP packet-forwarder backend.
  [backend.semtech_udp]

  # ip:port to bind the UDP listener to
  #
  # Example: 0.0.0.0:1700 to listen on port 1700 for all network interfaces.
  # This is the listener to which the packet-forwarder forwards its data
  # so make sure the 'serv_port_up' and 'serv_port_down' from your
  # packet-forwarder matches this port.
  udp_bind = "0.0.0.0:1700"

  # Fake RX timestamp.
  #
  # Fake the RX time when the gateway does not have GPS, in which case
  # the time would otherwise be unset.
  fake_rx_time=false

  # Basic Station backend.
  [backend.basic_station]

  # ip:port to bind the Websocket listener to.
  bind=":3001"

  # TLS certificate and key files.
  #
  # When set, the websocket listener will use TLS to secure the connections
  # between the gateways and ChirpStack Gateway Bridge (optional).
  tls_cert=""
  tls_key=""

  # TLS CA certificate.
  #
  # When configured, ChirpStack Gateway Bridge will validate that the client
  # certificate of the gateway has been signed by this CA certificate.
  ca_cert=""

  # Stats interval.
  #
  # This defines the interval in which the ChirpStack Gateway Bridge forwards
  # the uplink / downlink statistics.
  stats_interval="30s"

  # Ping interval.
  ping_interval="1m0s"

  # Timesync interval.
  #
  # This defines the interval in which the ChirpStack Gateway Bridge sends
  # a timesync request to the gateway. Setting this to 0 disables sending
  # timesync requests.
  timesync_interval="0s"

  # Read timeout.
  #
  # This interval must be greater than the configured ping interval.
  read_timeout="1m5s"

  # Write timeout.
  write_timeout="1s"

  # Region.
  #
  # Please refer to the LoRaWAN Regional Parameters specification
  # for the complete list of common region names.
  region="AU915"

  # Minimal frequency (Hz).
  frequency_min=863000000

  # Maximum frequency (Hz).
  frequency_max=870000000


# Integration configuration.
[integration]
# Payload marshaler.
#
# This defines how the MQTT payloads are encoded. Valid options are:
# * protobuf:  Protobuf encoding
# * json:      JSON encoding (for debugging)
marshaler="protobuf"

  # MQTT integration configuration.
  [integration.mqtt]
  # Event topic template.
  event_topic_template="au915_0/gateway/{{ .GatewayID }}/event/{{ .EventType }}"

  # State topic template.
  #
  # States are sent by the gateway as retained MQTT messages (by default)
  # so that the last message will be stored by the MQTT broker. When set to
  # a blank string, this feature will be disabled. This feature is only
  # supported when using the generic authentication type.
  state_topic_template="au915_0/gateway/{{ .GatewayID }}/state/{{ .StateType }}"

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

  # State retained.
  #
  # By default this value is set to true and states are published as retained
  # MQTT messages. Setting this to false means that states will not be retained
  # by the MQTT broker.
  state_retained=true

  # Keep alive will set the amount of time (in seconds) that the client should
  # wait before sending a PING request to the broker. This will allow the client
  # to know that a connection has not been lost with the server.
  # Valid units are 'ms', 's', 'm', 'h'. Note that these values can be combined, e.g. '24h30m15s'.
  keep_alive="30s"

  # Maximum interval that will be waited between reconnection attempts when connection is lost.
  # Valid units are 'ms', 's', 'm', 'h'. Note that these values can be combined, e.g. '24h30m15s'.
  max_reconnect_interval="1m0s"

  # Terminate on connect error.
  #
  # When set to true, instead of re-trying to connect, the ChirpStack Gateway Bridge
  # process will be terminated on a connection error.
  terminate_on_connect_error=false


  # MQTT authentication.
  [integration.mqtt.auth]
  # Type defines the MQTT authentication type to use.
  #
  # Set this to the name of one of the sections below.
  type="generic"

    # Generic MQTT authentication.
    [integration.mqtt.auth.generic]
    # MQTT servers.
    #
    # Configure one or multiple MQTT server to connect to. Each item must be in
    # the following format: scheme://host:port where scheme is tcp, ssl or ws.
    servers=[
      "tcp://localhost:1883",
    ]
    # Connect with the given username (optional)
    username=""
    # Connect with the given password (optional)
    password=""

    # Quality of service level
    #
    # 0: at most once
    # 1: at least once
    # 2: exactly once
    #
    # Note: an increase of this value will decrease the performance.
    # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
    qos=0

chirpstack.toml

[logging]

  # Log level.
  #
  # Options are: trace, debug, info, warn error.
  level="info"


# PostgreSQL configuration.
[postgresql]

  # PostgreSQL DSN.
  #
  # Format example: postgres://<USERNAME>:<PASSWORD>@<HOSTNAME>/<DATABASE>?sslmode=<SSLMODE>.
  #
  # SSL mode options:
  #  * disable - no SSL
  #  * require - Always SSL (skip verification)
  #  * verify-ca - Always SSL (verify that the certificate presented by the server was signed by a trusted CA)
  #  * verify-full - Always SSL (verify that the certification presented by the server was signed by a trusted CA and the server host name matches the one in the certificate)
  dsn="postgres://chirpstack:chirpstack@$POSTGRESQL_HOST/chirpstack?sslmode=disable"

  # Max open connections.
  #
  # This sets the max. number of open connections that are allowed in the
  # PostgreSQL connection pool.
  max_open_connections=10

  # Min idle connections.
  #
  # This sets the min. number of idle connections in the PostgreSQL connection
  # pool (0 = equal to max_open_connections).
  min_idle_connections=0


# Redis configuration.
[redis]

  # Server address or addresses.
  #
  # Set multiple addresses when connecting to a cluster.
  servers=[
    "redis://$REDIS_HOST/",
  ]

  # TLS enabled.
  tls_enabled=false

  # Redis Cluster.
  #
  # Set this to true when the provided URLs are pointing to a Redis Cluster
  # instance.
  cluster=false


# Network related configuration.
[network]

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

  # Enabled regions.
  #
  # Multiple regions can be enabled simultaneously. Each region must match
  # the 'name' parameter of the region configuration in '[[regions]]'.
  enabled_regions=[
    "as923",
    "as923_2",
    "as923_3",
    "as923_4",
    "au915_0",
    "us915_0",
    "us915_1",
  ]


# API interface configuration.
[api]

  # interface:port to bind the API interface to.
  bind="0.0.0.0:8080"

  # Secret.
  secret="XXXXXXXXXXXXX"


[integration]
  enabled=["mqtt"]

  [integration.mqtt]
    server="tcp://$MQTT_BROKER_HOST:1883/"
    json=true

ChirpStack will mark the gateway as online once it receives (the first) stats from the gateway. As well the interval in which the stats are sent by the gateway need to match the stats interval as configured in ChirpStack. By default this is set to every 30 seconds.

Hello, did you solve it? I have the same problem