This project is a porting for Torizon of the original demo dlr-demo from NXP that demonstrates features of Amazon SageMaker Edge Manager and AWS IoT Greengrass V2.
On your Linux PC
Download and install the AWS CLI . Don't forget to follow the Pre-requisites and to configure the CLI
Install Docker. Don't forget to login the engine on your dockerhub account using the docker login command.
Install the following pre-requisites:
$ apt install sshpass
Connect Maivin to a router with internet connection using the Ethernet Cable. Connect it to the power supply. A blue light will turn on.
Scan your local network to find the board IP and MAC address. You can use the command line or some GUI-based software.
Connect to Maivin's terminal using ssh
with the default username torizon
:
$ ssh torizon@<board-ip>
The default password is torizon
. The system will ask you to change this password on firt boot. On some units, the default password may be already set to 1
.
On your board's terminal , stop the pre-provisioned containers by sending the command:
# sudo systemctl disable docker-compose
Reset the board.
# sudo reboot
Take a note of the IP and password.
Modify the project_settings.sh
file.
Set your selected AWS_REGION
.
Set PROJECT_NAME
with a unique project name.
Set DOCKERHUB_LOGIN
with your dockerhub username. This will be used to push and pull containers to Maivin.
Set your BOARD_IP
as found on the previous steps. You can also use the hostname.
Set BOARD_PWD
with the password for Maivin as described in the previous steps.
After setting up the project_settings.sh
file, on your PC, use setup_cloud_service.sh
script
$ cd aws-cloud-demo-torizon
$ ./setup_cloud_service.sh
It may take about 15 minutes to conclude.
on your PC, use setup_device.sh
script. This will install AWS IoT Greengrass on Maivin's filesystem, with its credentials and certificates.
$ ./setup_device.sh
After this, on your PC terminal, use greengrass.sh
to start execution of AWS IoT Greengrass on maivin:
$ ./greengrass.sh
This will start Nucleos.
You can execute everything by sending:
$ ./setup_cloud_service.sh && ./setup_device.sh && ./greengrass.sh
With AWS IoT Greengrass container running, On your PC, create a new terminal window. Connect to your board using ssh
:
$ ssh torizon@<board-ip>
On the board's terminal, connect to the shell of the running container:
# docker exec -it aws-cloud-demo-torizon /bin/bash
It will start the bash terminal of the container. The logs are on the /greengrass/v2/logs
directory:
## cd /greengrass/v2/logs/
## ls
aws.greengrass.LegacySubscriptionRouter.log
aws.greengrass.Nucleus.log
aws.greengrass.SageMakerEdgeManager.log
04_edgeManagerClientCameraIntegration.log
dlr-demo-torizon-mobilenet-ssd-v2-coco-quant.log
greengrass.log
main.log
On AWS Management Console, go to Kinesis Video Streams, and use the playback viewe to see the video output:
CAUTION: THIS WILL DELETE ALL THE THINGS ON YOUR AWS ACCOUNT.
To wipe all things and deployments created on your account, use the python cleanup.py
script.
$ python3 cleanup.py
CAUTION: THIS WILL DELETE ALL THE THINGS ON YOUR AWS ACCOUNT.