Robot Control using Raspberry Pi

Lecture 7 - A minimal introduction to Minipupper V2 on Greengrass

Li Bai

Temple University

October 9, 2023

AWS RoboMaker Workflow

Note

  • Deployment using IoT Greengrass 2.0 (robot_ws)
  • Docker container registry (contain OS integrity)
  • ECR
  • Cloud storage (S3 - Simple Storage Services)

AWS Greengrass Deployment Process

Requirements

  • ASW Cloud 9 (with setup script used)

Note

curl -fsSL "https://bit.ly/robomaker2204" | sudo -E bash -

Greengrass terminologies used

  • physical devices (thing in a thing group)
  • less powerful processor
  • use jupyter lab
  • minipupper.ipynb download here
  • need to setup docker-compose
  • more powerful processor
  • need to cross compile for arm64 process
  • setup script to develop component (ROS code, how to get it launched)
  • use a receipt to create a greengrass component for launch
  • store the docker instance so mini pupper will receive it
  • need to login, tag the docker instance
  • store configuration file
  • static location for data transfer
  • lower cost storage service
  • MQTT protocol
  • publisher/subscriber topics - dance_config
  • need a greengrass bridge
  • IoT and greengrass

New Setup Raspberry Pi - Balena Etcher

  • Use Etcher to copy the new image to your MicroSD card

Setup Raspberry Pi - Find downloaded image

Setup Raspberry Pi - Select MicroSD card

Setup Raspberry Pi - Find downloaded image

Setup Raspberry Pi - Select microSD card

Setup Raspberry Pi - request for Admin password

Setup Raspberry Pi - Enter Admin Password

Setup Raspberry Pi - Start flashing

Setup Raspberry Pi - microSD card flashing

Setup Raspberry Pi - You can skip verify

Setup Raspberry Pi - Done flashing the microSD card

Remove microSD Card and resert

  • make sure you see a new driver system-boot

revise the ID as TU AccessNet in wireless.txt

  • line 1 remove @temple.edu
  • line 2 hash from your password in previous lecture
export ID=lbai@temple.edu
export HASH=1fd3e3e2a1d6aace8451df53e5c8c429
export USEROAM=1
export AP=eduroam
#export WIFI_AP1=L5GLB_Ext
#export WIFI_AP1_PWD=fsserwe
#export WIFI_AP2=YYDS
#export WIFI_AP2_PWD=fsserwwee

Open wireless.txt file

  • comment line 3 and 4,
export ID=lbai
export HASH=1fd3e3e2a1d6aace8451df53e5c8c429
#export USEROAM=1
#export AP=eduroam
#export WIFI_AP1=L5GLB_Ext
#export WIFI_AP1_PWD=fsserwe
#export WIFI_AP2=YYDS
#export WIFI_AP2_PWD=fsserwwee

Copy the wifi password

  • Drag and drop the wireless.txt into system-boot folder

Boot the raspberry pi after your insert microSD card

  • If you see the IP address on the screen

Open a browser

  • type http://[ipaddress]:8888
  • password mangdang

Open a terminal

  • Open a new terminal

Download a git repo

  • Download Mangdang
git clone http://github.com/lbaitemple/mangdang

Find the mangdang folder

  • refresh the folder window

Find files in the mangdang folder

Open the python notebook

Run the second block to install greengrass

Log into AWS Academy

Check AWS Details

Find the login credential

Go back to the jupyter lab on RPi4

  • add the credential from AWS academy credential

Go back to the jupyter lab on RPi4

  • revise thing name and thing group
  • run the block

Thing is created on AWS IoT

Things are added on IoT Core

Add greengrass user

greengrass user is added

Check on AWS IoT Core

Find Things on IoT

Find Things on IoT

Find Thing Group on IoT

Find thing on Greengrass

Find Deployment on IoT

Login on AWS Cloud 9

  • make sure you add arm cross compile
  • copy one line at a time
sudo apt-get install -y qemu-user-static binfmt-support
sudo apt  install docker-compose  -y
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
  • Git clone the repo on cloud 9
git clone -b ros2-dev https://github.com/lbaitemple/mini-pupper-aws
cd mini-pupper-aws
docker-compose build

S3 setup

Need to have a simple storage service (s3) to pass files from cloud to edge devices

Find S3 on AWS Console

Setup a S3

select a name for s3 repo

  • try to use your name initials and date (must be unique)

setup permision

setup permision

  • unlock permission

Create the s3 Repo

ECR setup

need to setup a repository to store docker instances

Create a ECR

ros-humble-greengrass-minipupper

upload docker image on ECR

  • Use ECR commands
ros-humble-greengrass-minipupper

Cloud 9 Setup

  • revise line 4 with your s3 repository name
  • revise line 6 with your ECR name (if it is needed)

Docker-compose build

  • take about 1300 - 1400 seconds

Run a bash script in Cloud 9

bash ./awsgreengrass.sh

Greengrass Deloyment to Mini Pupper v2

Greengrass Deloyment to Mini Pupper v2

Greengrass Deloyment to Mini Pupper v2

Greengrass Deloyment to Mini Pupper v2

Greengrass Deloyment to RPi

Greengrass Deloyment to Mini Pupper v2

  • you can run the commands in a command terminal
ps -aux | grep docker

Greengrass Deloyment to Mini Pupper v2

  • check what docker images are available
docker image list

Greengrass Deloyment to Mini Pupper v2

  • check what docker process are available
docker ps -a

MQTT

MQTT

MQTT

  • Also, try my_demo

[Minipupper Greengrass Excercise*]

  • create a new cloud9 instance
  • git clone the source and modify the ECR to be mini-pupper-foxy
  • Put your code and instruction on your github
  • show where you changed in your Dockerfile
  • show where you modified the docker-compose.yaml file
  • show any other files needed to be changed
  • show foxy instance running on the mini pupper

When you submit a report, please include the corrected procedures and give the screen shots based on the checkoff.