一、ChirpStack API返回空數組
在使用ChirpStack開發IoT項目時,我們經常會涉及到ChirpStack API的使用。但是有時候我們可能會遇到ChirpStack API返回空數組的問題。這時候我們需要檢查以下幾個方面:
1、檢查請求參數是否正確,包括請求類型、請求地址、請求參數等;
curl -X GET \
-H "Grpc-Metadata-Authorization: $JWT_TOKEN" \
"https://your-chirpstack-app-server/api/devices"
2、檢查所需資源是否存在,比如請求的設備是否存在;
3、檢查ChirpStack服務是否正常運行。
二、ChirpStack中文
ChirpStack是一款跨平台的開源物聯網網絡服務器,它可以與各種網絡服務器和傳感器互聯,並提供了一系列的API供開發者使用。與其他物聯網解決方案相比,ChirpStack具有靈活性高、可擴展性強、安全性高等優點。因為其強大的功能和靈活性,ChirpStack在國內的應用也越來越廣泛。
三、ChirpStack登錄
ChirpStack提供了Web界面供用戶操作,但是要使用Web界面需要先登錄,下面是ChirpStack登錄的操作步驟:
1、打開ChirpStack Web界面,輸入用戶名和密碼,然後點擊「登錄」按鈕;
http://localhost:8080
2、如果登錄成功,就可以開始使用ChirpStack了。
四、ChirpStack最新版本的配置
ChirpStack最新版本相比舊版本有了更多的配置項,下面以一些常用的配置項為例進行介紹:
1、配置MQTT Broker:
[application_server.integration.mqtt.default]
server="tcp://localhost:1883"
username="mqtt-username"
password="mqtt-password"
2、配置PostgreSQL數據庫:
[postgresql]
dsn="postgres://chirpstack_as:dbpassword@localhost/chirpstack_as?sslmode=disable"
automigrate=true
3、配置網關頻率:
[network_server.gateway.stats]
interval="1m0s"
注意:配置之後需要重啟ChirpStack服務才能生效。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hk/n/309731.html