* Added missing LICENSE.TXT file
* HAL & Packet Forwarder: added support for sx1250-based reference design for
CN490 region
* Packet Forwarder: disabled beaconing by default
This commit is contained in:
Michael Coracin 2019-11-22 16:08:34 +01:00
commit 81e748c904
23 changed files with 306 additions and 48 deletions

View file

@ -62,8 +62,8 @@ install:
install_conf:
@echo "---- Copying packet_forwarder conf files to $(TARGET_IP):$(TARGET_DIR)"
@ssh $(TARGET_USR)@$(TARGET_IP) "mkdir -p $(TARGET_DIR)"
@scp global_conf.json.sx1250 $(TARGET_USR)@$(TARGET_IP):$(TARGET_DIR)
@scp global_conf.json.sx1257 $(TARGET_USR)@$(TARGET_IP):$(TARGET_DIR)
@scp global_conf.json.sx1250.* $(TARGET_USR)@$(TARGET_IP):$(TARGET_DIR)
@scp global_conf.json.sx1257.* $(TARGET_USR)@$(TARGET_IP):$(TARGET_DIR)
else
@echo "ERROR: TARGET_USR is not configured in target.cfg"
endif

View file

@ -41,7 +41,7 @@ losses (no retries).
+- - - - - - - - - - - - - - - -+
__Concentrator__: radio RX/TX board, based on Semtech multichannel modems
(SX130x), transceivers (SX135x) and/or low-power stand-alone modems (SX127x).
(SX130x), transceivers (SX125x) and/or low-power stand-alone modems (SX127x).
__Host__: embedded computer on which the packet forwarder is run. Drives the
concentrator through a SPI link.
@ -224,21 +224,23 @@ That object contains the status of the gateway, with the following fields:
ackr | number | Percentage of upstream datagrams that were acknowledged
dwnb | number | Number of downlink datagrams received (unsigned integer)
txnb | number | Number of packets emitted (unsigned integer)
temp | number | Current temperature in degree celcius (float)
Example (white-spaces, indentation and newlines added for readability):
``` json
{"stat":{
"time":"2014-01-12 08:59:28 GMT",
"lati":46.24000,
"long":3.25230,
"alti":145,
"rxnb":2,
"rxok":2,
"rxfw":2,
"ackr":100.0,
"dwnb":2,
"txnb":2
"time":"2014-01-12 08:59:28 GMT",
"lati":46.24000,
"long":3.25230,
"alti":145,
"rxnb":2,
"rxok":2,
"rxfw":2,
"ackr":100.0,
"dwnb":2,
"txnb":2,
"temp": 23.2
}}
```

View file

