Skip to content

Commit c05eb0e

Browse files
committed
v4.0.0
* 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.
1 parent fcd2565 commit c05eb0e

12 files changed

+597
-219
lines changed

PROTOCOL.TXT

+6-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ and associated metadata with the following fields:
131131
Name | Type | Function
132132
:----:|:------:|--------------------------------------------------------------
133133
time | string | UTC time of pkt RX, us precision, ISO 8601 'compact' format
134+
tmms | number | GPS time of pkt RX, number of milliseconds since 06.Jan.1980
134135
tmst | number | Internal timestamp of "RX finished" event (32b unsigned)
135136
freq | number | RX central frequency in MHz (unsigned float, Hz precision)
136137
chan | number | Concentrator "IF" channel used for RX (unsigned integer)
@@ -351,7 +352,7 @@ That object contain a RF packet to be emitted and associated metadata with the f
351352
:----:|:------:|--------------------------------------------------------------
352353
imme | bool | Send packet immediately (will ignore tmst & time)
353354
tmst | number | Send packet on a certain timestamp value (will ignore time)
354-
time | string | Send packet at a certain time (GPS synchronization required)
355+
tmms | number | Send packet at a certain GPS time (GPS synchronization required)
355356
freq | number | TX central frequency in MHz (unsigned float, Hz precision)
356357
rfch | number | Concentrator "RF chain" used for TX (unsigned integer)
357358
powe | number | TX output power in dBm (unsigned integer, dBm precision)
@@ -438,6 +439,10 @@ Examples (white-spaces, indentation and newlines added for readability):
438439
7. Revisions
439440
-------------
440441

442+
### v1.4 ###
443+
* Added "tmms" field for GPS time as a monotonic number of milliseconds
444+
ellapsed since January 6th, 1980 (GPS Epoch). No leap second.
445+
441446
### v1.3 ###
442447

443448
* Added downlink feedback from gateway to server (PULL_RESP -> TX_ACK)

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.0
1+
4.0.0

compile.sh

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
3+
LORA_GATEWAY_DRIVER_PATH=../lora_gateway
4+
5+
TARGET_IP_ADDRESS=192.168.0.1
6+
TARGET_PATH=/home/pi/lora-net
7+
TARGET_USER=pi
8+
9+
clean_all() {
10+
make clean -C $LORA_GATEWAY_DRIVER_PATH
11+
if [ $? != 0 ]
12+
then
13+
echo "ERROR: Failed to clean $LORA_GATEWAY_DRIVER_PATH"
14+
exit 1
15+
fi
16+
make clean
17+
if [ $? != 0 ]
18+
then
19+
exit 1
20+
fi
21+
}
22+
23+
build_all() {
24+
make all -C $LORA_GATEWAY_DRIVER_PATH
25+
if [ $? != 0 ]
26+
then
27+
echo "ERROR: Failed to compile $LORA_GATEWAY_DRIVER_PATH"
28+
exit 1
29+
fi
30+
make all
31+
if [ $? != 0 ]
32+
then
33+
exit 1
34+
fi
35+
}
36+
37+
install() {
38+
scp ./lora_pkt_fwd/lora_pkt_fwd $TARGET_USER@$TARGET_IP_ADDRESS:$TARGET_PATH
39+
if [ $? != 0 ]
40+
then
41+
echo "ERROR: Failed to install the packet forwarder"
42+
echo " target info: $TARGET_IP_ADDRESS, $TARGET_USER, $TARGET_PATH"
43+
exit 1
44+
fi
45+
}
46+
47+
case "$1" in
48+
install)
49+
install
50+
;;
51+
52+
clean)
53+
clean_all
54+
;;
55+
56+
cleanall)
57+
# clean and rebuild
58+
clean_all
59+
build_all
60+
;;
61+
62+
-h)
63+
echo "Compile the complete gateway software (driver & packet forwarder)"
64+
echo "Usage: $0 [clean/cleanall/install]"
65+
exit 1
66+
;;
67+
68+
*)
69+
# rebuild
70+
build_all
71+
;;
72+
esac
73+
74+
exit 0
75+

lora_pkt_fwd/cfg/global_conf.json.PCB_E286.EU868.basic

