The Secure Device Onboard (SDO) All-In-One demo is designed to run SDO Manufacturer service, SDO IoT Platform SDK Service and SDO Rendezvous Service within a single instance of tomcat server. The purpose of this demo is to fast-track demonstration of Secure Device Onboard protocol using different client implementations.
The following are the system constraints for the All-in-One demo.
- Operating System: Ubuntu* 18.04
- Java* Runtime Environment 11
- Docker 18.09 (Optional)
- Docker compose 1.21.2 (Optional)
- Haveged
- Postman (Optional) to execute REST calls
Appropriate proxy configuration should be updated in _JAVA_OPTIONS environment variable.
The All-In-One demo can be executed in a couple of different ways. Once you start the demo, wait until all the services (OCS, OPS, TO0Scheduler, Manufacturer and Rendezvous) are initialized. At the end of initialization of all services, you will see following statement on console.
Completed Initialization in <Time> ms.
Follow one of the options below to start All-In-One demo.
Open a terminal and execute following command.
sh tomcat/bin/catalina.sh run
Open a terminal and execute following command.
docker-compose up --build
In case you need super user access, prefix 'sudo -E' to above command.
After All-In-One demo is initialized, use appropriate SDO Clients for demonstration.
The All-In-One demo listens at port 8080 for all incoming requests. You should modify SDO Client configurations to use port 8080 for DI.
This step assumes that either you have built the PRI source or you have the binaries associated with PRI repo.
The All-In-One demo provides sample configuration files for running PRI Device instance against All-In-One demo. The configuration file application.properties.aio and the execution script device-di-to is available in utils/sample-device folder. Copy these files into the 'pri/demo/device' folder within PRI repository and execute following command from there.
cd pri/demo/device
bash device-di-to
When the script 'device-di-to' is executed, the device executes DI and then subsequently TO1 and TO2 against the SDO services running within All-In-One demo.
After the script exeuction, the status of SDO Client execution is available in result.txt file.
All-In-One demo provides REST interfaces, which allows All-In-One demo administrator to update the configuration parameters as well as upload/download vouchers and payload files.
While executing the REST calls, prefix http://{host-ip-address}:8080 to the REST APIs below.
The REST calls can be executed through Postman or equivalent tools.
- For the authenticated calls, we need to select password based authentication with default credentials (username: 'aio', password: 'Sm9@wojk').
- For body of the message, use 'Binary' format wherever we need to upload a file.
Operation | REST API | Auth? | Description |
---|---|---|---|
PUT |
/api/v1/uploads/{file} | YES | Upload generic files used by All-In-One demo. |
DELETE |
/api/v1/uploads/{file} | YES | Delete uploaded files. |
GET |
/api/v1/files/{file} | NO | Get files uploaded through /api/v1/uploads/{file} |
PUT |
/api/v1/devices/{guid}/{file} | YES | Upload {file} (voucher/configuration file) for device corresponding to {guid} |
DELETE |
/api/v1/devices/{guid}/{file} | YES | Delete {file} (voucher/configuration file) for device corresponding to {guid} |
GET |
/api/v1/devices/{guid}/{file} | YES | Get {file} (voucher/configuration file) device corresponding to {guid} |
PUT |
/api/v1/values/{file} | YES | Upload the payload specified by {file} |
DELETE |
/api/v1/values/{file} | YES | Delete {file} from the values folder |
GET |
/api/v1/values/{file} | YES | Get the payload specified by {file} |
While executing a SDO Client from a different machine, you would need to change the IP address for Rendezvous service. The configuration can be changed by updating redirect.properties file. The example commands to perform the executions are provided below.
Create a text file called 'redirect.properties' and copy following contents.
# DNS of the Owner Protocol Service.
dns={host-ip-address}
# IP address of the Owner Protocol Service.
ip={host-ip-address}
# Port at which Owner Protocol Service is listening for incoming requests.
port=8080
The {host-ip-address} should be updated with actual IP address of host machine.
Upload the generated redirect.properties file using following REST API call.
PUT http://{host-ip-address}:8080/api/v1/values/redirect.properties