Skip to content

Commit

Permalink
v4.0.0
Browse files Browse the repository at this point in the history
* Added Class-B support, as defined in LoRaWAN v1.1
* Downlink only support "tmst" or "tmms" timestamp. "time" is not supported
anymore ("time" field is kept in Uplink as an informative field).
* Reworked thread_gps to handle GPS UBX messages for native GPS time.
* Updated Gateway <-> NetworkServer protocol to describe the new "tmms" field.
* Updated global_conf.PCB286*.json to remove indexes of the TX gain LUT above
20dBm. Use PCB336 (aka GW v1.5) to comply with ETSI TX mask between 20dBm and
27dBm.
  • Loading branch information
mcoracin committed Feb 17, 2017
1 parent fcd2565 commit c05eb0e
Show file tree
Hide file tree
Showing 12 changed files with 597 additions and 219 deletions.
7 changes: 6 additions & 1 deletion PROTOCOL.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ and associated metadata with the following fields:
Name | Type | Function
:----:|:------:|--------------------------------------------------------------
time | string | UTC time of pkt RX, us precision, ISO 8601 'compact' format
tmms | number | GPS time of pkt RX, number of milliseconds since 06.Jan.1980
tmst | number | Internal timestamp of "RX finished" event (32b unsigned)
freq | number | RX central frequency in MHz (unsigned float, Hz precision)
chan | number | Concentrator "IF" channel used for RX (unsigned integer)
Expand Down Expand Up @@ -351,7 +352,7 @@ That object contain a RF packet to be emitted and associated metadata with the f
:----:|:------:|--------------------------------------------------------------
imme | bool | Send packet immediately (will ignore tmst & time)
tmst | number | Send packet on a certain timestamp value (will ignore time)
time | string | Send packet at a certain time (GPS synchronization required)
tmms | number | Send packet at a certain GPS time (GPS synchronization required)
freq | number | TX central frequency in MHz (unsigned float, Hz precision)
rfch | number | Concentrator "RF chain" used for TX (unsigned integer)
powe | number | TX output power in dBm (unsigned integer, dBm precision)
Expand Down Expand Up @@ -438,6 +439,10 @@ Examples (white-spaces, indentation and newlines added for readability):
7. Revisions
-------------

### v1.4 ###
* Added "tmms" field for GPS time as a monotonic number of milliseconds
ellapsed since January 6th, 1980 (GPS Epoch). No leap second.

### v1.3 ###

* Added downlink feedback from gateway to server (PULL_RESP -> TX_ACK)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0
4.0.0
75 changes: 75 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash

LORA_GATEWAY_DRIVER_PATH=../lora_gateway

TARGET_IP_ADDRESS=192.168.0.1
TARGET_PATH=/home/pi/lora-net
TARGET_USER=pi

clean_all() {
make clean -C $LORA_GATEWAY_DRIVER_PATH
if [ $? != 0 ]
then
echo "ERROR: Failed to clean $LORA_GATEWAY_DRIVER_PATH"
exit 1
fi
make clean
if [ $? != 0 ]
then
exit 1
fi
}

build_all() {
make all -C $LORA_GATEWAY_DRIVER_PATH
if [ $? != 0 ]
then
echo "ERROR: Failed to compile $LORA_GATEWAY_DRIVER_PATH"
exit 1
fi
make all
if [ $? != 0 ]
then
exit 1
fi
}

install() {
scp ./lora_pkt_fwd/lora_pkt_fwd $TARGET_USER@$TARGET_IP_ADDRESS:$TARGET_PATH
if [ $? != 0 ]
then
echo "ERROR: Failed to install the packet forwarder"
echo " target info: $TARGET_IP_ADDRESS, $TARGET_USER, $TARGET_PATH"
exit 1
fi
}

case "$1" in
install)
install
;;

clean)
clean_all
;;

cleanall)
# clean and rebuild
clean_all
build_all
;;

-h)
echo "Compile the complete gateway software (driver & packet forwarder)"
echo "Usage: $0 [clean/cleanall/install]"
exit 1
;;

*)
# rebuild
build_all
;;
esac

exit 0

28 changes: 0 additions & 28 deletions lora_pkt_fwd/cfg/global_conf.json.PCB_E286.EU868.basic
Original file line number Diff line number Diff line change
Expand Up @@ -166,34 +166,6 @@
"mix_gain": 9,
"rf_power": 20,
"dig_gain": 0
},
"tx_lut_12": {
/* TX gain table, index 12 */
"pa_gain": 3,
"mix_gain": 10,
"rf_power": 23,
"dig_gain": 0
},
"tx_lut_13": {
/* TX gain table, index 13 */
"pa_gain": 3,
"mix_gain": 11,
"rf_power": 25,
"dig_gain": 0
},
"tx_lut_14": {
/* TX gain table, index 14 */
"pa_gain": 3,
"mix_gain": 12,
"rf_power": 26,
"dig_gain": 0
},
"tx_lut_15": {
/* TX gain table, index 15 */
"pa_gain": 3,
"mix_gain": 14,
"rf_power": 27,
"dig_gain": 0
}
},

