- What is AWS IoT Greengrass?
- Getting Started with AWS IoT Greengrass
- BeagleBone AI AWS device listing
- Quick Start Guide
- System Reference Manual
- Defaults
- username: debian
- password: temppwd
- Where not specified below, commands are to be executed on BeagleBone AI's Linux command shell
- If on the same local network as BeagleBone AI and using a typical Linux host development PC (recommended), you can login via:
ssh [email protected]
Using the latest image is likely to save time over updating the pre-installed image. Use the BalendaEtcher tool to write this image to a microSD card (at least 8GB). You can follow the getting started instructions on BeagleBoard.org, but note 2 things:
- The image linked below is a different one than on https://beagleboard.org/latest-images, possibly a bit newer and it is also a flasher image.
- Being a flasher image, this will therefore overwrite your eMMC. See the wiki page on the Debian images for more information about flasher images.
- Update instructions
- Use instructions to get on a network
- The kernel update is most important
- You may want to point a fan towards the board during the initial update process
/opt/scripts/device/x15/test_thermal.sh
cpufreq-info
hostname -I
passwd
Host
ssh-keygen -t ed25519
ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]
Beagle
sudo perl -pe "s/\#?PermitRootLogin .*$/PermitRootLogin no/" -i /etc/ssh/sshd_config
sudo perl -pe "s/\#?PasswordAuthentication .*$/PasswordAuthentication no/" -i /etc/ssh/sshd_config
sudo perl -pe "s/\#?UsePAM .*$/UsePAM no/" -i /etc/ssh/sshd_config
sudo perl -pe "s/\#PermitRootLogin .*$/PermitRootLogin no/" -i /etc/ssh/sshd_config
sudo systemctl disable nodered.socket
sudo systemctl disable bonescript.socket
sudo systemctl disable bonescript-autorun
sudo systemctl disable cloud9.socket
sudo systemctl disable nginx
sudo systemctl set-default multi-user.target
sudo systemctl disable hostapd
sudo systemctl disable bb-bbai-tether
sudo perl -pe 's/^\# (USB_IMAGE_FILE_DISABLED=yes)$/$1/' -i /etc/default/bb-boot
sudo perl -pe 's/^\# (USB_NETWORK_DISABLED=yes)$/$1/' -i /etc/default/bb-boot
sudo adduser --system ggc_user
sudo addgroup --system ggc_group
cat <<EOF | sudo tee /etc/sysctl.d/98-beagle.conf
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
EOF
echo "cmdline=coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet cgroup_enable=memory cgroup_memory=1" >> /boot/uEnv.txt
sudo apt install openjdk-8-jdk
sudo ln -s /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java /usr/bin/java8
sudo apt install snapd
sudo snap install core
sudo snap install node --channel=8/stable --classic
sudo ln -s /snap/bin/node /usr/bin/nodejs8.10
sudo apt install -y libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm
sudo apt install -y libncurses5-dev libncursesw5-dev tk-dev
cd
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
tar xzf Python-3.7.0.tgz
cd Python-3.7.0/
./configure --enable-optimizations --with-ensurepip=install
make -j2
sudo make altinstall
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=armhf] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
sudo pip3 install docker-compose
sudo shutdown -r now
sudo sysctl -a 2> /dev/null | grep fs.protected
wget https://github.com/aws-samples/aws-greengrass-samples/raw/master/greengrass-dependency-checker-GGCv1.10.x.zip
unzip greengrass-dependency-checker-GGCv1.10.x.zip
cd greengrass-dependency-checker-GGCv1.10.x
sudo ./check_ggc_dependencies
Host
ssh [email protected] -o PubkeyAuthentication=no
Host
wget https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/1.10.0/greengrass-linux-armv7l-1.10.0.tar.gz
scp greengrass-linux-armv7l-1.10.0.tar.gz [email protected]:
scp d956f9e660-setup.tar.gz [email protected]:
Beagle
cd
sudo tar xzf greengrass-linux-armv7l-1.10.0.tar.gz -C /
sudo tar xzf d956f9e660-setup.tar.gz -C /greengrass
sudo wget https://www.amazontrust.com/repository/AmazonRootCA1.pem -O /greengrass/certs/root.ca.pem
cd /greengrass/ggc/core/
sudo ./greengrassd start
cat <<EOF | sudo tee /etc/systemd/system/greengrass.service
[Unit]
Description=Greengrass Daemon
[Service]
Type=forking
PIDFile=/var/run/greengrassd.pid
Restart=on-failure
ExecStart=/greengrass/ggc/core/greengrassd start
ExecReload=/greengrass/ggc/core/greengrassd restart
ExecStop=/greengrass/ggc/core/greengrassd stop
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable greengrass
sudo usermod -aG sudo debian
cat <<EOF | sudo tee -a /etc/sudoers
debian ALL=(ALL) NOPASSWD: ALL
EOF
- Instructions
- Download devicetester_greengrass_linux_2.2.0.zip from instructions linked above
- You can use aws-cli from snapcraft.io as documented below
- The IP address and keypath below are specific to my setup and you'll need to update
Host (Ubuntu 18.04)
sudo snap install aws-cli --classic
aws configure
unzip devicetester_greengrass_linux_2.2.0.zip
cd devicetester_greengrass_linux
cat <<EOF >configs/device.json
[
{
"id": "bbai1",
"sku": "bbone-ai.a1",
"features": [
{
"name": "os",
"value": "linux"
},
{
"name": "arch",
"value": "armv7l"
}
],
"greengrassLocation": "/greengrass",
"devices": [
{
"id": "bbai1.1",
"connectivity": {
"protocol": "ssh",
"ip": "192.168.0.115",
"auth": {
"method": "pki",
"credentials": {
"user": "debian",
"privKeyPath": "/home/jkridner/.ssh/id_rsa"
}
}
}
}
]
}
]
EOF
cat <<EOF >configs/config.json
{
"log": {
"location": "../logs/"
},
"configFiles": {
"root": "../configs",
"device": "../configs/device.json"
},
"testPath": "../tests/",
"reportPath": "../results/",
"certificatePath": "../certificates/",
"awsRegion": "us-west-2",
"auth": {
"method": "file",
"credentials": {
"profile": "default"
}
}
}
EOF
bin/devicetester_linux_x86-64 run-suite --suite-id GGQ_1 --pool-id bbai1