FFGroup: Manage whitelist/blacklist via batch file

Since it is often more advantageous to manage the whitelist and blacklist of the FFGroup app via an independent list, it is possible to send the tags that are to be added to this list to the camera (app), e.g. via a batch file from a Windows PC.

Since the camera itself offers to replace/modify data in the configuration via JSON file, this is possible in the following way.

Required data:

  • JSON file with registered flags
  • Batch file that loads the JSON to the camera and permanently saves the configuration.

1. Find the path in which the JSON file should change something

The URL to change the whiteList section is as follows:
http://ip-adresse-kamera/api/json/config/camera/plugins/FFLPR/whiteList/whiteList

Here, the URL must specify exactly which part of the configuration should be addressed.

2. Create JSON file (e.g. FF.json)
Here you can create a simple text file and adapt or edit it with a text editor or Notepad, for example.
To convert the .txt file into a JSON file, you only have to change the file name.

Important is the content of the JSON file!

As you can see the indicator is surrounded by square brackets.
These must be included in the JSON file.
JSON INHAT

Meanwhile, a JSON file must look like this:
License plates have already been entered in this file.


If this JSON file is now transferred to the camera, the flags there are entered in the whitelist.

3. Create batch file (e.g. ff.bat).

With a curl command, files can be sent directly to the camera.
Since sending the JSON file only changes/adds/removes data in the camera and does not save it, an HTTP API must also be sent to the camera to permanently save the configuration.

In turn, you can create a batch file as follows:
-Create a text file and insert the commands.
-Rename the text file to .bat or .cmd.

Where you put the batch file and the JSON file on your PC is irrelevant for now, since we need to tell the batch file where the JSON file itself is located.

In this example, the JSON file has been created in a folder called “Whitelist” on the desktop.

This is done by the command:
cd "path to JSON file ".

to be able to send the JSON file to the camera via curl command, you have to insert the following command into the batch file

curl -k --data-binary @name-of-JSON-file https://Benutzername:Passwort@IP-address-camera//api/json/config/camera/plugins/FFLPR/whiteList/whiteList

To save the changed data permanently, the following URL must be entered
curl http://Benutzername:Passwort@IP-address-camera/admin/rcontrol?action=storeconfig

This looks like the following in a batch file:

4.Transfer JSON file into the camera
If you click into the whitelist within the FFGroup app, you will see an empty list


If you now click on the ff.bat (batch file), a CMD window starts automatically for a short time, which closes again.
If you then go back to the FFGroup app settings, you will see the entered tags from the JSON file in the whitelist.

The same procedure also applies to the blacklist.
Here the CURL command is simply:
curl -k --data-binary @name-of-JSON-file https://Benutzername:Passwort@IP-address-camera//api/json/config/camera/plugins/FFLPR/blackList/blackList

This procedure can of course be applied to the other FFGroup apps as well.
-FFLPRAM
-FFLPRMMCR (available in the future)