G302树莓派网关使用手册_V1.0.pdf

global_conf.json配置文件说明

  1. {
  2. "SX130x_conf": {
  3. "spidev_path": "/dev/spidev0.0",
  4. "sx126x_path": "/dev/spidev0.1",
  5. "i2cdev_path": "/dev/i2c-1",
  6. "sx126x_busy_pin":13,
  7. "sx126x_reset_pin":26,
  8. "lorawan_public": true,
  9. "clksrc": 0,
  10. "antenna_gain": 0, /* antenna gain, in dBi */
  11. "full_duplex": false,
  12. "precision_timestamp": {
  13. "enable": false,
  14. "max_ts_metrics": 255,
  15. "nb_symbols": 1
  16. },
  17. "radio_0": {
  18. "enable": true,
  19. "type": "SX1250",
  20. "single_input_mode": true,
  21. "freq": 470600000,
  22. "rssi_offset": -207.0,
  23. "rssi_tcomp": {"coeff_a": 0, "coeff_b": 0, "coeff_c": 20.41, "coeff_d": 2162.56, "coeff_e": 0},
  24. "tx_enable": true,
  25. "tx_freq_min": 500000000,
  26. "tx_freq_max": 510000000,
  27. "tx_gain_lut":[
  28. {"rf_power": -6, "pa_gain": 0, "pwr_idx": 0},
  29. {"rf_power": -3, "pa_gain": 0, "pwr_idx": 1},
  30. {"rf_power": 0, "pa_gain": 0, "pwr_idx": 2},
  31. {"rf_power": 3, "pa_gain": 1, "pwr_idx": 3},
  32. {"rf_power": 6, "pa_gain": 1, "pwr_idx": 4},
  33. {"rf_power": 10, "pa_gain": 1, "pwr_idx": 5},
  34. {"rf_power": 11, "pa_gain": 1, "pwr_idx": 6},
  35. {"rf_power": 12, "pa_gain": 2, "pwr_idx": 7},
  36. {"rf_power": 13, "pa_gain": 1, "pwr_idx": 8},
  37. {"rf_power": 14, "pa_gain": 2, "pwr_idx": 9},
  38. {"rf_power": 16, "pa_gain": 2, "pwr_idx": 10},
  39. {"rf_power": 20, "pa_gain": 3, "pwr_idx": 11},
  40. {"rf_power": 23, "pa_gain": 3, "pwr_idx": 12},
  41. {"rf_power": 25, "pa_gain": 3, "pwr_idx": 13},
  42. {"rf_power": 26, "pa_gain": 3, "pwr_idx": 14},
  43. {"rf_power": 27, "pa_gain": 3, "pwr_idx": 15}
  44. ]
  45. },
  46. "radio_1": {
  47. "enable": true,
  48. "type": "SX1250",
  49. "single_input_mode": true,
  50. "freq": 471400000,
  51. "rssi_offset": -207.0,
  52. "rssi_tcomp": {"coeff_a": 0, "coeff_b": 0, "coeff_c": 20.41, "coeff_d": 2162.56, "coeff_e": 0},
  53. "tx_enable": false
  54. },
  55. "chan_multiSF_0": {"enable": true, "radio": 0, "if": -300000},
  56. "chan_multiSF_1": {"enable": true, "radio": 0, "if": -100000},
  57. "chan_multiSF_2": {"enable": true, "radio": 0, "if": 100000},
  58. "chan_multiSF_3": {"enable": true, "radio": 0, "if": 300000},
  59. "chan_multiSF_4": {"enable": true, "radio": 1, "if": -300000},
  60. "chan_multiSF_5": {"enable": true, "radio": 1, "if": -100000},
  61. "chan_multiSF_6": {"enable": true, "radio": 1, "if": 100000},
  62. "chan_multiSF_7": {"enable": true, "radio": 1, "if": 300000},
  63. "chan_Lora_std": {"enable": true, "radio": 1, "if": -200000, "bandwidth": 250000, "spread_factor": 7,
  64. "implicit_hdr": false, "implicit_payload_length": 17, "implicit_crc_en": false, "implicit_coderate": 1},
  65. "chan_FSK": {"enable": true, "radio": 1, "if": 300000, "bandwidth": 125000, "datarate": 50000}
  66. },
  67. "gateway_conf": {
  68. "gateway_ID": "AA555A0000000000",
  69. /* 更改为默认服务器地址/端口 */
  70. "server_address": "39.98.253.192",
  71. "serv_port_up": 1700,
  72. "serv_port_down": 1700,
  73. /* 为您的网络调整以下参数 */
  74. "keepalive_interval": 10,
  75. "stat_interval": 30,
  76. "push_timeout_ms": 100,
  77. /* 只转发有效数据包 */
  78. "forward_crc_valid": true,
  79. "forward_crc_error": false,
  80. "forward_crc_disabled": false,
  81. /* GPS 配置 */
  82. "gps_tty_path": "/dev/ttyS0",
  83. /* GPS 参考坐标 */
  84. "ref_latitude": 0.0,
  85. "ref_longitude": 0.0,
  86. "ref_altitude": 0,
  87. /* 信标参数 */
  88. "beacon_period": 0,
  89. "beacon_freq_hz": 869525000,
  90. "beacon_datarate": 9,
  91. "beacon_bw_hz": 125000,
  92. "beacon_power": 14,
  93. "beacon_infodesc": 0
  94. },
  95. "debug_conf": {
  96. "ref_payload":[
  97. {"id": "0xCAFE1234"},
  98. {"id": "0xCAFE2345"}
  99. ],
  100. "log_file": "loragw_hal.log"
  101. }
  102. }

