Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
- Update README
- update help message
  • Loading branch information
JiapengLi committed Mar 19, 2018
1 parent d58a108 commit 9d9ab7e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
44 changes: 30 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ With lorawan-parser, one could see all details of LoRaWAN, like how frames are d
- [x] Support both ABP and OTAA mode device
- [x] Colorful terminal outputs (Windows MiniTTY not supported)
- [X] Cross platform (Tested on Ubuntu, Lubuntu, Raspberry Pi, OpenWRT, Windows)
- [ ] Support LoRaWAN 1.0.2 protocol
- [x] Support LoRaWAN 1.0.2 protocol
- [ ] Support Semtech packet forwarder v1 and v2 protocol
- [ ] Live parse LoRaWAN motes message (To support Semtech IoT Start Kit)
- [ ] Live parse LoRaWAN motes message (To support RisingHF gateway or Semtech IoT Start Kit)

## Usage

Expand All @@ -22,16 +22,17 @@ After compile find `lwp.exe/lwp` under `util/parser/` directory to parse the LoR

```
--------------------------------------------------------------------------------
Usage: lwp [OPTIONS]
Usage: lwp.exe [OPTIONS]
-h, --help Help
-v, --version Version 0.2.0
-v, --version Version 0.3.0
--------------------------------------------------------------------------------
-c, --burst-parse <file> Parse lwp json format file
-m, --maccmd <hex> Parse MAC command
-p, --parse [hex] Parse packet
-g, --pack [hex] Generate packet
-f, --pktfwd [file] Packet forwarder mode
--join Analyze JR and JA
--------------------------------------------------------------------------------
-B, --band <string> PHY band EU868/US915/EU434/AU920/CN780/CN470
Expand Down Expand Up @@ -63,26 +64,21 @@ Usage: lwp [OPTIONS]
--rx1droft <int> RX1DRoffset (0~7)
--rx2dr <int> RX2DataRate (0~15)
--rxdelay <int> RxDelay (0~15)
--jr <hex> JoinRequest raw data
--ja <hex> JoinAccept raw data
--------------------------------------------------------------------------------
--motes <file> Motes/Nodes JSON file
--nodes <file> Same as --motes
--------------------------------------------------------------------------------
-b, --board <file> Board specific TX power table and RSSI offset
-i, --iface <string> Network interface, default eth0
--------------------------------------------------------------------------------
Default AppKey/NwkSKey/AppSKey 2B7E151628AED2A6ABF7158809CF4F3C
```

### Burst Parse LoRaWAN Frame
```
$ ./lwp -c lwp-config.json
```

To go further, user could fill their own LoRaWAN frames in a json file to parse it.

### Pack LoRaWAN frame
```
# Unconfirmed uplink
Expand Down Expand Up @@ -118,7 +114,23 @@ $ ./lwp --parse "40 11 11 11 01 A0 59 04 02 0F A0 9D 7C 61 F3 FA B7"
$ lwp -T CD -m "02 30 01"
```

### Parse JoinRequest and JoinAccept

```
# Parse JR/JA pair
$ ./lwp --join --jr "0001000000000000860100000000000086F79FB4C20660" --ja "202D9583ABA736C80F9700DB420A010554" --appkey "86000000000000008600000000000000"
```

### Burst Parse LoRaWAN Frame

```
$ ./lwp -c lwp-config.json
```

To go further, user could fill their own LoRaWAN frames in a json file to parse it.

### Packet Forwarder Mode

```
$ ./lwp --pktfwd global_conf.template.json --board lwp-board.json --iface eth0
```
Expand All @@ -129,6 +141,9 @@ $ ./lwp --pktfwd global_conf.template.json --board lwp-board.json --iface eth0

Depends on tools *libtool*, *automake*. To build:

# install tools if it is not there
sudo apt-get install autoconf libtool

cd lorawan-parser
autoreconf -i
./configure
Expand Down Expand Up @@ -167,7 +182,7 @@ Add below path to system $PATH

// 64bits
$YOUR_PATH/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin

// 32bits
$YOUR_PATH/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin

Expand Down Expand Up @@ -204,4 +219,5 @@ parson, AES, CMAC have its own licenses. Please follow links below to get the de
+ Brian Gladman. AES library http://www.gladman.me.uk/
+ Lander Casado, Philippas Tsigas. CMAC library http://www.cse.chalmers.se/research/group/dcs/masters/contikisec/
+ diabloneo timespec_diff gitst https://gist.github.com/diabloneo/9619917
+ CCAN (json libary is from CCAN project) https://ccodearchive.net/
+ CCAN (json libary is from CCAN project) https://ccodearchive.net/

3 changes: 3 additions & 0 deletions util/parser/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void usage(char *name)
log_puts(LOG_NORMAL, " -p, --parse [hex] Parse packet");
log_puts(LOG_NORMAL, " -g, --pack [hex] Generate packet");
log_puts(LOG_NORMAL, " -f, --pktfwd [file] Packet forwarder mode");
log_puts(LOG_NORMAL, " --join Analyze JR and JA");
log_line();
log_puts(LOG_NORMAL, " -B, --band <string> PHY band EU868/US915/EU434/AU920/CN780/CN470");
log_puts(LOG_NORMAL, " -N, --nwkskey <hex> NwkSKey");
Expand Down Expand Up @@ -64,6 +65,8 @@ void usage(char *name)
log_puts(LOG_NORMAL, " --rx1droft <int> RX1DRoffset (0~7)");
log_puts(LOG_NORMAL, " --rx2dr <int> RX2DataRate (0~15)");
log_puts(LOG_NORMAL, " --rxdelay <int> RxDelay (0~15)");
log_puts(LOG_NORMAL, " --jr <hex> JoinRequest raw data");
log_puts(LOG_NORMAL, " --ja <hex> JoinAccept raw data");
log_line();
log_puts(LOG_NORMAL, " --motes <file> Motes/Nodes JSON file");
log_puts(LOG_NORMAL, " --nodes <file> Same as --motes");
Expand Down
4 changes: 2 additions & 2 deletions util/parser/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __VERSIONING__

#define VMAJOR (0)
#define VMINOR (2)
#define VPATCH (1)
#define VMINOR (3)
#define VPATCH (0)

#endif // __VERSIONING__

0 comments on commit 9d9ab7e

Please sign in to comment.