Измените адрес в packet-forwarder (https://github.com/lora-net/packet_forwarder) вашего шлюза, чтобы он отправлял свои данные на GW Bridge шлюза LoRaWAN. Вам нужно будет изменить следующие ключи конфигурации:

server_address на IP-адрес/имя хоста GW Bridge serv_port_up на 1700 (порт по умолчанию, который использует GW Bridge) serv_port_down на 1700 (то же самое)

Исполняемый файл lora-gateway-bridge имеет следующие флаги командной строки:


Usage:
lora-gateway-bridge [flags]
lora-gateway-bridge [command]

Available Commands:
configfile Print GW configuration file
help Help
version Print GW Bridge version

Flags:
-c, –config string path to configuration file (optional)
-h, –help help for lora-gateway-bridge
–log-level int debug=5, info=4, error=2, fatal=1, panic=0 (default 4)

Use «lora-gateway-bridge [command] –help» for more information about a command.


Лог журнал GW Bridge позволяет проверить, действительно ли поступают данные от шлюзов. Команда, необходимая для просмотра выходных данных журнала, зависит от того, использует ли ваш дистрибутив init.d или systemd.

init.d


Все журналы записываются в /var/log/lora-gateway-bridge/lora-gateway-bridge.log. Чтобы просмотреть и следовать этому журналу:

tail -f /var/log/lora-gateway-bridge/lora-gateway-bridge.log

Systemd


journalctl -u lora-gateway-bridge -f -n 50


Пример вывода:


lora-gateway-bridge[9714]: time=«2019-04-19T09:05:23+02:00» level=info msg=«backend: publishing packet» topic=«gateway/1111000011110000/stats»
lora-gateway-bridge[9714]: time=«2019-04-19T09:05:23+02:00» level=info msg=«gateway: sending udp packet to gateway» addr=192.168.25.107:35368 protocol_version=2 type=PushACK
lora-gateway-bridge[9714]: time=«2019-04-19T09:05:24+02:00» level=info msg=«gateway: received udp packet from gateway» addr=192.168.25.107:45562 protocol_version=2 type=PullData
lora-gateway-bridge[9714]: time=«2019-04-19T09:05:24+02:00» level=info msg=«backend: subscribing to topic» topic=«gateway/1111000011110000/tx»
lora-gateway-bridge[9714]: time=«2019-04-19T09:05:24+02:00» level=info msg=«gateway: sending udp packet to gateway» addr=192.168.25.107::45562 protocol_version=2 type=PullACK
lora-gateway-bridge[9714]: time=«2019-04-19T09:05:34+02:00» level=info msg=«gateway: received udp packet from gateway» addr=192.168.25.107::45562 protocol_version=2 type=PullData
lora-gateway-bridge[9714]: time=«2019-04-19T09:05:34+02:00» level=info msg=«gateway: sending udp packet to gateway» addr=192.168.25.107::45562 protocol_version=2 type=PullACKK


По умолчанию сетевой сервер LoRaWAN будет искать в следующем порядке файл конфигурации по следующим путям, если флаг –config явно не задан:

  • lora-gateway-bridge.toml (текущий рабочий каталог)
  • $HOME/.config/lora-gateway-bridge/lora-gateway-bridge.toml
  • /etc/lora-gateway-bridge/lora-gateway-bridge.toml



Чтобы загрузить конфигурацию из другого места, используйте флаг –config.

Чтобы создать новый файл конфигурации loraserver.toml, выполните следующую команду:

lora-gateway-bridge configfile > lora-gateway-bridge.toml

Обратите внимание, что этот файл конфигурации будет предварительно заполнен текущей конфигурацией (либо загруженной по указанным выше путям, либо с использованием флага –config). Это позволяет при добавлении новых полей обновлять файл конфигурации, сохраняя при этом старую конфигурацию.


Пример:

lora-gateway-bridge configfile –config lora-gateway-bridge-old.toml > lora-gateway-bridge-new.toml



Пример файла конфигурации:

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


# Configuration which relates to the packet-forwarder.
[packet_forwarder]
# 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»

# Skip the CRC status-check of received packets
#
# This is only has effect when the packet-forwarder is configured to forward
# LoRa frames with CRC errors.
skip_crc_check = false


# # Managed packet-forwarder configuration.
# #
# # By configuring one or multiple managed packet-forwarder sections, the
# # GW Bridge updates the configuration when the backend receives
# # a configuration change, after which it will restart the packet-forwarder.
# packet_forwarder.configuration
# # Gateway MAC.
# #
# # GW Bridge will only apply the configuration updates for this gateway MAC.
# mac=«0102030405060708»

# # Base configuration file.
# #
# # This file will be used as base-configuration and will not be overwritten on
# # a configuration update. This file needs to exist and contains the base
# # configuration and vendor specific
# base_file=«/etc/lora-packet-forwarder/global_conf.json»

# # Output configuration file.
# #
# # This will be the final configuration for the packet-forwarder, containing
# # a merged version of the base configuration + the requested configuration
# # update.
# # Warning: this file will be overwritten on a configuration update!
# output_file=«/etc/lora-packet-forwarder/local_conf.json»

# # Restart command.
# #
# # This command is issued by GW Bridge on a configuration
# # change. Make sure GW Bridge process has sufficient
# # permissions to execute this command.
# restart_command=«/etc/init.d/lora-packet-forwarder restart»


# Configuration for the MQTT backend.
[backend.mqtt]
# MQTT topic templates for the different MQTT topics.
#
#
# The default values match the default expected configuration of the
# LoRa Server MQTT backend. Therefore only change these values when
# absolutely needed.
# Use «mac» as an substitution for the LoRa gateway MAC.
#
# Note that some authentication types might overwrite these templates (e.g.
# in case of GCP Cloud IoT Core)!
uplink_topic_template=«gateway/mac/rx»
downlink_topic_template=«gateway/mac/tx»
stats_topic_template=«gateway/mac/stats»
ack_topic_template=«gateway/mac/ack»
config_topic_template=«gateway/mac/config»

# Payload marshaler.
#
# This defines how the MQTT payloads are encoded. Valid options are:
# * protobuf: Protobuf encoding
# * json: JSON encoding (easier for debugging, but less compact than 'protobuf')
marshaler=«protobuf»

# MQTT authentication.
[backend.mqtt.auth]
# Type defines the MQTT authentication type to use.
#
# Set this to the name of one of the sections below.
# Note: when the 'v2_json marhaler' is configured, the generic backend will
# always be used.
type=«generic»

# Generic MQTT authentication.
[backend.mqtt.auth.generic]
# MQTT server (e.g. scheme:host:port where scheme is tcp, ssl or ws)
server=«tcp:
127.0.0.1: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.
qos=1

# Clean session
#
# Set the «clean session» flag in the connect message when this client
# connects to an MQTT broker. By setting this flag you are indicating
# that no messages saved by the broker for this client should be delivered.
clean_session=true

# Client ID
#
# Set the client id to be used by this client when connecting to the MQTT
# broker. A client id must be no longer than 23 characters. When left blank,
# a random id will be generated. This requires clean_session=true.
client_id=«»

# CA certificate file (optional)
#
# Use this when setting up a secure connection (when server uses ssl:…)
# but the certificate used by the server is not trusted by any CA certificate
# on the server (e.g. when self generated).
ca_cert=«»

# mqtt TLS certificate file (optional)
tls_cert=«»

# mqtt TLS key file (optional)
tls_key=«»

# 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=«10m0s»


# Google Cloud Platform Cloud IoT Core authentication.
#
# Please note that when using this authentication type, the MQTT topics
# will be automatically set to match the MQTT topics as expected by
# Cloud IoT Core.
[backend.mqtt.auth.gcp_cloud_iot_core]
# MQTT server.
server=«ssl:
mqtt.googleapis.com:8883»

# Google Cloud IoT Core Device id.
device_id=«»

# Google Cloud project id.
project_id=«»

# Google Cloud region.
cloud_region=«»

# Google Cloud IoT registry id.
registry_id=«»

# JWT token expiration time.
jwt_expiration=«24h0m0s»

# JWT token key-file.
#
# Example command to generate a key-pair:
# $ ssh-keygen -t rsa -b 4096 -f private-key.pem
# $ openssl rsa -in private-key.pem -pubout -outform PEM -out public-key.pem
#
# Then point the setting below to the private-key.pem and associate the
# public-key.pem with this device / gateway in Google Cloud IoT Core.
jwt_key_file=«»


# Metrics configuration.
[metrics]

# Metrics stored in Prometheus.
#
# These metrics expose information about the state of GW Bridge
# instance like number of messages processed, number of function calls, etc.
[metrics.prometheus]
# Expose Prometheus metrics endpoint.
endpoint_enabled=false

# The ip:port to bind the Prometheus metrics server to for serving the
# metrics endpoint.
bind=«»

Хотя рекомендуется использовать файл конфигурации, также можно использовать переменные среды для установки переменных конфигурации.

Пример:

[packet_forwarder]
udp_bind=«0.0.0.0:1700»


Может быть установлен с помощью переменной среды:
PACKET_FORWARDER.UDP_BIND=«0.0.0.0:1700»