配置服务为自动启动
systemctl enable redis.service
systemctl enable nanomq.service
systemctl enable chirpstack-mqtt-forwarder.service
systemctl enable lora_sx1302_pktfwd.service
systemctl enable chirpstack-sqlite.service
启动服务
systemctl start redis.service
systemctl start nanomq.service
systemctl start chirpstack-mqtt-forwarder.service
systemctl start lora_sx1302_pktfwd.service
systemctl start chirpstack-sqlite.service
chirpstack服务启动后,默认在8080端口提供WEB管理页面,可以在浏览器输入网关IP地址和端口号,访问管理页面。
ChirpStack默认用户名为admin,密码为admin。建议生产使用时,修改默认密码。
LoRaWAN的GatewayID,默认是AA555A0000000000,配置页面填写该ID即可。
设置支持CN470_0频段
修改chirpstack支持cn470_0频段,修改文件/etc/chirpstack/chirpstack.toml,在network段的enabled_regions中添加cn470_0。
# 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",
"cn470_0",
"cn470_10",
"cn779",
"eu433",
"eu868",
"in865",
"ism2400",
"kr920",
"ru864",
"us915_0",
"us915_1",
]
修改chirpstack-mqtt-forwarder的配置文件/etc/chirpstack-mqtt-forwarder/chirpstack-mqtt-forwarder.toml,修改mqtt段中的topic_prefix为cn470_0。
# MQTT settings.
[mqtt]
# Topic prefix.
#
# ChirpStack MQTT Forwarder publishes to the following topics:
#
# * [Prefix/]gateway/[Gateway ID]/event/[Event]
# * [Prefix/]gateway/[Gateway ID]/state/[State]
#
# And subscribes to the following topic:
#
# * [Prefix/]gateway/[Gateway ID]/command/[Command]
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_0"
# Use JSON encoding instead of Protobuf (binary).
#
# Note, only use this for debugging purposes.
json=false
修改/etc/lora1302-pktfwd/global_conf.json中频段为0组的频点即可。
然后分别重启服务
systemctl restart chirpstack-sqlite chirpstack-mqtt-forwarder lora_sx1302_pktfwd