Skip to content

Commit

Permalink
v3.0.0
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
mcoracin committed Jun 6, 2016
1 parent 28df8c0 commit f31ee2e
Show file tree
Hide file tree
Showing 56 changed files with 4,886 additions and 10,438 deletions.
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ export
### general build targets

all:
$(MAKE) all -e -C basic_pkt_fwd
$(MAKE) all -e -C gps_pkt_fwd
$(MAKE) all -e -C beacon_pkt_fwd
$(MAKE) all -e -C lora_pkt_fwd
$(MAKE) all -e -C util_ack
$(MAKE) all -e -C util_sink
$(MAKE) all -e -C util_tx_test

clean:
$(MAKE) clean -e -C basic_pkt_fwd
$(MAKE) clean -e -C gps_pkt_fwd
$(MAKE) clean -e -C beacon_pkt_fwd
$(MAKE) clean -e -C lora_pkt_fwd
$(MAKE) clean -e -C util_ack
$(MAKE) clean -e -C util_sink
$(MAKE) clean -e -C util_tx_test
Expand Down
70 changes: 62 additions & 8 deletions PROTOCOL.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ received, and associated metadata, to the server.

Bytes | Function
:------:|---------------------------------------------------------------------
0 | protocol version = 1
0 | protocol version = 2
1-2 | random token
3 | PUSH_DATA identifier 0x00
4-11 | Gateway unique identifier (MAC address)
Expand All @@ -109,7 +109,7 @@ PUSH_DATA packets received.

Bytes | Function
:------:|---------------------------------------------------------------------
0 | protocol version = 1
0 | protocol version = 2
1-2 | same token as the PUSH_DATA packet to acknowledge
3 | PUSH_ACK identifier 0x01

Expand Down Expand Up @@ -269,9 +269,11 @@ Example (white-spaces, indentation and newlines added for readability):
| | Anytime after first PULL_DATA for each packet to TX |-|
| ------------------------------------------------------- |
| |
| PULL_RESP (token 0, JSON payload) |
| PULL_RESP (token Z, JSON payload) |
|<-------------------------------------------------------------|
| |
| TX_ACK (token Z, JSON payload) |
|------------------------------------------------------------->|

### 5.2. PULL_DATA packet ###

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

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

Bytes | Function
:------:|---------------------------------------------------------------------
0 | protocol version = 1
0 | protocol version = 2
1-2 | same token as the PULL_DATA packet to acknowledge
3 | PULL_ACK identifier 0x04

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

Bytes | Function
:------:|---------------------------------------------------------------------
0 | protocol version = 1
1-2 | unused bytes
0 | protocol version = 2
1-2 | random token
3 | PULL_RESP identifier 0x03
4-end | JSON object, starting with {, ending with }, see section 6

### 5.5. TX_ACK packet ###

That packet type is used by the gateway to send a feedback to the server
to inform if a downlink request has been accepted or rejected by the gateway.
The datagram may optionnaly contain a JSON string to give more details on
acknoledge. If no JSON is present (empty string), this means than no error
occured.

Bytes | Function
:------:|---------------------------------------------------------------------
0 | protocol version = 2
1-2 | same token as the PULL_RESP packet to acknowledge
3 | TX_ACK identifier 0x05
4-end | [optional] JSON object, starting with {, ending with }, see section 6

6. Downstream JSON data structure
----------------------------------

The root object must contain an object named "txpk":
The root object of PULL_RESP packet must contain an object named "txpk":

``` json
{
Expand Down Expand Up @@ -383,10 +399,48 @@ Examples (white-spaces, indentation and newlines added for readability):
}}
```

The root object of TX_ACK packet must contain an object named "txpk_ack":

``` json
{
"txpk_ack": {...}
}
```

That object contain status information concerning the associated PULL_RESP packet.

Name | Type | Function
:----:|:------:|------------------------------------------------------------------------------
error | string | Indication about success or type of failure that occured for downlink request.

The possible values of "error" field are:

Value | Definition
:-----------------:|---------------------------------------------------------------------
NONE | Packet has been programmed for downlink
TOO_LATE | Rejected because it was already too late to program this packet for downlink
TOO_EARLY | Rejected because downlink packet timestamp is too much in advance
COLLISION_PACKET | Rejected because there was already a packet programmed in requested timeframe
COLLISION_BEACON | Rejected because there was already a beacon planned in requested timeframe
TX_FREQ | Rejected because requested frequency is not supported by TX RF chain
TX_POWER | Rejected because requested power is not supported by gateway
GPS_UNLOCKED | Rejected because GPS is unlocked, so GPS timestamp cannot be used

Examples (white-spaces, indentation and newlines added for readability):

``` json
{"txpk_ack":{
"error":"COLLISION_PACKET"
}}
```

7. Revisions
-------------

### v1.3 ###

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

### v1.2 ###

* Added value of FSK bitrate for upstream.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
3.0.0
66 changes: 0 additions & 66 deletions basic_pkt_fwd/Makefile

This file was deleted.

62 changes: 0 additions & 62 deletions basic_pkt_fwd/inc/base64.h

This file was deleted.

Loading

0 comments on commit f31ee2e

Please sign in to comment.