Support Portal

PeopleCounter: How to communicate with PeCo using REST API?

How to communicate with PeopleCounter using REST API.
Related Products
MRS1104A-111011P01 PECO SET 01
MRS1000A
Attachments
MRS1000A-PeCo-Manual-(V2.1.0).pdf

Table of Contents

Communication with PeopleCounter can be done with REST API using POST requests. The list of commands can be found in the manual (see attachment - Chapter 7.10: Communication via REST API).

Here we will see a step-by-step on how this communication is done.

First of all, in order to send POST requests to the device, we need to do the communication with an external software, e.g.: Postman, that we will download and install. Once we have this software installed, we can send commands to our People Counter and communicate with it.

For the communication we will need to follow the steps below. In this example we will see how to increase and decrease the number of people inside (Like in Tab "Room capacity" in SOPASAir). Let's dive in!

First, we will open Postman and create a new request by pressing on "Create a request" in the "Launchpad" Tab under "Start something new"



A new tab will open. Then, as we need to communicate with the device using POST requests, we need to change the type of the request in the dropdown under "Untitled Request", and select POST.



We will see that next to the type of request, we need to write our command. In our first case, we will increase by 1 the number of counted people. To do that, we will write the following line next to the type "POST" (extracted from the manual):

http://192.168.136.1/api/crown/PeopleCounter/CorrectNumberOfPersonsInsideUp

Note: Remember to change the ip-address in the command in order to match with the ip-address of the device.

Now we can press on the blue button "Send" and see if the device has increased the room capacity by 1 person.

Before communicating

 

After communication


The same happens when we want to decrease the value by 1.
We need to follow the same procedure as before but now we will use the following URL:

http://192.168.136.1/api/crown/PeopleCounter/CorrectNumberOfPersonsInsideDown

If we press "Send" we will see the decrease value.

After communication




*By clicking on the image you can see them bigger in a pop-up.
Keywords:
PeopleCounter, REST API, MRS1000A - People Counter, PeCo, People Counter