SG50自定义配置模板

本文档描述如何创建SG50自定义配置模板。

背景信息

配置模板包含基本设置高级设置。基本设置可以使用星纵物联开放平台提供的可视化界面进行编辑,而高级设置则只能以JSON格式进行编辑。

按照以下工作流程创建并应用自定义配置模板:

  1. 在星纵物联开放平台创建一个自定义配置文件模板。
  2. 使用可视界面配置基本设置。
  3. 以JSON格式配置高级设置。
  4. 保存并应用自定义配置文件模板。

步骤1 创建自定义配置模板

  1. 登录 星纵物联开放平台
  2. 点击 设备 然后选择 自定义配置模板

  3. 点击 添加
  4. 基础信息 中配置模板的基础信息。

    1. Profile Template Name 自定义模板的名称。
    2. Select Product Profile Template 下拉选择 SG50_Profile_Template
    3. Profile Template Version 下拉选择配置模板的版本。

步骤2 配置连接平台

  1. 选择通用配置
  2. 设备管理连接配置决定是否将设备连接到星纵物联开放平台进行远程管理和配置。
    连接设备到星纵物联开放平台
    保持默认配置。

    连接设备星纵DeviceHub 2.0平台
    1. 连接平台 菜单栏选择 DeviceHub 2.0
    2. DeviceHub服务器地址 栏中输出对应DeviceHub服务器地址。
    不连接星纵平台
    取消 平台连接 的勾选。

步骤3 配置数据包转发

SG50做为数据包转发功能实现 LoRaWAN® 终端和网络服务器之间通信。

  1. 进入基础信息 菜单下的数据包转发 板块。

  2. 网关包转发目的地类型 下拉选择需要进行转发的网络服务器。

    类型 设置
    Semtech 通过Semtech UDP协议连接网络服务器,支持连接大多数主流网络服务器。
    • 服务器地址: 配置LoRaWAN® 网络服务器地址。
    • 上行端口: NS 服务器的上行端口号,默认1700。
    • 下行端口: NS 服务器的下行端口号,默认1700。
    Basics Station
    通过TCP协议连接网络服务器。
    注: 配置配置LNS URI 或 CUPS URI,以下以LNS URI连接为例。
    • LNS URI: 输入服务器地址与端口,格式如下:

      wss://<服务器地址>:<端口>ws://<服务器地址>:<端口>

    • 根证书(*.trust): 上传 Basics Station服务器的根证书。
    • 客户端证书(*.crt): 上传 Basics Station服务器的客户端证书。
    • 客户端密钥(*.key): 上传 Basics Station服务器的客户端密钥。
    • GPS: 是否转发网关的GPS数据到网络服务器。
    Chirpstack-Generic 通过MQTT连接到Chirpstack服务器。
    • MQTT服务器地址: Chirpstack服务器地址。
    • MQTT端口: Chirpstack服务器数据端口
    • 用户凭证: 启用后,需要输入用户名和密码进行验证。
    • TLS证书: 决定是否启用TLS认证。启用后,你需要指定 TLS 证书的类型。
      • CA signed server certificate: 使用设备自带的CA 认证的根证书进行验证。
      • Self signed certificates: 用户需要自己上传证书和密钥进行验证。
    Remote Embedded NS

    通过主从模式连接到星纵UG65/UG67/UG56等网关的内置网络服务器。

    服务器地址: UG65/UG67/UG56等主网关的IP地址或域名。

    MQTT端口: UG65/UG67/UG56等主网关的服务端口,默认18883。

    Milesight Development Platform LNS 连接到星纵开放平台LNS,需要在平台上添加对应的网关设备,并启用LNS服务。

Step 4. Configure the LoRa RF Channel Setting

In the LoRa RF Channel Setting section, select the frequency of the device. The LoRaWAN® frequency plan used for the uplink and downlink frequencies and datarates. Available options depend on the gateway's model:

-470M: CN470

-868M: EU868, RU864, IN865

-915M: US915, AU915, KR920, AS923-1&2&3&4

Step 5. Configure the LoRa Beacon

In the LoRa Beacon section, select the beacon period of the device. The Beacon Period is the interval of gateway sending beacons for Class B device time synchronization. 0 means the gateway will not send beacons. Please select the value as 128 if end device type is Class B.

Step 6. LBT Settings

In the LBT Settings section, click to enable LBT and specify LBT RSSI Target Value. Listen before talk (LBT) is used to detect whether the downlink channel is idle and avoid channel access conflicts.

注: AU915 and US915 do not support LBT feature.

Step 7. Configure the Packet Forward Filters