@ -0,0 +1,100 @@
{
"SX130x_conf": {
"spidev_path": "/dev/spidev0.0",
"lorawan_public": true,
"clksrc": 0,
"antenna_gain": 0, /* antenna gain, in dBi */
"full_duplex": false,
"precision_timestamp": {
"enable": false,
"max_ts_metrics": 255,
"nb_symbols": 1
},
"radio_0": {
"enable": true,
"type": "SX1250",
"single_input_mode": true,
"freq": 471400000,
"rssi_offset": -207.0,
"rssi_tcomp": {"coeff_a": 0, "coeff_b": 0, "coeff_c": 20.41, "coeff_d": 2162.56, "coeff_e": 0},
"tx_enable": true,
"tx_freq_min": 500000000,
"tx_freq_max": 510000000,
"tx_gain_lut":[
{"rf_power": -6, "pa_gain": 0, "pwr_idx": 0},
{"rf_power": -3, "pa_gain": 0, "pwr_idx": 1},
{"rf_power": 0, "pa_gain": 0, "pwr_idx": 2},
{"rf_power": 3, "pa_gain": 1, "pwr_idx": 3},
{"rf_power": 6, "pa_gain": 1, "pwr_idx": 4},
{"rf_power": 10, "pa_gain": 1, "pwr_idx": 5},
{"rf_power": 11, "pa_gain": 1, "pwr_idx": 6},
{"rf_power": 12, "pa_gain": 2, "pwr_idx": 7},
{"rf_power": 13, "pa_gain": 1, "pwr_idx": 8},
{"rf_power": 14, "pa_gain": 2, "pwr_idx": 9},
{"rf_power": 16, "pa_gain": 2, "pwr_idx": 10},
{"rf_power": 20, "pa_gain": 3, "pwr_idx": 11},
{"rf_power": 23, "pa_gain": 3, "pwr_idx": 12},
{"rf_power": 25, "pa_gain": 3, "pwr_idx": 13},
{"rf_power": 26, "pa_gain": 3, "pwr_idx": 14},
{"rf_power": 27, "pa_gain": 3, "pwr_idx": 15}
]
},
"radio_1": {
"enable": true,
"type": "SX1250",
"single_input_mode": true,
"freq": 475000000,
"rssi_offset": -207.0,
"rssi_tcomp": {"coeff_a": 0, "coeff_b": 0, "coeff_c": 20.41, "coeff_d": 2162.56, "coeff_e": 0},
"tx_enable": false
},
"chan_multiSF_0": {"enable": true, "radio": 0, "if": -300000},
"chan_multiSF_1": {"enable": true, "radio": 0, "if": -100000},
"chan_multiSF_2": {"enable": true, "radio": 0, "if": 100000},
"chan_multiSF_3": {"enable": true, "radio": 0, "if": 300000},
"chan_multiSF_4": {"enable": true, "radio": 1, "if": -300000},
"chan_multiSF_5": {"enable": true, "radio": 1, "if": -100000},
"chan_multiSF_6": {"enable": true, "radio": 1, "if": 100000},
"chan_multiSF_7": {"enable": true, "radio": 1, "if": 300000},
"chan_Lora_std": {"enable": true, "radio": 1, "if": -200000, "bandwidth": 250000, "spread_factor": 7,
"implicit_hdr": false, "implicit_payload_length": 17, "implicit_crc_en": false, "implicit_coderate": 1},
"chan_FSK": {"enable": true, "radio": 1, "if": 300000, "bandwidth": 125000, "datarate": 50000}
},
"gateway_conf": {
"gateway_ID": "AA555A0000000000",
/* change with default server address/ports */
"server_address": "localhost",
"serv_port_up": 1730,
"serv_port_down": 1730,
/* adjust the following parameters for your network */
"keepalive_interval": 10,
"stat_interval": 30,
"push_timeout_ms": 100,
/* forward only valid packets */
"forward_crc_valid": true,
"forward_crc_error": false,
"forward_crc_disabled": false,
/* GPS configuration */
"gps_tty_path": "/dev/ttyS0",
/* GPS reference coordinates */
"ref_latitude": 0.0,
"ref_longitude": 0.0,
"ref_altitude": 0,
/* Beaconing parameters */
"beacon_period": 0,
"beacon_freq_hz": 869525000,
"beacon_datarate": 9,
"beacon_bw_hz": 125000,
"beacon_power": 14,
"beacon_infodesc": 0
},
"debug_conf": {
"ref_payload":[
{"id": "0xCAFE1234"},
{"id": "0xCAFE2345"}
],
"log_file": "loragw_hal.log"
}
}

View file

@ -80,7 +80,7 @@
"ref_longitude": 0.0,
"ref_altitude": 0,
/* Beaconing parameters */
"beacon_period": 128,
"beacon_period": 0,
"beacon_freq_hz": 869525000,
"beacon_datarate": 9,
"beacon_bw_hz": 125000,

View file

@ -80,7 +80,7 @@
"ref_longitude": 0.0,
"ref_altitude": 0,
/* Beaconing parameters */
"beacon_period": 128,
"beacon_period": 0,
"beacon_freq_hz": 869525000,
"beacon_datarate": 9,
"beacon_bw_hz": 125000,

View file

