9. Send data to the Context Broker with the AML Dashboard

9.1. Background

The AML Dashboard is a web-based tool that allows users to interact with the AML framework.

This tutorial guides you through the process of sending data to the Context Broker and retrieving inferences using the AML Dashboard.

../../_images/context_broker_dashboard.png

9.2. Prerequisites

Ensure you have installed the AML Dashboard using one of the following methods:

For more information, check the AML Dashboard Interfaces and AML Dashboard Usage sections.

9.3. Running the demo

To run the necessary components for interacting with the Context Broker using the AML Dashboard, follow these steps:

9.3.1. Start the backend server

To begin, you need to launch the backend server:

  1. Navigate to the backend directory.

cd backend
  1. Load the AML-IP environment.

source /AML-IP/install/setup.bash
  1. Start the server:

python3 server.py

9.3.2. Start the AML Dashboard

Once the backend server is running, start the AML Dashboard frontend:

  1. Navigate to the frontend/aml_dashboard directory.

cd frontend/aml_dashboard
  1. Start the AML Dashboard:

npm run dev
  1. Access the dashboard at http://localhost:5173/.

9.3.3. Start the Context Broker

To start the Context Broker, follow the instructions in this document.

9.4. Send data to the Context Broker

9.4.1. Create a Fiware Node

To create a Fiware Node, follow these steps:

  1. In the AML Dashboard, go to the Context Broker tab.

  2. Specify the necessary parameters for the Fiware Node creation, including the Context Broker entity ID and attributes.

  3. Click on the Create button in the Fiware Node.

  4. Once the node is successfully created, the Fiware Node Status will update to Created !.

9.4.2. Upload data

To send data to the Context Broker, follow these steps:

  1. Upload an image file from your computer by clicking on the Upload a file button and selecting an image.

  2. After uploading, click on the Post data button in the Context Broker Data to send the image to the Context Broker.

  3. Once the data is sent, the status will change to Sended ! in the Data Status.

9.5. Receive the solution

9.5.1. Start an Inference Node

  1. Navigate to the backend directory.

cd backend
  1. Load the AML-IP environment.

source /AML-IP/install/setup.bash
  1. Start the Inference Node:

python3 inference.py

9.5.2. Retrieve the solution

  1. The inference result (solution) will be displayed in the Context Broker Solution section.

  2. The Solution Status will change to Solution received ! to confirm that the inference has been successfully retrieved.

Note

Currently, each Fiware Node only supports handling one entity of the Context Broker. The data associated with that entity ID cannot be changed once initialized, meaning each Fiware Node will manage a single inference process.

9.6. Troubleshooting

If you encounter the following error when sending large files or data to the Context Broker:

requests.exceptions.HTTPError: 413 Client Error: Content Too Large for url: http://localhost:1026/v2/entities

This error indicates that the request payload is too large for the server to process. You may need to configure the Context Broker to accept larger payloads.

To address this issue, you can adjust the following flags in the Context Broker configuration:

  • inReqPayloadMaxSize: Increase this value to allow larger incoming request payloads.

  • outReqMsgMaxSize: Adjust this value to handle larger outgoing response messages.

  • logInfoPayloadMaxSize: Configure this flag to manage the size of payloads in log entries.

  • logLineMaxSize: Modify this value to accommodate longer lines in log files.

Set each flag according to the size of the data you need to handle.