Monitoring Modbus Industrial devices using AWS IoT - A Quick Start Guide:

This quick start guide is for engineers to get their Modbus devices wired up, collect the sensor data and remotely monitor in AWS IoT using the dual SIM FATBOX G3 Industrial IoT gateway.

What You'll Need To Get Started
  • 1 FATBOX G3 AWS IOT Starter Kit ​​​

    • 1pc FATBOX G3 – Dual SIM Industrial 3G Gateway with Ubidots IoT client and Modbus RTU & TCP server

    • 1pc Digital input module – 4 x digital inputs (or switch contacts) Modbus RTU slave unit

    • 1pc Analog input – 2 x analog input Modbus RTU slave unit

    • Wires to connect the FATBOX G3 to the Modbus slave units (0.3m)

    • 2x 24VDC power supply 100-240VAC – 1 for FATBOX G3 and 1 for the 2 Modbus slave units

    • 1x cellular antenna (2m wire length)

    • 1x temperature sensor (0c - 400c) with 1m wire

Learn More: Click Here

You will also need the following

  • 1 x micro SIM card with 3G/4G data enabled – please also get its APN setting from provider.

  • An AWS IoT account

  • optional: Test switches or load (max 230V 8A, e.g. a 12V indicator) if there is no field equipment ready.

The Temperature Sensor​

You can get more information on the temperature sensor here.

 

You can also access its data sheet here.

Collecting non-Modbus interface devices

 

For collecting data from non-Modbus interface devices, LUA or BASH scripts can be easily written to poll any data that is accessible over Ethernet or RS-485/232 interfaces. The data can then be put into a JSON format that can be processed by the Ubidots IOT platform.

 

Let's Get Started:

1. Design

It’s usually good practice to start by mapping out the devices you want to monitor, e.g. a switch or a sensor in a network diagram.

Later, you can move on to your own field devices like power meters or PLCs.

2. Wire Up

 

This section describes how to wire up the Modbus-485 I/O modules included in the starter kit to the FATBOX G3 and also to its 24VDC power supply. It will also show you how to wire up the temperature sensor to the analog Modbus module. The following are simplified wiring diagrams for the Novus Automation I/O modules but please refer to details in the instruction manual download links.

In your starter kit, a temperature sensor is pre-wired to to the Digirail-2A analog module to facilitate immediate testing of transmission of field data to your Ubidots platform. 

Before you begin wiring, make sure to insert the an active SIM card into the FATBOX G3:

1. Dismantle the casing cover and slide out the PCB. Avoid touching the electronics, handle the board by the edges.

2. Insert your micro SIM card into the SIM card slot. Push the metal latch left/right to lock/unlock. Reassemble the metal casing.

Once the SIM card is in and the gateway is assembled you can proceed to wiring up the sensor and modules to it.

 

3. Setting Up The FATBOX G3

3A. Log into the FATBOX web console.

When you have connected up the FATBOX [ETH0 port], log into the web console [192.168.1.1].

By default the username is admin and password is fatbox12345

3B. Configure the cellular 3G settings

Go to <Cellular Settings>, and enter in the APN details you got from your SIM card operator.

Then to confirm the settings, click the UPDATE button.

3C. Reboot the FATBOX to save your 3G settings

For the cellular settings we also want to reboot the FATBOX G3 to ensure that it is saved. Go to the <Management>, scroll down and select the option to reboot.

3D. Ensure the FATBOX G3 is connected to a cellular network

You can now do a quick & easy test here to check that the FATBOX G3 is connected to the 3G network.

To do this go to the <System Status> Tab and scroll to the bottom and click the button that says "PING TEST"

If it returns the status "OK", congrats you are connected to the Internet!

If the status returns as "FAIL" repeat steps 2B & 2C to ensure that you have entered in the right APN details. If that is correct but you still do not get an Internet connection, please contact our technical support at: support@amplified.com.au

Next click on the "JSON DATA" link (see above). This will open up in a new tab in your browser with the latest JSON message string collected by the G3.

If you see a JSON string similar to the one above it shows that your G3 is successfully receiving data from your sensor, congratulations!

[You can skip to Step 4].

3E. Troubleshoot 1: Issue with wiring

If you see an error message like the one below go back and check on your wiring set up again.

Repeat step 3D when you are done. If you get the JSON string similar to the one in step 3D, it shows you are successful in receiving data from your sensor!

 

[You can skip to step 4].

If you continue to get an error message, contact our sales support team at: support@amplified.com.au

3F. Troubleshoot 2:  Issue with Port Settings

If no data appears in the new browser window (opened in Step 3D), follow the troubleshooting steps below:

Go to <Port Settings>. Ensure your serial port parameters are configured as follows:

