In the upper left corner, open the Services menu. Select the IAM service.

In the menu on the left, select Groups and then click the Create New Group button at the top.

Give the group a relevant name, like DynamoDB-Readers. Click Next Step.

Select the AmazonDynamoDBFullAccess policy. Click Next Step

Note

If your application requires more granular control of the permissions, you can create a new policy that only allows read/write access on the one DynamoDB instance. To enable this you’ll need the Amazon Resource Name (ARN) of the DynamoDB. For more information creating custom policies, see Amazon’s Creating a New Policy guide.

Rigado Vesta Gateways come pre-configured with Node-RED. The Gateway will start Node-RED when it boots. There are two ways to begin interacting with the Node-RED application:

Connect the Gateway to Ethernet. Then, using a computer connected to the same network, open a web browser page to the Gateway’s unit serial number with the suffix .local (e.g. http://b014012917-00065.local).

Run through the process to connect the Gateway to your local Wi-Fi network (see Setup Wi-Fi with the Wi-Fi configuration app). At the end of this process will be a page with a link to the Node-RED application. Click the link once the Gateway has finished rebooting.

Once you’re looking at the Node-RED application, import the DynamoDB example flow by selecting it from the menu in the upper-right corner.

Figure 2.2 Importing the example flow.

Figure 2.3 The DynamoDB flow

Note

Out of the box, the Gateway will run the “Rigado DevKit” flow, which is designed to connect to Nordic Thingy:52 devices and send their sensor data to AWS. If you aren’t using that flow, you can delete it from the settings menu.

Figure 2.4 With the “Rigado DevKit” flow selected, open the menu and hover over Flows. Click Delete to remove the flow.

It may be useful to disconnect the “limit 1 msg/s” and “BLEScanning” nodes so you can separately debug them. Just click on the connecting wire and then press Delete. Replace the wire by dragging from the output handle of “limit 1 msg/s” to the input handle of “BLEScanning”.

It is also worth noting the delay node (“limit 1 msg/s”), here configured to rate-limit 1 message per second and dropping intermediate messages. Running this flow without this rate-limit will result in a very large throughput to Amazon DynamoDB. This will quickly consume any available throughput for trial accounts. It is not recommended to run this flow without the delay node. However, you may want to tailor the delay to optimize your application. See Amazon’s guide on Provisioned Throughput for more information.

Enable either of the debug output nodes to see the responses from putting an item into DynamoDB or the formatted BLE data received from a scan.

Log into AWS DynamoDB and check that new data is arriving in the Tables > Items view.

Figure 2.8 Items inserted into the table

For more precise debug information, connect to the Gateway and run the command cat/var/log/node-red/node-red.log. Alternately, you could “follow” the log file with the command tail-f/var/log/node-red/node-red.log.

If you need to restart Node-RED, you can do so by connecting to the Gateway and running the command /etc/init.d/node-redrestart.

The ScanBLEs node has a config item for restricting to certain Service UUIDs. Double-click the ScanBLEs node to set this config. You can also see on the “info” tab that there are other properties that are returned, for example, if the advertisement is the iBeacon format.

Find a Service UUID of your target devices with the Rigado Toolbox App.