Skip to content

Commit f31ee2e

Browse files
committed
v3.0.0
* Merged all different flavours of packet forwarder into one unique lora_pkt_fwd Note: Various flavours can still be achieved using the corresponding global_conf.json.XXX file provided in lora_pkt_fwd/cfg. * Added downlink "just-in-time" scheduling to optimize downlink capacity. * Updated Gateway <-> NetworkServer protocol to describe the new format of "tx_ack" message. * Added "Listen-Before-Talk" configuration. * Splitted reset_pkt_fwd.sh script in 2 different scripts: - reset_lgw.sh, provided with the HAL (lora_gateway) - update_gwid.sh, provided with lora_pkt_fwd WARNING: Gateway <-> Network Server protocol version has changed. Please refer to PROTOCOL.txt file.
1 parent 28df8c0 commit f31ee2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+4886
-10438
lines changed

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@ export
88
### general build targets
99

1010
all:
11-
$(MAKE) all -e -C basic_pkt_fwd
12-
$(MAKE) all -e -C gps_pkt_fwd
13-
$(MAKE) all -e -C beacon_pkt_fwd
11+
$(MAKE) all -e -C lora_pkt_fwd
1412
$(MAKE) all -e -C util_ack
1513
$(MAKE) all -e -C util_sink
1614
$(MAKE) all -e -C util_tx_test
1715

1816
clean:
19-
$(MAKE) clean -e -C basic_pkt_fwd
20-
$(MAKE) clean -e -C gps_pkt_fwd
21-
$(MAKE) clean -e -C beacon_pkt_fwd
17+
$(MAKE) clean -e -C lora_pkt_fwd
2218
$(MAKE) clean -e -C util_ack
2319
$(MAKE) clean -e -C util_sink
2420
$(MAKE) clean -e -C util_tx_test

PROTOCOL.TXT

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ received, and associated metadata, to the server.
9696

9797
Bytes | Function
9898
:------:|---------------------------------------------------------------------
99-
0 | protocol version = 1
99+
0 | protocol version = 2
100100
1-2 | random token
101101
3 | PUSH_DATA identifier 0x00
102102
4-11 | Gateway unique identifier (MAC address)
@@ -109,7 +109,7 @@ PUSH_DATA packets received.
109109

110110
Bytes | Function
111111
:------:|---------------------------------------------------------------------
112-
0 | protocol version = 1
112+
0 | protocol version = 2
113113
1-2 | same token as the PUSH_DATA packet to acknowledge
114114
3 | PUSH_ACK identifier 0x01
115115

@@ -269,9 +269,11 @@ Example (white-spaces, indentation and newlines added for readability):
269269
| | Anytime after first PULL_DATA for each packet to TX |-|
270270
| ------------------------------------------------------- |
271271
| |
272-
| PULL_RESP (token 0, JSON payload) |
272+
| PULL_RESP (token Z, JSON payload) |
273273
|<-------------------------------------------------------------|
274274
| |
275+
| TX_ACK (token Z, JSON payload) |
276+
|------------------------------------------------------------->|
275277

276278
### 5.2. PULL_DATA packet ###
277279

@@ -288,7 +290,7 @@ route stays open for the server to be used at any time.
288290

289291
Bytes | Function
290292
:------:|---------------------------------------------------------------------
291-
0 | protocol version = 1
293+
0 | protocol version = 2
292294
1-2 | random token
293295
3 | PULL_DATA identifier 0x02
294296
4-11 | Gateway unique identifier (MAC address)
@@ -300,7 +302,7 @@ open and that the server can send PULL_RESP packets at any time.
300302

301303
Bytes | Function
302304
:------:|---------------------------------------------------------------------
303-
0 | protocol version = 1
305+
0 | protocol version = 2
304306
1-2 | same token as the PULL_DATA packet to acknowledge
305307
3 | PULL_ACK identifier 0x04
306308

@@ -311,16 +313,30 @@ metadata that will have to be emitted by the gateway.
311313

312314
Bytes | Function
313315
:------:|---------------------------------------------------------------------
314-
0 | protocol version = 1
315-
1-2 | unused bytes
316+
0 | protocol version = 2
317+
1-2 | random token
316318
3 | PULL_RESP identifier 0x03
317319
4-end | JSON object, starting with {, ending with }, see section 6
318320

321+
### 5.5. TX_ACK packet ###
322+
323+
That packet type is used by the gateway to send a feedback to the server
324+
to inform if a downlink request has been accepted or rejected by the gateway.
325+
The datagram may optionnaly contain a JSON string to give more details on
326+
acknoledge. If no JSON is present (empty string), this means than no error
327+
occured.
328+
329+
Bytes | Function
330+
:------:|---------------------------------------------------------------------
331+
0 | protocol version = 2
332+
1-2 | same token as the PULL_RESP packet to acknowledge
333+
3 | TX_ACK identifier 0x05
334+
4-end | [optional] JSON object, starting with {, ending with }, see section 6
319335

320336
6. Downstream JSON data structure
321337
----------------------------------
322338

323-
The root object must contain an object named "txpk":
339+
The root object of PULL_RESP packet must contain an object named "txpk":
324340

325341
``` json
326342
{
@@ -383,10 +399,48 @@ Examples (white-spaces, indentation and newlines added for readability):
383399
}}
384400
```
385401

402+
The root object of TX_ACK packet must contain an object named "txpk_ack":
403+
404+
``` json
405+
{
406+
"txpk_ack": {...}
407+
}
408+
```
409+
410+
That object contain status information concerning the associated PULL_RESP packet.
411+
412+
Name | Type | Function
413+
:----:|:------:|------------------------------------------------------------------------------
414+
error | string | Indication about success or type of failure that occured for downlink request.
415+
416+
The possible values of "error" field are:
417+
418+
Value | Definition
419+
:-----------------:|---------------------------------------------------------------------
420+
NONE | Packet has been programmed for downlink
421+
TOO_LATE | Rejected because it was already too late to program this packet for downlink
422+
TOO_EARLY | Rejected because downlink packet timestamp is too much in advance
423+
COLLISION_PACKET | Rejected because there was already a packet programmed in requested timeframe
424+
COLLISION_BEACON | Rejected because there was already a beacon planned in requested timeframe
425+
TX_FREQ | Rejected because requested frequency is not supported by TX RF chain
426+
TX_POWER | Rejected because requested power is not supported by gateway
427+
GPS_UNLOCKED | Rejected because GPS is unlocked, so GPS timestamp cannot be used
428+
429+
Examples (white-spaces, indentation and newlines added for readability):
430+
431+
``` json
432+
{"txpk_ack":{
433+
"error":"COLLISION_PACKET"
434+
}}
435+
```
386436

387437
7. Revisions
388438
-------------
389439

440+
### v1.3 ###
441+
442+
* Added downlink feedback from gateway to server (PULL_RESP -> TX_ACK)
443+
390444
### v1.2 ###
391445

392446
* Added value of FSK bitrate for upstream.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.1
1+
3.0.0

basic_pkt_fwd/Makefile

Lines changed: 0 additions & 66 deletions
This file was deleted.

basic_pkt_fwd/inc/base64.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)