global_conf.json配置
这个配置文件是lora_pkt_fwd程序运行的所有配置参数,其中有几点是我们平时会比较常用到的:

  • 如何修改基站的接收频点
  • 如何设置基站的ID
  • 如何设置基站的LoRaWAN NS指向
  • 如何设置基站的发射功率
  • 设置基站的接收频点
  • 设置接收频点主要是通过设置radio_0和radio_1的中心频点,并在此基础上设置8个接收信道的偏移来进行的,比如上面的参数,其中radio_0.freq==486600000,radio_1.freq==487400000,这就是radio_0和radio_1的中心频点,下面会根据设置的8个频点的偏移情况来开启8个接收信道,具体体现在

    1. "chan_multiSF_0": {"enable": true, "radio": 0, "if": -300000},
    2. "chan_multiSF_1": {"enable": true, "radio": 0, "if": -100000},
    3. "chan_multiSF_2": {"enable": true, "radio": 0, "if": 100000},
    4. "chan_multiSF_3": {"enable": true, "radio": 0, "if": 300000},
    5. "chan_multiSF_4": {"enable": true, "radio": 1, "if": -300000},
    6. "chan_multiSF_5": {"enable": true, "radio": 1, "if": -100000},
    7. "chan_multiSF_6": {"enable": true, "radio": 1, "if": 100000},
    8. "chan_multiSF_7": {"enable": true, "radio": 1, "if": 300000},

    我们以第一条为例
    chan_multiSF_X,指的是这个频点是可以接收多个SF的,这种频点最多可以有8个,这是由硬件决定的
    enable:true表示这个频点开启
    “radio”:0,表明此信道的中心频点是radio_0的中心频点
    “if”: -300000,表明此信道在中心频点上偏移-300000Hz
    故此条配置的含义是:
    此频点可接收多个SF
    此频点为radio_0.freq-300000=486600000-300000=486300000=486.3MHz
    设置基站的ID
    gateway_conf.gateway_ID即是
    如何设置基站的LoRaWAN NS指向
    gateway_conf.server_address为NS的地址
    gateway_conf.serv_port_up为NS的上行端口
    gateway_conf.serv_port_down为NS的下行端口
    如何设置基站的发射功率
    基站的发射功率

  • 首先是要有个radio的tx_enable是true的,即表示通过此芯片发送下行,这个和硬件- 有关,不过大部分情况下都是radio_0(大家都参考的原厂的参考设计)

  • tx_freq_min,tx_freq_max设置的是发射的最大,最小频点范围
  • tx_gain_lut是tx power的一个具体配置表,也就是说,当基站收到NS的下发命令时,会按照指定功率进行下发,若指定的功率不在这个表里面,那么可能就不会进行下发了,此表为什么这配我也不清楚,一般情况下不要去改动它

参考原文:树莓派-sx1302搭建lorawan网关