Remember to confirm the settings by clicking the UPDATE button.

Repeat step 3D in this guide to check whether your G3 is now collecting data from the sensor. If you still do not see any data or message, continue with the following steps.

3G. Troubleshoot 3: Problem with iotasset.txt file

The FATBOX G3 has iotasset.txt preconfigured to work with your Modbus temperature sensor, specified as following:

MBM_START

TYPE,R

ADDR,1

MBFC,3

REGS,8,1,UINT16HL

Key,4C_IN1

TYPE,R

ADDR,2

MBFC,3

REGS,14,1,UINT16HL

Key,2A_IN1

MBM_STOP

Please refer to our FAQ for more detailed write up for the iotasset device register.

To configure the iotasset.txt file to your device, please refer to our Modbus User Guide.

If it is overwritten, you have to copy the iotasset.txt to the FATBOX's /user directory via SCP.

To do that you can download this 'iotasset.txt' file onto your computer.

For MAC users

Open a terminal session and run the following commands:

> cd <folder where you saved the iotasset.txt> i.e."cd documents"

> scp iotasset.txt root@192.168.1.1:/user
> enter in the password for your G3
[default is fatbox12345].

You can run the following commands to check that your iotasset.txt is loaded:

> ssh root@192.168.1.1
> enter the password.
> cd /user
> ls
 [check to see if there is a iotasset.txt file in the list]
> cat iotasset.txt [verify the contents of the iotasset.txt file]

Go to the <Management> tab to REBOOT the G3 to save your settings.

For Windows Users

Go to the <Management> tab in the G3 web configuration menu. Enable the SSH option (see blow) and click the UPDATE button to save your settings.

Next run the Winscp and connect using the following File Protocol

 

> SCP Hostname: 192.168.1.1
> User/password: root/fatbox12345
>
Drag the iotasset.txt file over to the /user directory

You can run the following commands to check that your iotasset.txt is loaded:

> ssh root@192.168.1.1
> enter the password.
> cd /user
> ls
 [check to see if there is a iotasset.txt file in the list]
> cat iotasset.txt [verify the contents of the iotasset.txt file]

Go to the <Management> tab to REBOOT the G3 to save your settings.

Repeat step 3D in this guide to check whether your G3 is now collecting data from the sensor. If you still do not see any data or message, please contact our technical support at: support@amplified.com.au

 

4. Setting Up AWS IoT to receive the data

1. Create a new AWS IoT Thing

First log into your AWS IoT Management Console and create a Thing:

AWS IoT > Manage > Thing > Create

Next go to:

Secure > Certificates

Then download the 'Certificate' & 'Private Key File'.

Ensure the Certificate is "Active", otherwise activate it under ACTIONS in 

Things > Your Certificate > Security

2. Update your G3 IoT Gateway
Create a new local folder and name it "AWS". 

Save the downloaded certificate files into this folder and rename them as the following:

"certificate.pem.crt"

"private.pem.key"
 

Next zip the folder (ensure that you zip the entire folder and not just the files inside).

Then log into your FATBOX G3 web console and go to the <Management> tab.

Patch the zipped folder to the gateway using the UPDATE FIRMWARE button.

3. Create a Security Policy for your Thing

In your AWS IoT Management Console go to:

Secure > Policies > Create

At <Things>, select your new Thing then click on

Security > Certificates > Policies

Under <Actions>, choose to Attach a Policy:

4. Configure your G3 IoT Gateway to send data to your AWS Account

Now, you are ready to configure your gateway to send AWS IoT endpoint to feed data to your AWS applications. In the FATBOX G3 web configuration menu, go to the <IoT Client> tab and configure your AWS client settings according as per your AWS end point and Thing settings. Then REBOOT your gateway.

Next go back to go your AWS IoT console and subscribe to the Topic to "Test" that data is being received.

Congratulations! You have succesfully sent your Modbus or CAN bus data to your AWS IoT endpoint and ready to, for example, push the data to a S3 bucket using a Rule in 'Act > Rules'.
The FATBOX G3 AWS IoT client side is built using AWS IoT Device SDK for Python and users are free to install, modify our device client codes for enhanced edge capabilities or other required functionalities.

Got a question for us?

Contacts:

Tech Support : support@amplified.com.au

Sales : sales@amplified.com.au

Amplified Engineering

BUY A GATEWAY ROUTER

E-commerce Shop

HARDWARE-AS-A-SERVICE

Leasing Plans

PRODUCT CUSTOMISATIONS

Custom the G3

CONTACT US

Sales Enquiries

Technical Enquiries

Amplified Engineering Pty Ltd  

Suite 4 Enterprise Unit 3,

9 De Laeter Way,

Bentley WA 6102, Australia

ABN 44127163035