The following documentation relates to PCR2 Firmware V3.5.x
After switching on the device, following sequence will start.
Initialization of Radar Processor. LEDs are constantely on.
Start Join-Procedure (only if LoRa Modem is enabled). LEDs are blinking slowly
After receiving Join Accept, the device switches sends the Configuration Payload on port 190
LEDs are off and are quickly flashing if a object gets detected.
After Interval time is up, the device sends the PCR2 Application Payload on port 14. This can be done in Confirmed or Unconfirmed Mode.
In Confirmed mode LEDs are on until successful received a ACK. After receiving the ACK LTR and RTL counters will be reset. If the device operated in Unconfirmed Mode counters will be immediately reset after sending w/o waiting for an ACK.
The inactivity timeout can be used to automatically reset sum counters (RTL_SUM and LTR_SUM) if there is no movement for a certain time. This is useful if absolute counting of persons is used and one would like to start with zero in the morning. Inactivity Limit can be enabled by setting the value to zero.
There are several reasons why an end device could land in a stranded state where it does not receive any downlink messages from the network, including:
PCR2 devices using the Link Check Request/Answer mac command for detecting if there is still a connection to a Gateway. (see command
set/get lci for more info)
PCR2 can be configured using the virtual serial intervace (Serial over USB). There should be no need to install drivers on Windows 10. Otherwise look for STM32 VCP drivers to install first.
Use 19200 8N1 to communication with device.
All commands are terminated by \r\n (Carriage Return, Line Feed)
Device types include:
|IN||Indoor People Counter|
|OD||Outdoor People Counter|
|T||General Traffic Counter|
|XIO||Industrial Object Counter with digital outputs|
|ODS||Outdoor People Counter, Solar powered|
LoRaWAN™ bands include:
|EU868||EU 863-870MHz ISM Band|
|AS923||AS923MHz ISM Band|
|US915||US 902-928MHz ISM Band|
|AU915||Australia 915-928MHz ISM Band|
get typestr PCR2-EU868-IN
get fw_version 3.6.0
Get the device unique serial number
get serial 3334373981377504
This returns the actual device status
|init||Device is initializing|
|joining||Device trying to join a LoRaWAN™ network|
|active||Device is connected to LoRaWAN™ network|
|error||Hardware or Configuration Error|
get status joining
Get the intenal CPU temperature. Temperature is in 1/10 °
get temp 330
Get the counter value of all left-to-right counts. You can overwrite the value by using the set command.
get ltr 1
Get the counter value of all right-to-left counts. You can overwrite the value by using the set command.
get rtl 22
get l1 5
get l2 5
get r1 2
get r2 2
PCR2 can run in four different modes:
|0||Timespan, used to sum up detection and send after a certain time (Sending Interval)|
|1||NotZero, Same as Timespan but w/o sending if counters are 0 (zero)|
|2||Trigger, Send on every events. Events can be filtered with Hold Off setting|
|3||Capacity Alert Mode|
New mode will be active only after a
set mode <val>
get mode 2 set mode 0 0 restart
Set the radar sensitivity can be set from 10 … 100% (100% is very sensitive) Default: 50
set sens <val>
get sens 80 set sens 50 50 restart
Set the accumulation interval in minutes (1…1440 minutes). Default: 10 During this time, alle persons will be counted and sums are transfered. After transfer counters will be reset.
set interval <val>
get interval 15 set interval 60 60
Reset sum counters if there is no movement for a certain time (1…1440m) 0 = no timeout.
set timeout <val>
get timeout 0 set timeout 60 60
This is a timer (0…600s) can be used to filter events. Default: 0
set hold <val>
get hold 60 set hold 0 0
ltr count event will increase LTR sum by 1
set sumltr <val>
get sumltr -21 set sumltr -20 -20
rtl count event will increase RTL sum by 1
set sumrtl <val>
get sumrtl 12 set sumltr 0 0
If the PCR2 is equiped with a XIO Board following operation modes can be enabled
|0||Off||Switch XIO Board off|
|1||Pulse||Generate a 500ms pulse on O1 if RTL detected, O2 if LTR is detected|
|2||Detection||O1 is always on. If LTR or RTL is detected, O2 will be on during holdoff time|
|3||CapacityAlert||O1 on when sum < lim, O2 on when sum >= lim|
|4||RC||Remote controlled by LoRa Downlink|
New mode will be active only after a
set xiomode <val>
get xiomode 2 set xiomode 0 0 restart
Enable or disable LoRaWAN™ radio. If disabled you can use the device as a wired-sensor connnected wie USB. ‘LTR’ or ‘RTL’ will be sent over the serial interface on detection
lora get enabled
lora set enabled <val>
lora get enabled 1 lora set enabled 0 0 LTR LTR RTL . . .
Set the LoRa Device class to A or C
lora get class
lora set class [A|C]
lora get class A lora set class C C restart
Set / Get the uniqe 64 bit end-device identifier (EUI-64)
lora get deveui
lora set deveui <val>
lora get deveui 0123456789abcdef lora set deveui 0123456789abcdf 01234567890abcdef
Set / Get the unique 64 bit application identifier (EUI-64)
lora get appeui
lora set appeui <val>
lora get appeui deadbeefdeadbeef lora set appeui deadbeefdeadbeef deadbeefdeadbeef
Set / Get the Application Session Key (AppSKey). AppSKEy is used for encryption and decryption of the payload. The payload is fully encrypted between the Node and the Handler/Application Server component of The Things Network (which you will be able to run on your own server). This means that nobody except you is able to read the contents of messages you send or receive.
lora get appkey
lora set appkey <val>
lora get appkey deadbeefdeadbeefdeadbeefdeadbeef lora set appkey deadbeefdeadbeefdeadbeefdeadbeef deadbeefdeadbeefdeadbeefdeadbeef
For US915 and AU915 devices only. 8 sub-bands are available (set 1-8). 0 = all channels enabled
lora get fsb
lora set fsb <val>
lora get fsb 1 lora set fsb 0 0
Enable/Disable confirmed uplink messages.
lora get confirmed
lora set confirmed <val>
lora get confirmed 0 lora set confirmed 1 1 restart
We will send a LinkCheck MAC command together with an uplink regularly to make sure gateway responds properly. If there is no answer we try to re-join. lci is in range
LinkCheck can be disabled completely by setting to 0.
lora get lci
lora set lci <val>
lora get lci 10 lora set lci 1440 1440 restart