-28
Original file line numberDiff line numberDiff line change
@@ -166,34 +166,6 @@
166166
"mix_gain": 9,
167167
"rf_power": 20,
168168
"dig_gain": 0
169-
},
170-
"tx_lut_12": {
171-
/* TX gain table, index 12 */
172-
"pa_gain": 3,
173-
"mix_gain": 10,
174-
"rf_power": 23,
175-
"dig_gain": 0
176-
},
177-
"tx_lut_13": {
178-
/* TX gain table, index 13 */
179-
"pa_gain": 3,
180-
"mix_gain": 11,
181-
"rf_power": 25,
182-
"dig_gain": 0
183-
},
184-
"tx_lut_14": {
185-
/* TX gain table, index 14 */
186-
"pa_gain": 3,
187-
"mix_gain": 12,
188-
"rf_power": 26,
189-
"dig_gain": 0
190-
},
191-
"tx_lut_15": {
192-
/* TX gain table, index 15 */
193-
"pa_gain": 3,
194-
"mix_gain": 14,
195-
"rf_power": 27,
196-
"dig_gain": 0
197169
}
198170
},
199171

lora_pkt_fwd/cfg/global_conf.json.PCB_E286.EU868.beacon

+5-29
Original file line numberDiff line numberDiff line change
@@ -166,34 +166,6 @@
166166
"mix_gain": 9,
167167
"rf_power": 20,
168168
"dig_gain": 0
169-
},
170-
"tx_lut_12": {
171-
/* TX gain table, index 12 */
172-
"pa_gain": 3,
173-
"mix_gain": 10,
174-
"rf_power": 23,
175-
"dig_gain": 0
176-
},
177-
"tx_lut_13": {
178-
/* TX gain table, index 13 */
179-
"pa_gain": 3,
180-
"mix_gain": 11,
181-
"rf_power": 25,
182-
"dig_gain": 0
183-
},
184-
"tx_lut_14": {
185-
/* TX gain table, index 14 */
186-
"pa_gain": 3,
187-
"mix_gain": 12,
188-
"rf_power": 26,
189-
"dig_gain": 0
190-
},
191-
"tx_lut_15": {
192-
/* TX gain table, index 15 */
193-
"pa_gain": 3,
194-
"mix_gain": 14,
195-
"rf_power": 27,
196-
"dig_gain": 0
197169
}
198170
},
199171

@@ -219,7 +191,11 @@
219191
"ref_altitude": 0,
220192
/* Beaconing parameters */
221193
"beacon_period": 128,
222-
"beacon_freq_hz": 869525000
194+
"beacon_freq_hz": 869525000,
195+
"beacon_datarate": 9,
196+
"beacon_bw_hz": 125000,
197+
"beacon_power": 14,
198+
"beacon_infodesc": 0
223199
}
224200
}
225201

lora_pkt_fwd/cfg/global_conf.json.PCB_E286.EU868.gps

-28
Original file line numberDiff line numberDiff line change
@@ -166,34 +166,6 @@
166166
"mix_gain": 9,
167167
"rf_power": 20,
168168
"dig_gain": 0
169-
},
170-
"tx_lut_12": {
171-
/* TX gain table, index 12 */
172-
"pa_gain": 3,
173-
"mix_gain": 10,
174-
"rf_power": 23,
175-
"dig_gain": 0
176-
},
177-
"tx_lut_13": {
178-
/* TX gain table, index 13 */
179-
"pa_gain": 3,
180-
"mix_gain": 11,
181-
"rf_power": 25,
182-
"dig_gain": 0
183-
},
184-
"tx_lut_14": {
185-
/* TX gain table, index 14 */
186-
"pa_gain": 3,
187-
"mix_gain": 12,
188-
"rf_power": 26,
189-
"dig_gain": 0
190-
},
191-
"tx_lut_15": {
192-
/* TX gain table, index 15 */
193-
"pa_gain": 3,
194-
"mix_gain": 14,
195-
"rf_power": 27,
196-
"dig_gain": 0
197169
}
198170
},
199171

lora_pkt_fwd/cfg/global_conf.json.PCB_E336.EU868.beacon