Expand Down
34 changes: 5 additions & 29 deletions lora_pkt_fwd/cfg/global_conf.json.PCB_E286.EU868.beacon
Original file line number Diff line number Diff line change
Expand Up @@ -166,34 +166,6 @@
"mix_gain": 9,
"rf_power": 20,
"dig_gain": 0
},
"tx_lut_12": {
/* TX gain table, index 12 */
"pa_gain": 3,
"mix_gain": 10,
"rf_power": 23,
"dig_gain": 0
},
"tx_lut_13": {
/* TX gain table, index 13 */
"pa_gain": 3,
"mix_gain": 11,
"rf_power": 25,
"dig_gain": 0
},
"tx_lut_14": {
/* TX gain table, index 14 */
"pa_gain": 3,
"mix_gain": 12,
"rf_power": 26,
"dig_gain": 0
},
"tx_lut_15": {
/* TX gain table, index 15 */
"pa_gain": 3,
"mix_gain": 14,
"rf_power": 27,
"dig_gain": 0
}
},

Expand All @@ -219,7 +191,11 @@
"ref_altitude": 0,
/* Beaconing parameters */
"beacon_period": 128,
"beacon_freq_hz": 869525000
"beacon_freq_hz": 869525000,
"beacon_datarate": 9,
"beacon_bw_hz": 125000,
"beacon_power": 14,
"beacon_infodesc": 0
}
}

28 changes: 0 additions & 28 deletions lora_pkt_fwd/cfg/global_conf.json.PCB_E286.EU868.gps
Original file line number Diff line number Diff line change
Expand Up @@ -166,34 +166,6 @@
"mix_gain": 9,
"rf_power": 20,
"dig_gain": 0
},
"tx_lut_12": {
/* TX gain table, index 12 */
"pa_gain": 3,
"mix_gain": 10,
"rf_power": 23,
"dig_gain": 0
},
"tx_lut_13": {
/* TX gain table, index 13 */
"pa_gain": 3,
"mix_gain": 11,
"rf_power": 25,
"dig_gain": 0
},
"tx_lut_14": {
/* TX gain table, index 14 */
"pa_gain": 3,
"mix_gain": 12,
"rf_power": 26,
"dig_gain": 0
},
"tx_lut_15": {
/* TX gain table, index 15 */
"pa_gain": 3,
"mix_gain": 14,
"rf_power": 27,
"dig_gain": 0
}
},

Expand Down
6 changes: 5 additions & 1 deletion lora_pkt_fwd/cfg/global_conf.json.PCB_E336.EU868.beacon
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@
"ref_altitude": 0,
/* Beaconing parameters */
"beacon_period": 128,
"beacon_freq_hz": 869525000
"beacon_freq_hz": 869525000,
"beacon_datarate": 9,
"beacon_bw_hz": 125000,
"beacon_power": 14,
"beacon_infodesc": 0
}
}

119 changes: 119 additions & 0 deletions lora_pkt_fwd/cfg/global_conf.json.US902.beacon
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"SX1301_conf": {
"lorawan_public": true,
"clksrc": 1, /* radio_1 provides clock to concentrator */
"antenna_gain": 0, /* antenna gain, in dBi */
"radio_0": {
"enable": true,
"type": "SX1257",
"freq": 902700000,
"rssi_offset": -166.0,
"tx_enable": true,
"tx_freq_min": 902000000,
"tx_freq_max": 928000000
},
"radio_1": {
"enable": true,
"type": "SX1257",
"freq": 903400000,
"rssi_offset": -166.0,
"tx_enable": false
},
"chan_multiSF_0": {
/* Lora MAC channel, 125kHz, all SF, 902.3 MHz */
"enable": true,
"radio": 0,
"if": -400000
},
"chan_multiSF_1": {
/* Lora MAC channel, 125kHz, all SF, 902.5 MHz */
"enable": true,
"radio": 0,
"if": -200000
},
"chan_multiSF_2": {
/* Lora MAC channel, 125kHz, all SF, 902.7 MHz */
"enable": true,
"radio": 0,
"if": 0
},
"chan_multiSF_3": {
/* Lora MAC channel, 125kHz, all SF, 902.9 MHz */
"enable": true,
"radio": 0,
"if": 200000
},
"chan_multiSF_4": {
/* Lora MAC channel, 125kHz, all SF, 903.1 MHz */
"enable": true,
"radio": 1,
"if": -300000
},
"chan_multiSF_5": {
/* Lora MAC channel, 125kHz, all SF, 903.3 MHz */
"enable": true,
"radio": 1,
"if": -100000
},
"chan_multiSF_6": {
/* Lora MAC channel, 125kHz, all SF, 903.5 MHz */
"enable": true,
"radio": 1,
"if": 100000
},
"chan_multiSF_7": {
/* Lora MAC channel, 125kHz, all SF, 903.7 MHz */
"enable": true,
"radio": 1,
"if": 300000
},
"chan_Lora_std": {
/* Lora MAC channel, 500kHz, SF8, 903.0 MHz */
"enable": true,
"radio": 0,
"if": 300000,
"bandwidth": 500000,
"spread_factor": 8
},
"chan_FSK": {
/* FSK 100kbps channel, 903.0 MHz */
"enable": false,
"radio": 0,
"if": 300000,
"bandwidth": 250000,
"datarate": 100000
}
},

"gateway_conf": {
"gateway_ID": "AA555A0000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "localhost",
"serv_port_up": 1680,
"serv_port_down": 1680,
/* 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/ttyAMA0",
/* GPS reference coordinates */
"ref_latitude": 0.0,
"ref_longitude": 0.0,
"ref_altitude": 0,
/* Beaconing parameters */
"beacon_period": 128,
"beacon_freq_hz": 923300000,
"beacon_freq_nb": 8,
"beacon_freq_step": 600000,
"beacon_datarate": 10,
"beacon_bw_hz": 500000,
"beacon_power": 14,
"beacon_infodesc": 0
}
}

Loading

0 comments on commit c05eb0e

Please sign in to comment.