Sending data to the cloud
As with most things on the AWS platform, there are always several ways to design and build a solution; in this case, it depends on our ultimate goals:
- Process data locally on the edge? In this case, we need to build another custom component that listens to the correct topic for a response. The topic for this example would be
modbus\response\conveyer
, mapping directly to the name we provided in our ModbusTCP component configuration. Example code for this type of component is readily available in online examples and you can follow the same process we used for the request component. - Forward data to the cloud? Suppose the only thing we need to do is forward the data to IoT Core. In that case, we can simplify our work somewhat by using a prebuilt component to deliver data to the cloud directly from local Greengrass IPC messages.
The reality is that it is probably a combination of these two goals we aim to achieve: process data at least somewhat...