@ -464,6 +464,14 @@ static int parse_SX130x_configuration(const char * conf_file) {
} else {
MSG("WARNING: invalid radio type: %s (should be SX1255 or SX1257 or SX1250)\n", str);
}
snprintf(param_name, sizeof param_name, "radio_%i.single_input_mode", i);
val = json_object_dotget_value(conf_obj, param_name);
if (json_value_get_type(val) == JSONBoolean) {
rfconf.single_input_mode = (bool)json_value_get_boolean(val);
} else {
rfconf.single_input_mode = false;
}
snprintf(param_name, sizeof param_name, "radio_%i.tx_enable", i);
val = json_object_dotget_value(conf_obj, param_name);
if (json_value_get_type(val) == JSONBoolean) {
@ -574,7 +582,7 @@ static int parse_SX130x_configuration(const char * conf_file) {
} else {
rfconf.tx_enable = false;
}
MSG("INFO: radio %i enabled (type %s), center frequency %u, RSSI offset %f, tx enabled %d\n", i, str, rfconf.freq_hz, rfconf.rssi_offset, rfconf.tx_enable);
MSG("INFO: radio %i enabled (type %s), center frequency %u, RSSI offset %f, tx enabled %d, single input mode %d\n", i, str, rfconf.freq_hz, rfconf.rssi_offset, rfconf.tx_enable, rfconf.single_input_mode);
}
/* all parameters parsed, submitting configuration to the HAL */
if (lgw_rxrf_setconf(i, &rfconf) != LGW_HAL_SUCCESS) {
@ -1600,9 +1608,9 @@ int main(int argc, char ** argv)
/* generate a JSON report (will be sent to server by upstream thread) */
pthread_mutex_lock(&mx_stat_rep);
if (((gps_enabled == true) && (coord_ok == true)) || (gps_fake_enable == true)) {
snprintf(status_report, STATUS_SIZE, "\"stat\":{\"time\":\"%s\",\"lati\":%.5f,\"long\":%.5f,\"alti\":%i,\"rxnb\":%u,\"rxok\":%u,\"rxfw\":%u,\"ackr\":%.1f,\"dwnb\":%u,\"txnb\":%u}", stat_timestamp, cp_gps_coord.lat, cp_gps_coord.lon, cp_gps_coord.alt, cp_nb_rx_rcv, cp_nb_rx_ok, cp_up_pkt_fwd, 100.0 * up_ack_ratio, cp_dw_dgram_rcv, cp_nb_tx_ok);
snprintf(status_report, STATUS_SIZE, "\"stat\":{\"time\":\"%s\",\"lati\":%.5f,\"long\":%.5f,\"alti\":%i,\"rxnb\":%u,\"rxok\":%u,\"rxfw\":%u,\"ackr\":%.1f,\"dwnb\":%u,\"txnb\":%u,\"temp\":%.1f}", stat_timestamp, cp_gps_coord.lat, cp_gps_coord.lon, cp_gps_coord.alt, cp_nb_rx_rcv, cp_nb_rx_ok, cp_up_pkt_fwd, 100.0 * up_ack_ratio, cp_dw_dgram_rcv, cp_nb_tx_ok, temperature);
} else {
snprintf(status_report, STATUS_SIZE, "\"stat\":{\"time\":\"%s\",\"rxnb\":%u,\"rxok\":%u,\"rxfw\":%u,\"ackr\":%.1f,\"dwnb\":%u,\"txnb\":%u}", stat_timestamp, cp_nb_rx_rcv, cp_nb_rx_ok, cp_up_pkt_fwd, 100.0 * up_ack_ratio, cp_dw_dgram_rcv, cp_nb_tx_ok);
snprintf(status_report, STATUS_SIZE, "\"stat\":{\"time\":\"%s\",\"rxnb\":%u,\"rxok\":%u,\"rxfw\":%u,\"ackr\":%.1f,\"dwnb\":%u,\"txnb\":%u,\"temp\":%.1f}", stat_timestamp, cp_nb_rx_rcv, cp_nb_rx_ok, cp_up_pkt_fwd, 100.0 * up_ack_ratio, cp_dw_dgram_rcv, cp_nb_tx_ok, temperature);
}
report_ready = true;
pthread_mutex_unlock(&mx_stat_rep);