Test Amazon IoT Greengrass components with local deployments
If you develop a Greengrass component on a core device, you can create a local deployment to install and test it. Follow the steps in this section to create a local deployment.
If you develop the component on a different computer, such as a local development computer, you can't create a local deployment. Instead, publish the component to the Amazon IoT Greengrass service so that you can deploy it to Greengrass core devices to test it. For more information, see Publish components to deploy to your core devices and Deploy Amazon IoT Greengrass components to devices.
To test a component on an Greengrass core device
-
The core device logs events such as component updates. You can view this log file to discover and troubleshoot errors with your component, such as an invalid recipe. This log file also displays messages that your component prints to standard out (stdout). We recommend that you open an additional terminal session on your core device to observe new log messages in real time. Open a new terminal session, such as through SSH, and run the following command to view the logs. Replace
with the path to the Amazon IoT Greengrass root folder./greengrass/v2
You can also view the log file for your component.
-
In your original terminal session, run the following command to update the core device with your component. Replace
with the path to the Amazon IoT Greengrass root folder, and replace/greengrass/v2
~/greengrassv2
with the path to your local development folder.Note
You can also use the
greengrass-cli deployment create
command to set the value of your component's configuration parameters. For more information, see create. -
Use the
greengrass-cli deployment status
command to monitor the progress of your component's deployment. -
Test your component as it runs on the Greengrass core device. When you finish this version of your component, you can upload it to the Amazon IoT Greengrass service. Then, you can deploy the component to other core devices. For more information, see Publish components to deploy to your core devices.