Skip to content

Latest commit

 

History

History
880 lines (745 loc) · 32.7 KB

File metadata and controls

880 lines (745 loc) · 32.7 KB

Open-SET tutorial

This page explains a tutorial for running a docker container application using Open-SET. The tutorial simulates the operational procedure for processing images taken by a satellite in real time while it is in orbit, and then downlinking the results to Earth. Specifically, we will perform a simple simulation of the process of transferring a sample application from Earth to a spacecraft, running the application in orbit, and then collecting the results on Earth. The sample app performs inference to detect vehicles from satellite/aerial images taken from the ground. Tutorial image Figure 1. Tutorial image The tutorial is as follows.

  1. Confirm assumptions
  2. Confirm initial operation
  3. Add and deploy apps
  4. Confirm deployed apps
  5. Execute apps
  6. Collecting the results
  7. Deleting the app and the execution results
  8. Collecting the logs
  9. Shutting down
  10. Checking the app execution results

This tutorial will show you how to use the commands to the maximum extent, but in actual operation, some commands can be omitted. The commands that can be omitted will be clearly stated at the beginning of the relevant chapter. For more advanced topics, please refer to Software Application Topics.

Contents:

1. Prerequisites

1.1 How to set up BUS-OBC

Run the following commands to install the necessary packages:

sudo apt update
sudo apt install git ntp net-tools python3-pip
python3 -m pip install numpy
python3 -m pip install timeout_decorator

Also, if Docker is not installed, please install docker engine on BUS-OBC by referring to https://docs.docker.com/engine/install/.

Next, clone the Open-SET repository:

sudo mkdir -p /opt
sudo chown ${USER}:${USER} -R /opt/
git clone https://github.com/jaxa/open-set.git
cd /opt/open-set

After cloning is complete, configure SSH and SFTP as follows:

sudo ip address add 192.168.0.4/24 dev <device name>
ssh-keygen -t rsa -b 4096 -f ~/.ssh/key_openset
ssh-copy-id -i ~/.ssh/key_openset.pub <username>@<MISSION-OBC's IP>
vi ~/.ssh/config

When the config file opens, add the following:

Host [alias name]
    hostname [IP address/domain name of the destination]
    user [username of the destination]
    IdentityFile /home/[your local username]/.ssh/key_openset

Finally, configure the NTP server:

sudo vi /etc/ntp.conf

Once the ntp.conf file opens, add server ntp.nict.jp iburst as shown below:

server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
server ntp.nict.jp iburst # Add this line

After saving and closing the file, run the following commands if you use ufw:

sudo systemctl restart ntp
sudo ufw allow 123/udp # Not required if UFW is not used

To verify that NTP synchronization is complete, run:

ntpq -p

You can confirm synchronization if there is a * next to the server name.

1.2. Preparing the container app

Build the docker container image for inference from the yolov5 repository.

cd <open-set directory>
cd Tutorial
git clone https://github.com/ultralytics/yolov5.git
docker compose -f 01_docker-compose.yaml build
docker save open-set/sampleapp-yolov5:latest | gzip > sample_app.tar.gz

Once the build is complete, copy the following files to your home directory.

cp /opt/open-set/Tutorial/sample_image.jpg ~/
cp /opt/open-set/Tutorial/sample_app.tar.gz ~/
cp /opt/open-set/Tutorial/01_docker-compose.yml ~/

For this inference task, the system will detect vehicles from the following image:

Vehicle detection result

1.3. Building the Execution Environment

First, we will build the environment for running Open-SET. Prepare a Linux PC that simulates BUS-OBC and MISSION-OBC, and connect them with an Ethernet cable (hereafter referred to as BUS-OBC and MISSION-OBC). Assign IP addresses as described in the README, and check the connection between BUS-OBC and MISSION-OBC. As shown in Figure 2, BUS-OBC uses three terminals, A, B, and C, to proceed with operations. First, start up the status command server and command client on terminals A and B.

