PCR2 Command Line Interface
V4.1 | V4.0
Changes made in this version of the document.
- Removed command
set rtlandset ltr. Useclearto reset counters. - Removed command
set intervalandget interval. Uselora get intervalandlora set intervalinstead.
Introduction
This manual describes the command line interface (CLI) of Parametric PCR2 people counters with LoRaWAN® and PCR2 Firmware V4.1.
The command line interface commands can be used for initial setup of the device. We recommend using PPX Product Explorer as for setting up your device.
Connecting the device
Connect your PCR2 with an USB cable to your PC and open a terminal emulation program such as RealTerm or PuTTY on Windows10.
Serial Port Settings
- Baudrate: 19200
- Databits: 8
- Parity: None
- Stopbits: 0
Command Format
Device settings can be changed by a set and get commands, as well as a few special commands such as restart.
All commands need to be terminated by \r\n (Carriage Return + Linefeed).
Command List
The complete list of supported CLI commands. help prints the same list to the console.
Application Status Commands
| Command | Args | Description | Example |
|---|---|---|---|
get typestr |
Get Device Type e.g. PCR2-EU868-IN | get typestrPCR2-EU868-ODS |
|
get status |
Get Device Status (0=OK) | get status0 |
|
get serial |
Get the unique serial number | get serial3434333575376517 |
|
get fw_version |
Get firmware version | get fw_version4.0.0 |
Application Settings Commands
| Command | Args | Description | Example |
|---|---|---|---|
get mode |
Get current uplink mode | get mode0 |
|
set mode [mode] |
Set uplink mode 0 = Timespan 1 = NotZero 2 = Trigger 3 = CapAlert |
Change operation mode | set mode 00 |
get ltr |
Get Left-to-right counter value | get ltr2 |
|
get rtl |
Get Right-to-left counter value | get rtl5 |
|
get sumup |
Check if Sum Up is active (1 = active) | get sumup1 |
|
set sumup [ena] |
Enable Sum Up Counter (1 = active) | set sumup 11 |
|
get holdoff |
Get current holdoff timer setting | get hold1 |
|
set holdoff [s] |
0...600 (0 = off) | Set holdoff timer in seconds | set hold 11 |
get timeout |
Get current auto-zero timeout in minutes | get timeout120 |
|
set timeout [min] |
0...1440 (0=off) | Set auto-zero timeout in minutes | set timeout 120120 |
get lim |
Get current capacity limit setting PCR2-XIO only |
get lim0 |
|
set lim [people] |
0...65535 | Set capacity limit PCR2-XIO only |
set lim 100100 |
get xiomode |
Get current XIO settings PCR2-XIO only |
get xiomode0 |
|
set xiomode [mode] |
0 : Off 1 : Pulse 2 : Bounce 3 : Capacity 4 : RC |
Set XIO mode PCR2-XIO only |
set xiomode 00 |
Radar Processor Settings Commands
| Command | Args | Description | Example |
|---|---|---|---|
radar get enabled |
Check if radar module is enabled | radar get enabled1 |
|
radar set enabled [on] |
0 = disabled 1 = enabled |
Enable/Disable radar module | radar set enabled 11 |
radar get channel |
Get radar channel | radar get channel0 |
|
radar set channel [ch] |
0 = LOW Frequency 1 = HIGH Frequency |
Change radar frequency | radar set channel 11 |
radar get autotune |
Check if Autotuning mode is on | radar get autotune0 |
|
radar set autotune [on] |
0 = disabled 1 = enabled |
Enable/Disable Autotuning | radar set autotune 11 |
radar get sens |
Get current radar sensitivity setting | radar get sens50 |
|
radar set sens [sensitivity] |
10 … 100% (100% is very sensitive) |
Set sensitivity setting | radar set sens 6565 |
radar get beam |
Get current radar beam width | radar get beam40 |
|
radar set beam [angle] |
80...30° | Set radar beam width | radar set beam 3030 |
radar get dir |
Get current radar sensitivity setting | radar get dir0 |
|
radar set dir [angle] |
-30...30° | Set radar beam direction (<0 = to LTR direction) | radar set dir -10-10 |
radar get mindist |
Get minimal distance to target object in centimeter | radar get mindist200 |
|
radar set mindist [cm] |
Set minimal distance to target object | radar get mindist 190190 |
|
radar get maxdist |
Get maximum distance to target object in centimeter | radar get maxdist500 |
|
radar set maxdist [cm] |
Change maximum distance to target object | radar set maxdist 400400 |
LoRa Modem Settings Commands
| Command | Args | Description | Example |
|---|---|---|---|
lora get enabled |
Check if LoRa Modem is enabled (online mode) | lora get enabled1 |
|
lora set enabled [on] |
0 = off 1 = on |
Enable LoRaWAN® modem (offline mode) | lora set enabled 11 |
lora get interval |
Get current uplink interval | lora get interval10 |
|
lora set interval [min] |
1...1440 | Change uplink interval [min] Values below 3 min are not recommended and might not working in your LoRaWAN® region due to duty cycle mechanisms |
lora set interval 1010 |
lora get deveui |
Reads the uniqe 64 bit end-device identifier (EUI-64) | lora get deveui3434333575376517 |
|
lora get appeui |
Reads the unique 64 bit application identifier (EUI-64) | lora get appeui8CAE49CFFFFFFF01 |
|
lora set appeui [appeui] |
16 chars hex string | Overwrite AppEUI (default for PCR2 is 8CAE49CFFFFFFF01) | lora set appeui 8CAE49CFFFFFFF018CAE49CFFFFFFF01 |
lora get appkey |
Reads the unique 64 bit application identifier (EUI-64) | lora get appkey00000000000000000000000000000000 |
|
lora set appkey [appeui] |
32 chars hex string | Overwrite AppEUI (shipped with random key) | lora set appkey DEADBOBA000000000000000000000000DEADBOBA000000000000000000000000 |
lora get class |
Get LoRaWAN® device class | lora get classA |
|
lora set class [class] |
A or C | Set LoRaWAN® Device class | lora set class AA |
lora get confirmed |
Check confirmed uplink mode | lora get confirmed1 |
|
lora set confirmed [cnf] |
0 = unconfirmed uplinks 1 = confirmed uplinks |
Set confirmed uplinks mode | ```lora set confirmed |
lora get adr |
Check if ADR is on | lora get adr1 |
|
lora set adr [on] |
0 = off 1 = on |
Enable ADR | lora set adr 11 |
lora get dr |
Get current datarate | lora get dr21 |
|
lora set dr [on] |
0...7 | Set a fix datarate (no effect when ADR is on) | lora set dr 22 |
lora get snr |
Get current signal-to-noise ratio (SNR) in dB | lora get snr12 |
|
lora get rssi |
Get current received signal strength indicator (RSSI) in dBm | lora get rssi-117 |
|
lora get fcnt |
Get last uplink Fcnt | lora get fcnt23 |
|
lora get fsb |
Get current subband setting (US915 and AU915 devices only) | lora get fsb0 |
|
lora set fsb [fsb] |
0 = all 1...8 = Subband 1...8 |
Set subband or enable all (US915 and AU915 devices only) | ```lora set fsb |
lora get lci |
Get LinkCheck Inteval Setting | lora get lci1440 |
|
lora set lci [lci] |
0 = disabled 1...1440 |
Set LinkCheck Interval in minutes | lora set lci 14401440 |
lora get ula |
Get number of join/uplink attempts | lora get ula10 |
|
lora set ula [cnt] |
1...255 | Set number of join/uplink attempts | lora set ula 55 |
Device Control
| Command | Args | Description | Example |
|---|---|---|---|
get locked |
Checks if access to device configuration has been locked 0 : unlocked (access granted) 1 : locked (no access) |
get locked0 |
|
lock [pin] |
Locks device config with a numeric PIN (up to 8 digits) | lock 1234ok |
|
unlock [pin] |
Unlock access to device configuration | unlock 1234ok |
|
set defaults |
Reloads factory settings (except LoRaWAN® keys) Needs to be followed by save in order to write settings into ROM. |
set defaultsok |
|
clear |
Clear all counter values | clearok |
|
save |
Save changed settings | savetok |
|
restart |
Restart device | restart |
Save & Apply Changes
All changes to device settings need to be stored in internal ROM. This needs to be done by the save command.
Some changes will be active only after device restart by a power cycle or by sending the restart command.
>set interval 5
5
>save
ok
>restart
Examples
Device Setup Example
This example shows a short sequence of commands to setup a PCR2.
- Uplink Interval is set to 10min
- LoRaWAN® application key is changed
- We set the minimal an maximal distance to 50cm and 250cm as we install the PCR2 at a wall at a corridor.
- Sensitivity we set to 40% since we do not need the full range
- At the end we save the changes to ROM and restart the device
> set interval 10
10
> lora set appkey AE64E7C8AB5745AAA7E328CA781B54E6
AE64E7C8AB5745AAA7E328CA781B54E6
> radar set mindist 50
50
> radar set maxdist 250
250
> radar set sens 40
40
> save
ok
> restart
Connected Counter Example
In this example PCR2 acts as an offline counting device.
LoRaWAN® modem has been disabled with the command lora enabled 0 followed by save
- We read the RTL value
- We read the LTR value
- We clear the counters
> get rtl
10
> get ltr
5
> clear
ok
> get rtl
0
> get ltr
0