+5-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@
231231
"ref_altitude": 0,
232232
/* Beaconing parameters */
233233
"beacon_period": 128,
234-
"beacon_freq_hz": 869525000
234+
"beacon_freq_hz": 869525000,
235+
"beacon_datarate": 9,
236+
"beacon_bw_hz": 125000,
237+
"beacon_power": 14,
238+
"beacon_infodesc": 0
235239
}
236240
}
237241

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"SX1301_conf": {
3+
"lorawan_public": true,
4+
"clksrc": 1, /* radio_1 provides clock to concentrator */
5+
"antenna_gain": 0, /* antenna gain, in dBi */
6+
"radio_0": {
7+
"enable": true,
8+
"type": "SX1257",
9+
"freq": 902700000,
10+
"rssi_offset": -166.0,
11+
"tx_enable": true,
12+
"tx_freq_min": 902000000,
13+
"tx_freq_max": 928000000
14+
},
15+
"radio_1": {
16+
"enable": true,
17+
"type": "SX1257",
18+
"freq": 903400000,
19+
"rssi_offset": -166.0,
20+
"tx_enable": false
21+
},
22+
"chan_multiSF_0": {
23+
/* Lora MAC channel, 125kHz, all SF, 902.3 MHz */
24+
"enable": true,
25+
"radio": 0,
26+
"if": -400000
27+
},
28+
"chan_multiSF_1": {
29+
/* Lora MAC channel, 125kHz, all SF, 902.5 MHz */
30+
"enable": true,
31+
"radio": 0,
32+
"if": -200000
33+
},
34+
"chan_multiSF_2": {
35+
/* Lora MAC channel, 125kHz, all SF, 902.7 MHz */
36+
"enable": true,
37+
"radio": 0,
38+
"if": 0
39+
},
40+
"chan_multiSF_3": {
41+
/* Lora MAC channel, 125kHz, all SF, 902.9 MHz */
42+
"enable": true,
43+
"radio": 0,
44+
"if": 200000
45+
},
46+
"chan_multiSF_4": {
47+
/* Lora MAC channel, 125kHz, all SF, 903.1 MHz */
48+
"enable": true,
49+
"radio": 1,
50+
"if": -300000
51+
},
52+
"chan_multiSF_5": {
53+
/* Lora MAC channel, 125kHz, all SF, 903.3 MHz */
54+
"enable": true,
55+
"radio": 1,
56+
"if": -100000
57+
},
58+
"chan_multiSF_6": {
59+
/* Lora MAC channel, 125kHz, all SF, 903.5 MHz */
60+
"enable": true,
61+
"radio": 1,
62+
"if": 100000
63+
},
64+
"chan_multiSF_7": {
65+
/* Lora MAC channel, 125kHz, all SF, 903.7 MHz */
66+
"enable": true,
67+
"radio": 1,
68+
"if": 300000
69+
},
70+
"chan_Lora_std": {
71+
/* Lora MAC channel, 500kHz, SF8, 903.0 MHz */
72+
"enable": true,
73+
"radio": 0,
74+
"if": 300000,
75+
"bandwidth": 500000,
76+
"spread_factor": 8
77+
},
78+
"chan_FSK": {
79+
/* FSK 100kbps channel, 903.0 MHz */
80+
"enable": false,
81+
"radio": 0,
82+
"if": 300000,
83+
"bandwidth": 250000,
84+
"datarate": 100000
85+
}
86+
},
87+
88+
"gateway_conf": {
89+
"gateway_ID": "AA555A0000000000",
90+
/* change with default server address/ports, or overwrite in local_conf.json */
91+
"server_address": "localhost",
92+
"serv_port_up": 1680,
93+
"serv_port_down": 1680,
94+
/* adjust the following parameters for your network */
95+
"keepalive_interval": 10,
96+
"stat_interval": 30,
97+
"push_timeout_ms": 100,
98+
/* forward only valid packets */
99+
"forward_crc_valid": true,
100+
"forward_crc_error": false,
101+
"forward_crc_disabled": false,
102+
/* GPS configuration */
103+
"gps_tty_path": "/dev/ttyAMA0",
104+
/* GPS reference coordinates */
105+
"ref_latitude": 0.0,
106+
"ref_longitude": 0.0,
107+
"ref_altitude": 0,
108+
/* Beaconing parameters */
109+
"beacon_period": 128,
110+
"beacon_freq_hz": 923300000,
111+
"beacon_freq_nb": 8,
112+
"beacon_freq_step": 600000,
113+
"beacon_datarate": 10,
114+
"beacon_bw_hz": 500000,
115+
"beacon_power": 14,
116+
"beacon_infodesc": 0
117+
}
118+
}
119+

0 commit comments

Comments
 (0)