[BUS-OBC Terminal A]
cd /opt/open-set/tests/tools/ifsw_verification/commands
python3 status_command_server.py

[BUS-OBC Terminal B]
cd /opt/open-set/tests/tools/ifsw_verification/commands
python3 command_client_manual.py

If the following messages are displayed on Terminal A and Terminal B, the preparation is complete.

[BUS-OBC Terminal A]
"Connection from {address} has been established!"

[BUS-OBC Terminal B]
==========================================
please select a command ID from the list:
ID | NAME
0x00 | GetTelemetry
0x01 | GetLog
0x02 | Shutdown
...

Also, for the next step, open Terminal C on the BUS-OBC.

BUS-OBC terminals Figure 2. BUS-OBC terminals

2. Initial Operation Check

In this chapter, we will check the values of the various telemetry collected in the MISSION-OBC as an initial operation check.

2.1. Sending a request for the telemetry collection command (GetTelemetry)

To output the telemetry, we will execute the GetTelemetry command. This command is used to output the telemetry collected in the MISSION-OBC. At BUS-OBC Terminal B (command client), enter 0x00 (GetTelemetry command).

[BUS-OBC Terminal B]
0x00 (Enter)

Immediately afterwards, if the following output is obtained at BUS-OBC Terminal A (status command server), the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
	{"command_id": "0x80", "parameter": [{"response_code": 0}, {"data": [1743137735, 0, 0, 255, 255, 0, 0, 0, 255, 255, 0, 4048, 5, 53616, 212, 32767, 0, 7, 261, 1, 14668, 255, NaN, NaN, 255, 255, 0.0, 0, 0, 0, 0, 0, 0, 39.0, 42.0, NaN, 2937, 2945, 4294967295, 839, 784, 4294967295, 0, 255, 255, 100, 255, 255, 0, 255, 255, 0, 255, 255, 6, 65535, 65535, 0, 255, 255, 255, 0, 255, 255, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 26, 255, 1, 0, 255, 1, 0, 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}]}
   Args to be passed:  [0, [1743137735, 0, 0, 255, 255, 0, 0, 0, 255, 255, 0, 4048, 5, 53616, 1734, 32767, 0, 7, 261, 1, 14668, 255, nan, nan, 255, 255, 0.0, 0, 0, 0, 0, 0, 0, 39.0, 42.0, nan, 2937, 2945, 4294967295, 839, 784, 4294967295, 0, 255, 255, 100, 255, 255, 0, 255, 255, 0, 255, 255, 6, 65535, 65535, 0, 255, 255, 255, 0, 255, 255, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 26, 255, 1, 0, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
   response code : 0
   Command executed : EndGetTelemetry
   Telemetry:
   
   unix_time: 1743137735
   command_counter: 0
   reject_counter: 0
   last_command_code: 255
   last_reject_command_code: 255
   reject_code: 0
   client_status_command_counter: 0
   client_status_reject_counter: 0
   client_status_last_command_code: 255
   client_status_last_reject_command_code: 255
   shutdown_request: 0
   dmesg_length: 4048
   dmesg_error: 5
   syslog_error: 53616
   system_uptime: 212
   service_stat: 32767
   status_failed_num: 0
   cpu_load_ratio: 7
   ...
   ...
   ce_count: 0
   ue_count: 0
   **********************************************************

We also recommend that you periodically execute this command and check for any telemetry errors each time. If you use command_client.py, you can automatically execute commands such as GetTelemetry on a regular basis, so please edit the file contents and execute it from a separate terminal if necessary.

2.2. Checking the Telemetry

If GetTelemetry is successful, you can then check the telemetry values. Check the results from BUS-OBC Terminal A (Status Command Server) to see if the following telemetry values are normal (as described below).

service_stat: 32767 (telemetry indicating whether the service is operating normally)
fdir_event_flag: 0 (telemetry indicating whether FDIR events are occurring)

If the above values are not as described, refer to Software Application Topics to identify and deal with abnormal services or FDIR events.

3. Adding and Deploying Applications

In this chapter, we will add and deploy applications. You can use the sample app (sample_app.tar.gz) build in the chapter 1.2. , but if you have your own app, you can use that instead.

3.1. Deploying the Docker image file and the docker-compose.yaml file.

In BUS-OBC terminal C, move the sample app and the docker-compose.yaml to MISSION-OBC using the FTP command as follows.

[BUS-OBC terminal C]
cd ~/
sftp {MISSION-OBC user name}
mkdir /mnt/open-set/files/exp-01
cd /mnt/open-set/files/exp-01
put ./sample_app.tar.gz
put ./01_docker-compose.yaml
quit

This will place sample_app.tar.gz and 01_docker-compose.yaml in /mnt/open-set/files/exp-01 on the MISSION-OBC.

3.2. Sending a request for the MoveFile file transfer command

Next, we will execute the MoveFile command to move the file /mnt/open-set/files/exp-01/sample_app.tar.gz on the MISSION-OBC to the application execution file location /export/home/exp-01. This command moves the specified file to the application execution file location, which is uniquely determined by the parameter value. First, edit the parameter file for the MoveFile command in BUS-OBC Terminal C as follows.

[BUS-OBC Terminal C]
cd /opt/open-set/tests/tools/ifsw_verification/commands
vi JSON/0x60-MoveFile.json

[0x60-MoveFile.json]
{
 "command_id": "0x60",
 "parameter": [
     {"file_path": "sample_app.tar.gz"},
     {"attribute": "0x00"},
     {"app_uid": "0x01"},
     {"obs_id": null}
 ]
}

After saving the edited contents, enter 0x60 (MoveFile command) at BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x60 (Enter)

If the following output is obtained at BUS-OBC Terminal A (status command server) immediately after, the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
	{"command_id": "0xe0", "parameter": [{"response_code": 0}, {"app_uid": "0x01"}, {"file_path": XXX}]}
   Args to be passed:  [XXX]
   response code : 0
   Command executed : EndMoveFile
   app_uid : 0xff
   file info : 
   XXX
   
   **********************************************************   

Similarly, move the file /mnt/open-set/files/exp-01/01_docker-compose.yaml on the MISSION-OBC to the application execution file location /export/home/exp-01.

[BUS-OBC Terminal C]
cd /opt/open-set/tests/tools/ifsw_verification/commands
vi JSON/0x60-MoveFile.json

[0x60-MoveFile.json]
{
 "command_id": "0x60",
 "parameter": [
     {"file_path": "01_docker-compose.yaml"},
     {"attribute": "0x10"},
     {"app_uid": "0x01"},
     {"obs_id": null}
 ]
}

Note : Don't forget to change the attribute value to 0x10.

After saving the edited contents, enter 0x60 (MoveFile command) at BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x60 (Enter)

If the following output is obtained at BUS-OBC Terminal A (status command server) immediately after, the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
	{"command_id": "0xe0", "parameter": [{"response_code": 0}, {"app_uid": "0x01"}, {"file_path": XXX}]}
   Args to be passed:  [XXX]
   response code : 0
   Command executed : EndMoveFile
   app_uid : 0xff
   file info : 
   XXX
   
   **********************************************************   

3.3. Sending a request for the DeployApp command

Once you have moved the sample app to the app execution file storage location, execute the DeployApp command to deploy it. This command specifies the app in the execution file storage location as a parameter and deploys it. Edit the parameter file for the DeployApp command in BUS-OBC Terminal C as follows.

[BUS-OBC Terminal C]
vi JSON/0x21-DeployApp.json

[0x21-DeployApp.json]
{
 "command_id": "0x21",
 "parameter": [
    {"deploy_method": "0x00"},
    {"image_file": "sample_app.tar.gz"},
    {"app_uid": "0x01"} 
 ]
}

After saving the edited contents, enter 0x21 (DeployApp command) on BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x21 (Enter)

After a short while, if you get the following output on BUS-OBC Terminal A (Status Command Server), the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
	{"command_id": "0xa1", "parameter": [{"response_code": 0}, {"deploy_method": "0x00"}, {"image_tag": XXX}, {"app_uid": "0x01"}, {"creation_time": XXX}]}
   Args to be passed:  [XXX]
   response code : 0
   Command executed : EndDeployApp
   [EndDeployApp] Loaded image: XXX
   App UID: 0xff
   Deploy method: 0x00
   Creation Time: XXX
   **********************************************************   

4. Checking the deployed app

In this chapter, we will check the contents of the deployed app before running it. This chapter can be omitted. Although we recommend checking the contents of the app before running it for operational reasons, there will be no problem with the app execution results even if you omit this chapter.

4.1. Sending a request for the directory information acquisition command (GetDirectory)

First, use the GetDirectory command to check whether the app file exists. This is a command that displays a list of files in the specified directory. On the BUS-OBC Terminal C, edit the parameter file for the GetDirectory command as follows.

[BUS-OBC Terminal C]
sudo vi JSON/0x62-GetDirectory.json

[0x62-GetDirectory.json]
{
 "command_id": "0x62",
 "parameter": [
     {"path": "/export/home/exp-01"}
 ]
}

After saving the edited contents, enter 0x62 (GetDirectory command) at BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x62 (Enter)

If you get the following output on BUS-OBC Terminal A (Status Command Server) immediately after that, the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
	{"command_id": "0xe2", "parameter": [{"response_code": 0}, {"path": XXX}, {"contents": XXX}]}
   Args to be passed:  [XXX]
   response code : 0
   Command executed : EndGetDirectoryList
   --- Got directory info: XXX
   ---------------------------------------------------
   **********************************************************

4.2. Sending a request for the GetFile command (to obtain file contents)

Next, we will execute the GetFile command to check the contents of the application file. This is a command that reads the contents of the specified file. On BUS-OBC Terminal C, edit the parameter file for the GetFile command as follows.

[BUS-OBC Terminal C]
vi JSON/0x24-GetFile.json

[0x24-GetFile.json]
{
    "command_id": "0x24",
    "parameter": [
       {"config_file_name": "/export/home/exp-01/01_docker-compose.yaml"}
    ]
}

After saving the edited contents, enter 0x24 (GetFile command) on BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x24 (Enter)

If you get the following output from BUS-OBC Terminal A (Status Command Server) immediately after, the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
	{"command_id": "0xa4", "parameter": [{"response_code": 0}, {"config_result": XXX}]}
   Args to be passed:  [XXX]
   response code : 0
   Command executed : EndGetFile
   [EndGetFile] config file info : 
	 XXX
   
   **********************************************************   

4.3. Sending a request for the GetAppInfo command (to obtain information about deployed apps)

Finally, we will execute the GetAppInfo command to obtain information about deployed apps. This is a command for obtaining information about deployed apps. On BUS-OBC Terminal C, edit the parameter file for the GetAppInfo command as follows.

[BUS-OBC Terminal C]
sudo vi JSON/0x22-GetAppInfo.json

[0x22-GetAppInfo.json]
{
 "command_id": "0x22",
 "parameter": [
    {"deploy_method": "0x00"}
 ]
}

After saving the edited contents, enter 0x22 (GetAppInfo command) on BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x22 (Enter)

Immediately after, if the following output is obtained on BUS-OBC Terminal A (status command server), the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
	{"command_id": "0xa2", "parameter": [{"response_code": 0}, {"deploy_method": "0x00"}, {"all_image": XXX}]}
   Args to be passed:  [XXX]
   response code : 0
   Command executed : EndGetAppInfo
   deploy_method :  0x00
   List of loaded images:
   XXX
   **********************************************************  

5. Executing the application

In the previous chapter, we checked the information on the deployed application before executing it.

5.1. Preparing the image file.

Copy the image files to MISSION-OBC using the same procedures as described in chapters 3.1 and 3.2.

In BUS-OBC terminal C, move the image file for inference to MISSION-OBC using the FTP command as follows.

[BUS-OBC terminal C]
cd ~/
ssh {MISSION-OBC alias name} "mkdir -p /mnt/open-set/files/exp-01/obs-0001/input"
sftp {MISSION-OBC alias name}
cd /mnt/open-set/files/exp-01/obs-0001/input
put ./sample_image.jpg
quit

This will place sample_image.jpg in /mnt/open-set/files/exp-01/obs-0001/input/ on the MISSION-OBC.

Next, we will execute the MoveFile command to move the file /mnt/open-set/files/exp-01/obs-0001/input/sample_image.jpg on the MISSION-OBC to the application execution file location /export/home/exp-01/obs-0001/input. This command moves the specified file to the application execution file location, which is uniquely determined by the parameter value. First, edit the parameter file for the MoveFile command in BUS-OBC Terminal C as follows.

[BUS-OBC Terminal C]
cd /opt/open-set/tests/tools/ifsw_verification/commands
vi JSON/0x60-MoveFile.json

[0x60-MoveFile.json]
{
 "command_id": "0x60",
 "parameter": [
     {"file_path": "sample_image.jpg"},
     {"attribute": "0x20"},
     {"app_uid": "0x01"},
     {"obs_id": "0x0001"}
 ]
}

After saving the edited contents, enter 0x60 (MoveFile command) at BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x60 (Enter)

If the following output is obtained at BUS-OBC Terminal A (status command server) immediately after, the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
	{"command_id": "0xe0", "parameter": [{"response_code": 0}, {"app_uid": "0x01"}, {"file_path": XXX}]}
   Args to be passed:  [XXX]
   response code : 0
   Command executed : EndMoveFile
   app_uid : 0xff
   file info : 
   XXX
   
   **********************************************************   

If there are no problems, it's time to finally execute the application.

5.2. Sending a request to execute the application (ExecuteApp)

To execute the application, we will execute the ExecuteApp command. This is a command that executes the application specified by the parameters. On BUS-OBC Terminal C, edit the parameter file for the ExecuteApp command as follows.

[BUS-OBC Terminal C]
vi JSON/0x25-ExecuteApp.json

[0x25-ExecuteApp.json]
{
 "command_id": "0x25",
 "parameter": [
   {"deploy_method": "0x00"},
   {"app_uid": "0x01"},
    {"obs_id": "0x0001"}
 ]
}

At this point, check that the app_uid matches the number of the sample app's location (exp-01). After saving the edited contents, enter 0x25 (ExecuteApp command) on BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x25 (Enter)

After that, enter 0x00 (GetTelemetry command) in BUS-OBC Terminal B (Command Client). If the telemetry app_uid, obs_id, and scp_num have changed from their initial values (0), the app is running.

5.3. Ending the app

After running the app, wait for a while, and if you get the following output on BUS-OBC Terminal A (Status Command Server), the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
	{"command_id": "0xa5", "parameter": [{"response_code": 0}, {"app_name": [XXX]}, {"app_uid": "0x01"}, {"obs_id": "0x0001"}, {"real_result": XXX}, {"arch_result": "export/home/exp-01/obs-0001/toGround_arch/result_exp-01_obs-0001.tar.gz"}]}
   Args to be passed:  [XXX]
   response code : 0
   Command executed : EndExecuteApp
   [EndExecuteApp] Container name:  [XXX]
   App UID: 0xff
   Obs ID: 0x0001
   Real result directory:  
   Arch result directory:  XXX
   **********************************************************   

If the app_uid, obs_id, and scp_num of the telemetry are initial values (0) when 0x00 (GetTelemetry command) is executed in BUS-OBC terminal B (command client), the app has ended.

In addition, if 1200 seconds or more have elapsed since the MISSION-OBC startup while the app is running, the app will be forcibly terminated in the middle. This is because the app has timed out due to FDIR.

6. Collecting the results

In this chapter, we will collect the results of the application execution.

6.1. Sending a request for the GetResult command (to collect the execution results)

To re-collect the results of the application execution, we will execute the GetResult command. This is a command that displays the path to the execution results file for the specified application. We will use this path when collecting the execution results file in the next step. At BUS-OBC Terminal C, edit the parameter file for the GetResult command as follows.

[BUS-OBC Terminal C]
vi JSON/0x27-GetResult.json

[0x27-GetResult.json]
{
 "command_id": "0x27",
 "parameter": [
    {"app_uid": "0x01"},
    {"obs_id": "0x0001"}
 ]
}

After saving the edited content, enter 0x27 (GetResult command) on BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x27 (Enter)

If you get the following output from BUS-OBC Terminal A (Status Command Server) immediately after, the command has been executed successfully.

[BUS-OBC Terminal A]
**********************************************************
Received status command (json): 
	{"command_id": "0xa7", "parameter": [{"response_code": 0}, {"app_name": [XXX]}, {"app_uid": "0x01"}, {"obs_id": "0x0001"}, {"real_result": XXX}, {"arch_result": "export/home/exp-01/obs-0001/toGround_arch/result_exp-01_obs-0001.tar.gz"}]}
   Args to be passed:  [XXX]
   response code : 0
   Command executed : EndGetAppResult
   [PutAppResult] Container name:  [XXX]
   App UID: 0xff
   Obs ID: 0x0001
   Real result directory:  
   Arch result directory:  export/home/exp-01/obs-0001/toGround_arch/result_exp-01_obs-0001.tar.gz
   **********************************************************   

At this point, please record the value of the Arch result directory.

6.2. Collecting the execution result file

Use the path (Arch result directory) obtained in the previous command. In BUS_OBC Terminal C, use the FTP command to download the application execution result file from MISSION-OBC as follows.

[BUS-OBC Terminal C]
cd ~/
sftp {MISSION-OBC alias name}
get /{GetResult result path}

This will save the application execution result file in your home directory.

6.3. Sending a request for the execution result acquisition notification command (NotifyGetFile)

Execute NotifyGetFile to record in the MISSION-OBC log that the application execution result file has been collected using FTP GET. This command leaves a record in the log that FTP GET has been performed, and makes the result file, which has been collected and is no longer needed, the target of the DeleteFile command. Edit the parameter file for the NotifyGetFile command as follows in BUS-OBC Terminal C.

[BUS-OBC Terminal C]
cd /opt/open-set/tests/tools/ifsw_verification/commands
vi JSON/0x61-NotifyGetFile.json

[0x61-MoveFile.json]
{
 "command_id": "0x61",
 "parameter": [
     {"path": "{GetResult result path}"},
     {"delete_file": 1},
     {"app_uid": "0x01"}
 ]
}

After saving the edited contents, enter 0x61 (NotifyGetFile command) on BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x61 (Enter)

If the following output is obtained immediately after that on BUS-OBC Terminal A (Status Command Server), the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
 {"command_id": "0xe1", "parameter": [{"response_code": 0}, {"path": XXX}]}
Args to be passed:  [XXX]
response code : 0
Command executed : EndGetFile
path : XXX
**********************************************************

7. Deleting the application and execution results

In this chapter, we will delete the container application used in this time and the application execution result file that was obtained. This chapter can be omitted. If the size of the app execution result files you have already obtained is not a problem, you can execute the app multiple times and then execute step 7.2 in this chapter.

7.1. Sending a request to delete a Docker image (DeleteFile)

To delete the container app we have used, we will execute the DeleteFile command. This is a command that deletes files/directories/containers that are older than the specified date/time, as specified by the parameters. At BUS-OBC Terminal C, edit the parameter file for the DeleteFile command as follows.

[BUS-OBC Terminal C]
vi JSON/0x63-DeleteFile.json

[0x63-DeleteFile.json]
{
 "command_id": "0x63",
 "parameter": [
     {"target": "open-set/sampleapp-yolov5:latest"},
     {"type": "0x02"}
 ]
}

After saving the edited contents, enter 0x63 (DeleteFile command) in BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x63 (Enter)

If the following output is obtained in BUS-OBC Terminal A (status command server) immediately after, the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
 {"command_id": "0xe3", "parameter": [{"response_code": 0}, {"target": "open-set/sampleapp-yolov5:latest"}]}
Args to be passed:  [XXX]
response code : 0
Command executed : EndDeleteFile
XXX is removed.

7.2. Sending a request for the DeleteFile command (DeleteFile)

Next, in order to delete the app execution results that have already been obtained from MISSION-OBC, we will execute the DeleteFile command again with different parameters. In BUS-OBC Terminal C, edit the parameter file for the DeleteFile command as follows.

[BUS-OBC Terminal C]
vi JSON/0x63-DeleteFile.json

[0x63-DeleteFile.json]
{
 "command_id": "0x63",
 "parameter": [
     {"target": "/mnt/open-set/trash/exp-01/result_exp-01_obs-0001.tar.gz"},
     {"type": "0x00"}
 ]
}

Here, replace "app_result_file" with the name of the application execution result file (the path to the file is not required) that you obtained in 6.1. After saving the edited contents, enter 0x63 (DeleteFile command) in BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x63 (Enter)

If the following output is obtained immediately after that on BUS-OBC Terminal A (Status Command Server), the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
 {"command_id": "0xe3", "parameter": [{"response_code": 0}, {"target": "AppXXX:latest"}]}
Args to be passed:  [XXX]
response code : 0
Command executed : EndDeleteFile
XXX is removed.
**********************************************************

8. Retrieving the log

In this chapter, we will retrieve the log data recorded through this operation. This chapter is also not related to the execution of the application, so it can be omitted, but it is basically recommended that you carry it out.

8.1. Sending a request for the log retrieval command (GetLog)

To retrieve the log data, we will execute the GetLog command. This is a command that collects the service logs of each Open-SET service and compresses them into an archive file. On BUS-OBC Terminal C, edit the parameter file for the GetLog command as follows.

[BUS-OBC Terminal C]
vi JSON/0x01-GetLog.json

[0x01-GetLog.json]
{
 "command_id": "0x01",
 "parameter": [
       {"time_id": null}
     ]
}

After saving the edited contents, enter 0x01 (GetLog command) at BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x01 (Enter)

Immediately after, if the following output is obtained at BUS-OBC Terminal A (status command server), the command has been executed successfully.

[BUS-OBC Terminal A]
Received status command (json): 
 {"command_id": "0x81", "parameter": [{"response_code": 0}, {"log_path": XXX}]}
Args to be passed:  [XXX]
response code : 0
Command executed : EndGetLogInfo
**********************************************************

At this point, please record the log archive file path (log_path) for the next downlink procedure.

8.2. Downlink of Logs

Next, to downlink the archive file created by the GetLog command to the ground, execute the following FTP command in BUS-OBC Terminal C.

[BUS-OBC Terminal C]
cd ~/
sftp {MISSION-OBC user name}
get /{GetLog archive file path}

This will save the log archive file in your home directory.

9. Shutting down

In this chapter, we will shut down the MISSION-OBC to end the operation.

9.1. Sending a shutdown command (Shutdown) request

Enter 0x02 (shutdown command) at BUS-OBC Terminal B (command client).

[BUS-OBC Terminal B]
0x02 (Enter)

If the MISSION-OBC shuts down immediately after this, the command has been executed successfully.

10. Checking the Application Execution Results

In this chapter, we will check the application execution results obtained in this operation. Execute the following in BUS-OBC Terminal C.

[BUS-OBC Terminal C]
tar xvzf result_exp-ff_obs-0001.tar.gz

Once the compressed file has been extracted, please check that there is an image file of the execution result inside. If you find an image like the one below, the inference on the satellite onboard has been successful.

Vehicle detection result