请选择 进入手机版 | 继续访问电脑版

 找回密码
 立即注册
搜索
查看: 240|回复: 0

ChirpStack LoRaWAN 服务器使用笔记

[复制链接]

264

主题

0

回帖

1049

积分

管理员

积分
1049
发表于 2023-12-26 00:17:52 | 显示全部楼层 |阅读模式

网络结构

ChirpStack 是一款开源的 LoRaWAN 服务器,由 chirpstack-gateway-bridge、chirpstack-network-server、chirpstack-application-server 等部件组成,是用 Go 语言开发的。

安装依赖

sudo apt install mosquitto

sudo apt install postgresql postgresql-contrib

sudo apt install redis-server

mosquitto 装好后会自动启动 /snap/mosquitto/704/launcher.sh,不要通过服务启动。

配置数据库

sudo -u postgres psql

NS 数据库:

create role chirpstack_ns with login password 'dbpassword';

create database chirpstack_ns with owner chirpstack_ns;

AS 数据库:

create role chirpstack_as with login password 'dbpassword';

create database chirpstack_as with owner chirpstack_as;

\c chirpstack_as

create extension pg_trgm;

create extension hstore;

-- exit the prompt

\q

测试数据库:

psql -h localhost -U chirpstack_ns -W chirpstack_ns

添加源:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1CE2AFD36DBCCA00

sudo echo "deb https://artifacts.chirpstack.io/packages/3.x/deb stable main" | sudo tee /etc/apt/sources.list.d/chirpstack.list

sudo apt update

安装 Gateway Bridge

sudo apt install chirpstack-gateway-bridge

The configuration file is located at:

/etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml

Some helpful commands for chirpstack-gateway-bridge:

Start:

$ sudo systemctl start chirpstack-gateway-bridge

Restart:

$ sudo systemctl restart chirpstack-gateway-bridge

Stop:

$ sudo systemctl stop chirpstack-gateway-bridge

Display logs:

$ sudo journalctl -f -n 100 -u chirpstack-gateway-bridge

sudo systemctl start chirpstack-gateway-bridge

安装 NS(网络服务器)

sudo apt install chirpstack-network-server

The configuration file is located at:

/etc/chirpstack-network-server/chirpstack-network-server.toml

Some helpful commands for chirpstack-network-server:

Start:

$ sudo systemctl start chirpstack-network-server

Restart:

$ sudo systemctl restart chirpstack-network-server

Stop:

$ sudo systemctl stop chirpstack-network-server

Display logs:

$ sudo journalctl -f -n 100 -u chirpstack-network-server

日志:

tail -f /var/log/chirpstack-network-server/chirpstack-network-server.log

修改配置文件:

 /etc/chirpstack-network-server/chirpstack-network-server.toml

dsn="postgres://localhost/chirpstack_ns_ns?sslmode=disable"

改为:

dsn="postgres://chirpstack_ns:dbpassword@localhost/chirpstack_ns?sslmode=disable"

sudo systemctl start chirpstack-network-server

安装 AS(应用服务器)

sudo apt-get install chirpstack-application-server

The configuration file is located at:

/etc/chirpstack-application-server/chirpstack-application-server.toml

Some helpful commands for chirpstack-application-server:

Start:

$ sudo systemctl start chirpstack-application-server

Restart:

$ sudo systemctl restart chirpstack-application-server

Stop:

$ sudo systemctl stop chirpstack-application-server

Display logs:

$ sudo journalctl -f -n 100 -u chirpstack-application-server

修改配置文件:

/etc/chirpstack-application-server/chirpstack-application-server.toml

dsn="postgres://localhost/chirpstack_as?sslmode=disable"

改为:

dsn="postgres://chirpstack_as:dbpassword@localhost/chirpstack_as?sslmode=disable"

使用命令 openssl rand -base64 32 生成 jwt_secret

配置文件中的默认 WebUI 端口是 8080(NS 没有 WebUI)。

sudo systemctl start chirpstack-application-server

打开WebUI:

http://192.168.88.130:8080/

默认用户 admin,密码:admin


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|深圳市棱讯科技有限公司 ( 粤ICP备2024228160号-2|粤公网安备44030002003510号 )

GMT+8, 2024-5-29 05:15 , Processed in 0.019800 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表