AWS IoT Greengrass
Developer Guide

Test Communications (Device Syncs Enabled)

For this test, you configure the GG_TrafficLight device shadow to sync to AWS IoT. You run the same commands as in the previous test, but this time the shadow state in the cloud is updated when GG_Switch sends an update request.

  1. In the AWS IoT Core console, choose your AWS IoT Greengrass group, and then choose Devices.

  2. For the GG_TrafficLight device, choose the ellipsis (), and then choose Sync to the Cloud.

    
                            Screenshot with Sync to the Cloud highlighted.

    You should receive a notification that the device shadow was updated.

  3. On the group configuration page, from Actions, choose Deploy to deploy the group configuration to your AWS IoT Greengrass core device.

    
                Screenshot of the Group page with the Deploy action 
                    highlighted.

    For troubleshooting help, see Troubleshooting AWS IoT Greengrass.

  4. In your two command-line windows, run the commands from the previous test for the GG_Switch and GG_TrafficLight devices.

  5. Now, check the shadow state in the AWS IoT Core console. Choose your AWS IoT Greengrass group, choose Devices, choose GG_TrafficLight, and then choose Shadow.

    Because you enabled sync of the GG_TrafficLight shadow to AWS IoT, the shadow state in the cloud should be updated whenever GG_Switch sends an update. This functionality can be used to expose the state of a Greengrass device to AWS IoT.

    
                            Shadow state showing "G" for the desired property and the
                                reported property.
    
                            After 20 seconds, shadow state showing "Y" for the desired
                                property and the reported property.

    Note

    If necessary, you can troubleshoot issues by viewing the AWS IoT Greengrass core logs, particularly runtime.log:

    cd /greengrass/ggc/var/log sudo cat system/runtime.log | more

    You can also view GGShadowSyncManager.log and GGShadowService.log. For more information, see Troubleshooting AWS IoT Greengrass.

Keep the devices and subscriptions set up. You use them in the next module. You also run the same commands.