Skip to content

Latest commit

 

History

History
109 lines (82 loc) · 4.24 KB

README.md

File metadata and controls

109 lines (82 loc) · 4.24 KB

Contact Tracing with the Sentrius IG60 Gateway and BT710 Sensor

This repo contains an example application for the Sentrius IG60 Greengrass. This example will scan, find, and connect to BT710 sensors. Then download contact tracing data, parse and send to AWS Iot Core.

                       XXXXX
                     XXX   XXX
           XXXXX   XX        XX
        XXX    XX XX          X XXXXXXX
        X        XX            X       XX
       X                                X
        X         AWS Cloud              X
        XX                              X
         XXXXXXX                       XX
               XX          XXXX    XXXX
                XXX      XXX   XXXX
                  XXXXXXX
                      ^
                      +
                (MQTT with TLS)
                      +
                      v
            +---------+----------+
            |                    |
            |  Sentrius IG60  |
            |                    |
            +---------+----------+
                      ^
                      +
                     BLE
                      +
                      v
           +----------+------------+
           |                       |
           |        BT710          |
           |                       |
           +-----------------------+

Required Hardware

  • Sentrius IG60 Greengrass with internal BL654
  • Sentrius IG60 Summit Linux with internal BL654 - it is also possible, but Greengrass must be installed
  • Sentrus IG60 Serial - this is possible, but you must have a BL654 (451-0003) USB inserted
  • BT710 Sensor or BT510CT sensor

Provision Sentrius IG60 Gateway - this step must be completed before applcation can be deployed

Before the application can be deployed, the gateway must first receive AWS Certificates, this is done in the provisioning process for the gateway. Please see documentation.

Create IG60 Provisioning Server

Prepare-package

This application will run as an AWS Greengrass Lambda. Therefore it must be packaged into a Lambda function AWS Greengrass Docs

First, there is one modification required. Save src/ct_app_template.json as ct_app.json If you are using the USB BL654, change BL654_PORT to /dev/ttyUSB2

To aid in this task, there is a deployment bash script. This script will create a deploy folder, copy the source, download the dependencies, remove unnecessary files and zip up.

./deploy.sh

Required dependencies are listed in requirements.txt. Pip, zip, are required to package.

Create a Lambda Function

This can be done manually from the AWS Console.

  • Select Python3.7 as runtime
  • upload .zip file from Prepare deployment package
  • In Basic Settings, change the handler to app.handler
  • Publish a version

Deploy Lambda Function

For detailed steps, see the IG60 documentation Deploy step

In IoT Core, find your Greengrass Group

  • Add the existing Lambda Function
  • Edit the Lambda configuration
    • use ggc_user/ggc_group and Greengrass Container
    • Make the Lambda Long lived and keep running indefinitely
    • If you are using an LTE modem, set an environment variable "DBUS_SYSTEM_BUS_ADDRESS" with the value "unix:abstract=__dbus_proxy_socket__" to enable access to the Ofono D-Bus APIs

Add a local resource - Explicitly enable access to the BL654

  • Device (not volume)
  • Name is arbitrary. "ttyS2" works
  • path is /dev/ttyS2
    • If you are using the BL654 dongle, use /dev/ttyUSB2
  • Automatically add OS group permissions
  • read and write access
  • ensure that the resource is afilliated with the lambda

Add a subscription

  • From the lambda to IoT Cloud
  • topic is "summit/ig60/#" or "mg100-ct/#" for "mg100" format

Settings

  • Disable stream Manager
  • Enable cloud-watch logs
  • Provide permissions to write to CloudWatch logs