Log QPE Data

In addition to providing access to live data from the QPE, the Quuppa APIs also provide methods for logging data so that it can be viewed and analysed later. By default, the QPE does not store or record any data.

Logged data can be particularly useful for use cases where you want to optimise processes or space layouts by analysing how people and assets typically move around the space. The logged data, especially the binary data, can also be used for troubleshooting any issues with the deployment.

Note: You can test out what the API responses look like using the QPE Web Console (e.g. at http://localhost:8080/qpe/) by entering the request URL into your browser's address bar, e.g. localhost:8080/qpe/logBinaryData.

Create Output Target

To create an output target (i.e. where, how and in what format the data should be logged) for an existing output format, follow the steps below. You can either use the built-in output formats or create your own custom format using the QSP's API Data Formats & Output Targets editor.

  1. Edit the request URL for the Create Output Target API method as needed.
    /qpe/createOutputTarget?name=TargetName&format=formatId|formatName&target=<udp|file>&type=<json|csv>&triggerMode=<interval|anydataupdate|locationupdate>][&ipAddress=ipAddress][&port=port][&stopOutputIfTagIsNotSeenIn=seconds][&folder=folder][&prefix=logFilePrefix][&includeHeader=includeHeader]
  2. Send the request to the QPE using the edited URL.

    For example, to create a UDP output target that sends location updates as soon as possible to port 4000 on the loopback address, use something like this:

    /qpe/createOutputTarget?target=file&type=json&format=defaultLocation&triggerMode=positionupdate&ipAddress=127.0.0.1&port=4000&humanReadable=true&name=Test&start
  3. The QPE response will confirm that the system has started logging.
    {
      "code": 0,
      "command": "http://localhost:8080/qpe/createOutputTarget?target=udp&type=json&format=defaultLocation&triggerMode=positionupdate&ipAddress=127.0.0.1&port=4000&humanReadable=true&name=Test",
      "message": "Created target Test, defaultLocation, AUTOSTART, JSON, Position update, IP: 127.0.0.1, port: 4000",
      "responseTS": 1611047801355,
      "status": "Ok",
      "version": "1.0"
    }

Control Output Target

To control an existing output target (i.e. to start logging data, stop logging data, delete logged data or delete the output target), follow the steps below.

  1. Edit the request URL for the Control Output Target API method to select the desired action (i.e. start, stop or delete) for the output target.
    /qpe/controlOutputTarget?target=existingTargeNameOrtId&mode=<delete|start|stop>[&interval=intervalInSeconds][&stopOutputIfTagIsNotSeenIn=seconds][&duration=seconds] 
  2. Send the request to the QPE using the edited URL to start logging the data.

    For example, to stop an existing output target that is called location-update-udp, use:

    /qpe/controlOutputTarget?mode=stop&target=location-update-udp&humanReadable
  3. The QPE response will confirm that the action has been taken.
    {
      "code": 0,
      "command": "http://localhost:8080/qpe/controlOutputTarget?mode=stop&target=location-update-udp&humanReadable",
      "responseTS": 1430142648533,
      "status": "Ok"
    } 

Log Binary Data

The Quuppa APIs can be used to start and stop the logging (i.e. recording) of binary data for the QPE. The binary logs are encrypted data logs that can be used by the Quuppa team to troubleshoot your deployment remotely in case any issues come up. If you are asked by the Quuppa team to provide binary logs for your Quuppa system, you can start recording them using the Positioning Engine Web Console or the API method described here.

  1. Edit the request URL for the Log Binary Data API method as needed. For example, you can set where you want to logs to be saved, the prefix you would like the file name to have and the how long the logging should last as needed.
    /qpe/logBinaryData[?folder=folderName][&prefix=fileNamePrefix][&time=timeInSeconds]
  2. Send the request to the QPE using the edited URL to start logging data.

    For example, to start logging binary data without a specified timeout, use:

    /qpe/logBinaryData
  3. The QPE response will confirm that the system has started logging binary data.
    {
    	"code": 0,
    	"command": "http://localhost:8080/qpe/logBinaryData",
    	"message": "Started binary logging, run again to stop",
    	"responseTS": 1430141634420,
    	"status": "Ok",
    	"version": "1.0"
    }

Push Binary Data

The Quuppa APIs can be used to push binary data from a primary (e.g. production) QPE server to a secondary (e.g. sandbox) QPE server running at a different location using UDP packets. This means that you can use the real data from your production QPE to run tests in another QPE, to verify that any changes will not cause problems in the live environment. For example, the feature can be used to test new Quuppa software versions before running them in the production environment.

  1. Set up a secondary QPE server. For more information on how to do so, please refer to the Install the QPE Software section of this guide.
  2. Start the secondary QPE server using the startup parameter -DbinaryLogMode.
  3. Return to the primary QPE and edit the request URL for the Push Binary Data API method as needed. Specify the IP to which you would like to push the data.
    /qpe/pushBinaryData[?mode=clear/status][&targetIp=targetIpAddress]
  4. Send the request to the QPE using the edited URL to start logging data.

    For example, to start pushing binary data to the IP address 192.168.123.128, use:

    /qpe/pushBinaryData?targetIp=192.168.123.128&humanReadable=true
  5. The QPE response will confirm that the binary data is now being pushed to the secondary QPE.
    {
      "code": 0,
      "command": "http://localhost:8080/qpe/pushBinaryData?targetIp=192.168.123.128&humanReadable=true",
      "message": "Binary push to 192.168.123.128 started",
      "responseTS": 1613057420877,
      "status": "Ok",
      "version": "1.0"
    }
  6. Go to the QPE Web Console of the receiving QPE to verify that the date is coming through.

Note: For more detailed information about any of the methods discussed above, please refer to our API documentation, available via the QPE Web Console or the Quuppa Customer Portal's Downloads section.