AWS IoT Setup  |   AWS IoT Greengrass Setup  |   AWS Machine Learning Interface

AWS SDK Setup  |   AWS SDK Rekognition

GCP IoT Setup

GCP SDK Setup

Device: Camera Setup


1. Prepare RPI

# 1.1 Get the model of your RPI, RPI3B or B+ are  needed
cat /proc/cpuinfo

# 1.2 Determine the architecture of your RPI
uname -m
# The result must be greater than or equal to armv71

# 1.3 Set up RPI
https://docs.aws.amazon.com/greengrass/latest/developerguide/module1.html

# 1.4 Create a conda Python enviroment
conda create --name pinenuts python=3.6 -y

# 1.5 Activate environment
source activate pinenuts


2. Prepare using AWS IoT

# 2.1 Create an AWS account
https://aws.amazon.com/

# 2.2 Install git
sudo apt-get install git

# 2.3 Check OpenSSL version
python
>>> import ssl
>>> print(ssl.OPENSSL_VERSION)
OpenSSL 1.0.2r  26 Feb 2019
>>> exit()

# If the OpenSSL version is < 1.0.1, update OpenSSL for
your distribution
sudo apt-get update openssl


3. Connect to AWS IoT

3.1 Register a device


3.2 Download a connection kit

The connection kit includes some important components: security credentials, the SDK of your choice, and a sample project.


3.3 Configure and test your device

Using the connection kit, you will configure your device by transferring files and running a script, and test that it is connected to AWS IoT correctly.

# 1: Unzip the connection kit on the device
cd /home/pi/Documents/Iot_EdgeComputing/src
mkdir connect_device
unzip connect_device_package.zip -d connect_device

# 2: Add execution permissions
cd connect_device
chmod +x start.sh

# 3: Run the start script. Messages from your thing will appear below

./start.sh

# The aws-iot-device-sdk-python will automatically installed
# If ModuleNotFoundError: No module named 'AWSIoTPythonSDK'
pip install AWSIoTPythonSDK


# 4. Waiting for messages from your device
  '''
  Received a new message:
  {"message": "Hello World!", "sequence": 681}
  from topic:
  sdk/test/Python
  '''