sample - Python Matplot
This repository contains a Matplot Python example for building and deploying a service on the AOS Edge platform. Follow this guide to create a service on AosCloud, install custom layer on AosCloud, and sign and upload the service version. You can explore the example by checking out the source code.
Prerequisites
- Development Environment: A supported platform (VirtualBox or Raspberry Pi).
- AosCloud Account: An SP user account for AosCloud. See the AosEdge Dictionary for user types and the Get Access page for login help.
- Tools: AosCore SDK, Bash, Wget, Python and a virtual environment (
venv) are installed.
Install additional layer
If your implementation requires packages or libraries that are not present in the system, you can install them separately as an additional layer.
- Create a custom layer. You can find detailed instructions on how to create a custom layer.
- Upload the layer to the system. Go to the layers, click on the +, and upload your your-layer.tar.gz archive.

- Copy the layer ID. After uploading, copy the Layer ID — you will need it in the next step.
Prepare service for upload
Before signing and uploading your service to AosCloud, prepare the service by organizing the compiled binary and updating the configuration with the service UUID obtained from the Create a Service on AosCloud step.
Open the service configuration file ./meta/config.yaml and update the service_id field with the UUID you copied from the Service Detail screen in AosCloud:
nano ./meta/config.yaml
Example config.yaml:
service_id: '<YOUR_SERVICE_UUID>'
configuration:
layers:
- '<YOUR_LAYER_ID>'
Replace <YOUR_SERVICE_UUID> with the UUID saved earlier. Save and close the file.
Replace <YOUR_LAYER_ID> with the layer id saved earlier. Save and close the file.
Sign and upload service
Use the aos-signer tool to sign and upload your service to AosCloud.
In the service directory, run:
~/.aos/venv/bin/python3 -m aos_signer go
Expected output:
Starting SERVICE SIGNING process...
Starting CONFIG VALIDATION process...
Validating config... VALID
Copying application... DONE
Copying configuration... DONE
Copying default state... SKIP
Creating archive... DONE
Sing package... DONE
Creating service package... DONE
*
Starting SERVICE UPLOAD process...
Starting CONFIG VALIDATION process...
Validating config... VALID
Uploading... DONE
On success, the output ends with an Uploaded message. Verify the service details on the Services section of AosCloud.
Link unit and service together
Once your service is created and uploaded to the cloud, the next essential step is to link it with your unit.
You can accomplish this by creating a subject, which acts as the bridge between your unit and the service.
For detailed instructions on how to set this up, please refer to the following guide.
Please see Creating subject,
Access subject,
Assign unit to subject,
Assign service to subject chapters.
Approve service
-
Go to Validation Batches.
-
Select your service.

-
Click Approve to confirm the service.

At this stage, the service is applied to our environment.
Validate result of the service
-
For detailed instructions on working with logs, please refer to the Validate result of service chapter.
-
Open the log files in a text editor and search for the message
"Plot has been successfully created.".
If the message is found, the service is working correctly.