Skip to content

PCR2 Command Line Interface

This document describes the command line interface of all PCR2 variants.

Older versions of this document: - V3.11 - V3.10 - V3.8 - V3.5 - V3.4 - V3.3 - V3.2

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.

Connect_USB

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).

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

Command List

The complete list of supported CLI commands. help prints the same list to the console.

Application Status

Command Args Description Example
get typestr Get Device Type e.g. PCR2-EU868-IN get typestr
PCR2-EU868-ODS
get status Get Device Status (0=OK) get status
0
get serial Get the unique serial number get serial
3434333575376517
get fw_version Get firmware version get fw_version
4.0.0

Application Settings

Command Args Description Example
get mode Get current uplink mode get mode
0
set mode [mode] Set uplink mode
0 = Timespan
1 = NotZero
2 = Trigger
3 = CapAlert
Change operation mode set mode 0
0
get ltr Get Left-to-right counter value get ltr
2
set ltr [val] Overwrite Left-to-right counter value set ltr 0
0
get rtl Get Right-to-left counter value get rtl
5
set rtl [val] Overwrite Right-to-left counter value set rtl 1000
1000
get interval Get current uplink interval get interval
10
set interval [val] 1...1440 Change uplink interval [minutes]
Values below 3 min are not recommended and might not working in your LoRaWAN region due to duty cycle mechanisms
set interval 10
10
get sumup Check if Sum Up is active (1 = active) get sumup
1
set sumup [ena] Enable Sum Up Counter (1 = active) set sumup 1
1
get holdoff Get current holdoff timer setting get hold
1
set holdoff [s] 0...600 (0 = off) Set holdoff timer in seconds set hold 1
1
get timeout Get current auto-zero timeout in minutes get timeout
120
set timeout [min] 0...1440 (0=off) Set auto-zero timeout in minutes set timeout 120
120
get lim Get current capacity limit setting
PCR2-XIO only
get lim
0
set lim [people] 0...65535 Set capacity limit
PCR2-XIO only
set lim 100
100
get xiomode Get current XIO settings
PCR2-XIO only
get xiomode
0
set xiomode [mode] 0 : Off
1 : Pulse
2 : Bounce
3 : Capacity
4 : RC
Set XIO mode
PCR2-XIO only
set xiomode 0
0

Radar Processor Settings

Command Args Description Example
radar get enabled Check if radar module is enabled radar get enabled
1
radar set enabled [on] 0 = disabled
1 = enabled
Enable/Disable radar module radar set enabled 1
1
radar get channel Get radar channel radar get channel
0
radar get channel [ch] 0 = LOW Frequency
1 = HIGH Frequency
Change radar frequency radar set channel 1
1
radar get autotune Check if Autotuning mode is on radar get autotune
0
radar set autotune [on] 0 = disabled
1 = enabled
Enable/Disable Autotuning radar set autotune 1
1
radar get sens Get current radar sensitivity setting radar get sens
50
radar set sens [sensitivity] 10 … 100%
(100% is very sensitive)
Set sensitivity setting radar set sens 65
65
radar get beam Get current radar beam width radar get beam
40
radar set beam [angle] 80...30° Set radar beam width radar set beam 30
30
radar get dir Get current radar sensitivity setting radar get dir
0
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 mindist
200
radar set mindist [cm] Set minimal distance to target object radar get mindist 190
190
radar get maxdist Get maximum distance to target object in centimeter radar get maxdist
500
radar set maxdist [cm] Change maximum distance to target object radar set maxdist 400
400

LoRa Modem Settings

Command Args Description Example
lora get enabled Check if LoRa Modem is enabled (online mode) lora get enabled
1
lora set enabled [on] 0 = off
1 = on
Enable LoRaWAN modem (offline mode) lora set enabled 1
1
lora get interval Get current uplink interval lora get interval
10
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 10
10
lora get deveui Reads the uniqe 64 bit end-device identifier (EUI-64) lora get deveui
3434333575376517
lora get appeui Reads the unique 64 bit application identifier (EUI-64) lora get appeui
8CAE49CFFFFFFF01
lora set appeui [appeui] 16 chars hex string Overwrite AppEUI (default for PCR2 is 8CAE49CFFFFFFF01) lora set appeui 8CAE49CFFFFFFF01
8CAE49CFFFFFFF01
lora get appkey Reads the unique 64 bit application identifier (EUI-64) lora get appkey
00000000000000000000000000000000
lora set appkey [appeui] 32 chars hex string Overwrite AppEUI (shipped with random key) lora set appkey DEADBOBA000000000000000000000000
DEADBOBA000000000000000000000000
lora get class Get LoRaWAN device class lora get class
A
lora set class [class] A or C Set LoRaWAN Device class lora set class A
A
lora get confirmed Check confirmed uplink mode lora get confirmed
1
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 adr
1
lora set adr [on] 0 = off
1 = on
Enable ADR lora set adr 1
1
lora get dr Get current datarate lora get dr
21
lora set dr [on] 0...7 Set a fix datarate (no effect when ADR is on) lora set dr 2
2
lora get snr Get current signal-to-noise ratio (SNR) in dB lora get snr
12
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 fcnt
23
lora get fsb Get current subband setting (US915 and AU915 devices only) lora get fsb
0
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 lci
1440
lora set lci [lci] 0 = disabled
1...1440
Set LinkCheck Interval in minutes lora set lci 1440
1440
lora get ula Get number of join/uplink attempts lora get ula
10
lora set ula [cnt] 1...255 Set number of join/uplink attempts lora set ula 5
5

Control Commands

Command Args Description Example
set defaults Reloads factory settings (except LoRaWAN keys)
Needs to be followed by save in order to write settings into ROM.
set defaults
ok
clear Clear all counter values clear
ok
save Save changed settings savet
ok
restart Restart device 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