TI EdgeAI Studio Agent is required to be started on a TI Analytics device to use EdgeAI Studio with the device. To know more about EdgeAI Studio please visit https://dev.ti.com/edgeaistudio
-
Connect the UART cable to PC and open terminal
-
The COM ports(/dev/ttyUSB) can vary. To check all available usb serial ports, use:
ls /dev/tty | grep USB
[NOTE: TDA4VM,AM68A,AM69A will mostly be on ttyUSB2 while AM62A,AM62X,AM62P are generally on ttyUSB0. Please refer to EdgeAI SDK documentation (Getting Started) for more information.]
-
Start minicom session on PC using:
sudo minicom -D /dev/ttyUSBX
-
Login using "root"
-
Use ifconfig to get the ip address, the highlighted one as shown in the figure below:
- If you have a disply, you can connect display to the board. When the board boots up, it will show the IP address of the device on the default screen.
-
Navigate to edgeai-studio-agent folder:
cd /opt/edgeai-studio-agent
-
Execute the script:
./run.sh
GET
/sensor
(gets all the sensor attached to the target)
Find all the sensors attached to the target. This includes all the USB Camera connected to the target. It also provides other information like SDK version and device type.
None
http code content-type response 200
application/json
All attached sensors 404
application/json
{'detail': 'Sensor not found'}
[
{
"name": "UVC Camera (046d:0825)",
"id": "null",
"type": "Webcam",
"device": [
{
"id": "/dev/video-usb-cam0",
"type": "V4L2",
"description": "device available for capture",
"status": "available"
}
],
"sdk_version": "9.0",
"device_name": "TDA4VM"
}
]
GET
/sensor-session
(gets all the sensor sessions)
Find all sensor sessions including initiated and started ones. The target device only supports one session at a time.
None
http code content-type response 200
application/json
Sensor session 404
application/json
{'detail': 'Session not found'}
{
"session": {
"id": "88c046f1-4ef1-456f-9978-c3a20456b05c",
"http_port": 8080,
"http_url": "/raw_imagestream",
"http_status": "started",
"http_pid": 1231,
"ws_port": 8000,
"ws_url": "",
"ws_status": "down",
"ws_pid": 0,
"udp_server_port": 8081,
"udp_client_port": 0,
"udp_status": "started",
"udp_pid": 1231,
"tcp_server_port": 0,
"tcp_client_port": 0,
"tcp_status": "Down",
"tcp_pid": 0,
"data_pipeline_status": "down",
"data_pipeline_pid": 0,
"stream_type": "null"
},
"sensor": {
"name": "test_name",
"id": "test_id",
"type": "test_type",
"device": [
{
"id": "/dev/video-usb-cam0",
"type": "V4L2",
"description": "V4L2",
"status": "available"
}
],
"sdk_version": "9.0",
"device_name": "TDA4VM"
},
"project": null,
"inference": null
}
Note: "id": "88c046f1-4ef1-456f-9978-c3a20456b05c" is the unique id of the sensor-session
GET
/sensor-session/{id}
(gets sensor session by id)
Find the unique sensor sessions by id.
name type data type description id
required string The specific unique idendifier
http code content-type response 200
application/json
Sensor session with given id 400
application/json
{'detail': 'Invalid ID supplied'}
404
application/json
{'detail': 'Session not found'}
{
"session": {
"id": "88c046f1-4ef1-456f-9978-c3a20456b05c",
"http_port": 8080,
"http_url": "/raw_imagestream",
"http_status": "started",
"http_pid": 1288,
"ws_port": 8000,
"ws_url": "",
"ws_status": "down",
"ws_pid": 0,
"udp_server_port": 8081,
"udp_client_port": 0,
"udp_status": "started",
"udp_pid": 1288,
"tcp_server_port": 0,
"tcp_client_port": 0,
"tcp_status": "Down",
"tcp_pid": 0,
"data_pipeline_status": "down",
"data_pipeline_pid": 0,
"stream_type": "null"
},
"sensor": {
"name": "test_name",
"id": "test_id",
"type": "test_type",
"device": [
{
"id": "/dev/video-usb-cam0",
"type": "V4L2",
"description": "V4L2",
"status": "available"
}
],
"sdk_version": "9.0",
"device_name": "TDA4VM"
},
"project": null,
"inference": null
}
GET
/project
(gets registered project)
Find registered project
None
http code content-type response 200
application/json
Project 404
application/json
{'detail': 'Project not found'}
[
{
"id": "88c046f1-4ef1-456f-9978-c3a20456b05c",
"name": "test_project",
"sensor": "null",
"task_type": "classification",
"model": "null",
"target_device": "null",
"model_file": "null",
"model_file_checksum": "null"
}
]
GET
/project/{id}
(gets registered project by id)
Find the registered project by id.
name type data type description id
required string The specific unique idendifier
http code content-type response 200
application/json
Project with given id 404
application/json
{'detail': 'Project not found'}
[
{
"id": "88c046f1-4ef1-456f-9978-c3a20456b05c",
"name": "test_project",
"sensor": "null",
"task_type": "classification",
"model": "null",
"target_device": "null",
"model_file": "null",
"model_file_checksum": "null"
}
]
POST
/sensor-session
(initiate a sensor session)
Initiate a unique sensor session by generating a unique id and setting up all the required client and server processes
{
"name": "test_name",
"id": "test_id",
"type": "test_type",
"device": [
{
"id": "/dev/video-usb-cam0",
"type": "V4L2",
"description": "device available for capture",
"status": "available"
}
],
"sdk_version": "9.0",
"device_name": "TDA4VM"
}
http code content-type response 202
application/json
Sensor session with generated unique id 405
application/json
{'detail': 'Invalid input'}
POST
/project
(register a project)
Register a project to the target and set up project entry with all required parameters supplied
{
"id": "88c046f1-4ef1-456f-9978-c3a20456b05c",
"name": "test_project",
"task_type": "classification"
"sensor": "null"
"model": "null"
"target_device": "null"
"model_file": "null"
"model_file_checksum": "null"
}
http code content-type response 201
text/html;charset=utf-8
Succesfully created
POST
/project/{id}/model
(upload model to the target)
Upload model tarball to the target as outputFile.tar.gz. Each call will overwrite the previous file and checksum with the new file.
name type data type description id
required string The specific unique idendifier
File object of the model tarball renamed as outputFile.tar.gz
http code content-type response 201
text/html;charset=utf-8
Succesfully created, {id}
404
application/json
{'detail': 'Project not found'}
405
application/json
{'detail': 'Invalid input'}
PUT
/sensor-session/{id}
(start session and associated data pipeline)
Start sensor session by setting up the required data pipeline (inference or raw capture). Whether to start inference pipeline or raw capture pipeline is decided by the key "inference" in the PUT data. Client creates the project_session object by aggregating the initiated session object, project object and inference parameter. Sensor session object and project object will be validated, data pipeline process will be started for direct sensor data or inference output based on the value of inference parameter. If successfully started, the response will have data_pipeline_status as 'started' and data_pipeline_pid with the PID of the pipeline process supplying data to the UDP/TCP server/client. This API can also produce and stream data over websockets for browser front end application to display on the UI, for e.g., for log streaming, memory usage, inference time etc. If websocket interface is started, the response will have ws_status as 'started', ws_url & ws_port duly filled, and ws_pid with the PID of the websocket server process supplying data to the Javascript front end application.
name type data type description id
required string The specific unique idendifier
{
"session": {
"id": "88c046f1-4ef1-456f-9978-c3a20456b05c",
"http_port": 8080,
"http_url": "/raw_imagestream",
"http_status": "started",
"http_pid": 1999,
"ws_port": 8000,
"ws_url": "",
"ws_status": "down",
"ws_pid": 0,
"udp_server_port": 8081,
"udp_client_port": 0,
"udp_status": "started",
"udp_pid": 1999,
"tcp_server_port": 0,
"tcp_client_port": 0,
"tcp_status": "Down",
"tcp_pid": 0,
"data_pipeline_status": "down",
"data_pipeline_pid": 0,
"stream_type": "image"
},
"sensor": {
"name": "test_name",
"id": "test_id",
"type": "test_type",
"device": [
{
"id": "/dev/video-usb-cam0",
"type": "V4L2",
"description": "V4L2",
"status": "available"
}
],
"sdk_version": "9.0",
"device_name": "TDA4VM"
},
"inference": false
}
http code content-type response 202
application/json
Data with updated datapipeline and websocket status
400
application/json
{'detail': 'Invalid ID supplied'}
404
application/json
{'detail': 'Session not found'}
404
application/json
{'detail': 'Project not found'}
409
application/json
{'detail': 'Sensor session alreday running'}
DELETE
/sensor-session/{id}
(deletes sensor session by id)
Delete sensor session with given id. All processes and resources associated to the sensor sessions will be cleared and freed.
http code content-type response 202
text/html;charset=utf-8
Operation accepted
400
application/json
{'detail': 'Invalid ID supplied'}
404
application/json
{'detail': 'Session not found'}
DELETE
/sensor-session/{id}/dpipe
(deletes data pipeline associated with sensor session)
Deletes only the data pipeline associated with sensor session having the given id. The data pipeline are the inference or raw data capture pipelines running on the target. The websockets interface associated with the data pipelines are also terminated. The same data pipeline associated with session can be later restarted using PUT method on /sensor-session/{id}.
http code content-type response 202
text/html;charset=utf-8
Operation accepted
400
application/json
{'detail': 'Invalid ID supplied'}
404
application/json
{'detail': 'Session not found'}
DELETE
/project/{id}
(deletes project by id)
Deletes the registered project with given id. All the resources including model files, artifacts and configuration files related to this project will be cleared and freed.
http code content-type response 200
text/html;charset=utf-8
Successful operation
404
application/json
{'detail': 'Project not found'}