In the Packet Forward Filters section, filter uplink packets via different conditions to reduce network congestion, save network traffic and ensure the safety operations.

  1. Select the filter mode as black list or white list.

    Setting Description
    NetID Filtering Mode Forward/Not forward the uplink packets that meet the NetID.
    • White List: Only forward the packets in this list to the network server.
    • Black List: Only forward the packets except this list to the network server
    JoinEui Filtering Mode Forward/Not forward the join request packets that meet the JoinEUI range.
    • White List: Only forward the packets in this list to the network server.
    • Black List: Only forward the packets except this list to the network server
    DevEUI Filtering Mode

    Forward/Not forward the join request packets that meet the DevEUI range.

    • White List: Only forward the packets in this list to the network server.
    • Black List: Only forward the packets except this list to the network server
  2. Set the specific filtering value or range list. Every condition supports to add 5 lists at most.

Step 8. Configure the Cellular

The device supports to insert a SIM card to get cellular network connections. In the Cellular section, specify the cellular information.
  1. Specify the cellular information

    Setting Description
    APN

    Specify the Access Point Name for cellular dial-up connection provided by local ISP. Please contact cellular operator or search for the Internet to get it.

    Username

    Specify the username for cellular dial-up connection provided by local ISP.

    Password Specify the password for cellular dial-up connection provided by local ISP.
    Authorization Type

    Select from None, PAP and CHAP.

    PIN Code

    Specify a 4-8 characters PIN code to unlock the SIM.

    Emergency Reboot Click to enable the device reboot when the cellular connection is not available.
  2. Specify the Ping Detection.

    Setting Description

    Enable

    Click to enable and then the device will send ICMP packets to corresponding servers to detect the connection periodically.

    注: It is suggested to disable this option if the device is connected to the private network (Non-internet).

    Primary Server (IPv4)

    The device will send ICMP packet to this server address or hostname to determine whether the Internet connection is still available or not.

    Secondary Server (IPv4)

    The device will try to ping the secondary server name if primary server is not available.

    Ping Detection Interval

    Time interval between two Pings. (Unit: s)

    Retry Interval

    When ping failed, the device will ping again at every retry interval. (Unit: s)

    Timeout

    The maximum time which the device will wait for a response to a ping request. If it does not receive a response for the timeout, the ping request will be considered to have failed.

    Max Ping Retries

    The number of times the device will retry sending a ping request until determining that the connection has failed.

Step 9. Configure the WLAN

In the WLAN section, specify the WLAN information. The WLAN works as AP mode to configure device and it can not connect to other access points.
注: One SG50 device only supports 2 devices'WLAN connection to login this device at the same time.
  1. Click to enable Wi-Fi feature.

  2. Specify the information of the Wi-Fi feature.

    1. You can click to enable the Turn off WLAN When Battery is Discharging as needed. The device will turn off the Wi-Fi when the battery is discharging to save power.
    2. You can click to enable the Timing Turnoff as needed. The device will turn off and turn on the Wi-Fi at preset time points of a day.
    3. Specify the SSID as needed. The unique name for this device Wi-Fi access point. The default SSID is Gateway_xxxxxx. (xxxxxx is the last 6 digits of MAC address.)
    4. Specify the Authentication Type. No Encryption and WPA-PSK are optional.
    5. Specify the Secret Key. And you can customize the Wi-Fi password when security mode is WPA-PSK.

Step 10. Configure the User Management

In the User Management section, you can specify the user name and a new password of the device.

Step 11. Configure the Time

In the Time section, specify the time settings of the device.

  1. Specify the Time Zone you are in.
  2. Show the Time Synchronization Type, It’s fixed as Sync with NTP Server.
  3. Specify the NTP Server's IP address or domain name.

Optional: Step 12. Configure the advanced settings

  1. Scroll up to the top of the page, click TEXT on the right to view the settings in JSON.

  2. Click Edit to enter edit mode.

  3. Search and edit the following keys' value as needed.
    Key Type Description
    station_lns_uri LNS URI Enter the URI address of the remote LoRaWAN server's Basic Station.
    pkt_keepalive_intv Keep Alive Interval/s Show the time interval for the gateway sends heartbeat packets to the network server.
    pkt_stat_intv Statistical Time Interval Show the time interval at the gateway updates statistical data.
    pkt_push_ms Push Timeout Time Show the timeout period for the gateway to receive a response from the server after forwarding the data packet.
    expert_enable Lora Custom Configuration Enable Decide whether to enable LoRa custom configuration feature.

    Valid value:

    • 0: Disable. (Default value)
    • 1: Enable.
    expert_content LoRa Custom Configuration To set custom parameters related to LoRa.
  4. Click Save.

Step 13. Save the custom Profile template

  1. 点击界面的左下角的 保存
  2. 应用自定义模板到对应设备的方法。
    • 网页端: 在 添加设备 时选择对应的配置模板。
    • API: 参考以下操作流程
      1. 操作 中点击 按钮下载JSON格式模板。

      2. 参考 添加设备 将整个JSON格式的模板添加进API。