SETUP AND OPERATION

CHAPTER 2

Getting Started

Before setting up the MQTT gateway, ensure the following conditions are met:

  1. Hardware is installed as per Chapter 1's Mounting and Wiring sections.
  2. Necessary connection information for your MQTT broker is available.
  3. A device with a web browser is ready to connect to the MQTT gateway via its RJ-45 Ethernet port, either over a LAN or with a crossover cable.

Configuration is done via the web interface. Connect using an internet browser. The default Ethernet configuration is:

  • IP address: 192.168.1.100
  • Subnet Mask: 255.255.255.0
  • Default Gateway: 192.168.1.1
  • User Name: admin
  • Password: password

Setup Network Connection

To modify network parameters, select "Network interfaces" from the "More Options" [menu-icon] in the upper-right corner of the web UI.

Enter the required network parameters and click SAVE, then CONFIRM the changes.

Note: The gateway uses its permanent default IP address in recovery mode.

Verify settings by reopening the "Network interfaces" screen and clicking "TEST INTERNET CONNECTION".

The "Network interfaces" screen displays fields for Hostname, MAC address, DHCP, IP Address, Subnet mask, Gateway, Preferred DNS, and Alternate DNS, with SAVE and TEST INTERNET CONNECTION buttons.

Setup Modbus Communications Channel

The gateway supports communication via RS-485 and Ethernet. Configure the RS-485 or Ethernet communications channel before setting up Modbus devices.

Click the CHANNEL tab to define Modbus communication parameters.

The CHANNELS tab shows the device name (SGW-MQ1611) and tabs for CHANNELS, DEVICES, MQTT. It indicates if no channels are configured and provides an "Add Channel" button [add-icon].

Click the [add-icon] to add a new channel or edit an existing one.

Channel configuration includes fields for Name, Communication protocol (e.g., Modbus RTU), Baud Rate, Data bits, Stop bits, Parity, Timeout (ms), Queue delay (ms), and Device delay (ms). A SAVE button is available.

Configuration steps:

  • Enter a Name for the channel.
  • Select the Communications protocol (Modbus RTU, Modbus TCP, or Modbus RTU over TCP).
  • For Modbus RTU, set Baud Rate, Data bits, Stop bits, and Parity.
  • For Modbus TCP or RTU over TCP, enter the IP address and TCP Port.
  • Set the Timeout value (max time in ms for a valid response).
  • Set the Queue delay (time in ms between Modbus requests).
  • Set the Device delay (time in ms between querying devices).

Click SAVE upon completion.

Setup Modbus Devices

The gateway supports up to 32 Modbus RTU Slaves (RS-485) and eight Modbus TCP Servers or Modbus RTU over TCP Servers (Ethernet). After defining channels, configure device connections and variables.

Configure Modbus Device

Navigate to the DEVICES tab to define Modbus devices for querying.

The DEVICES tab displays the device name (SGW-MQ1611) and tabs for CHANNELS, DEVICES, MQTT. It indicates if no devices are configured and provides an "Add Device" button [add-icon].

Click the [add-icon] to add a new device or edit an existing one.

Device configuration requires:

  • A Name for the device.
  • Selection of an existing Channel.
  • The device Address (Unit ID).
  • Checking "Block sampling" to combine contiguous variables into a single query.

Configure Modbus Variables

Add variables to be read from or written to a Modbus device by clicking the [add-icon].

The "Set variable" dialog allows configuration of Read-only status, Format, Variable name, Address, Function Code, Conversion parameters (Measured value 1/2, Engineering value 1/2), Validity, Operator, and Value. It includes an OK button and a close icon [close-icon].

  • Uncheck "Read-only" to enable writing to the variable.
  • Select the variable Format. Check "Unsigned" if applicable. Available formats include:
CategoryFormat
Digital1 bit
Integer16 bit (INT) signed or unsigned
32 bit (INT) Big endian signed or unsigned
32 bit (INT) Little endian signed or unsigned
Floating Point32 bit (FP) Big endian
32 bit (FP) Little endian

Variable configuration details:

  • Enter a Variable name.
  • Enter the Modbus Address.
  • Select the Modbus Function Code for reading and writing.

Valid function codes per variable type:

Variable TypeRead Function CodesWrite Function Codes
1 bit01 - Read Coil Status
02 - Read Input Status
05 - Force Single Coil
15 - Force Multiple Coils
16 bit (INT)03 - Read Holding Registers06 - Preset Single Register
16 - Preset Multiple Registers
32 bit (INT) Big endian03 - Read Holding Registers16 - Preset Multiple Registers
32 bit (INT) Little endian03 - Read Holding Registers16 - Preset Multiple Registers
32 bit (FP) Big endian04 - Read Input Registers16 - Preset Multiple Registers
32 bit (FP) Little endian04 - Read Input Registers16 - Preset Multiple Registers
  • For linear scaling, define Measured value 1 and 2, and corresponding Engineering value 1 and 2.
  • If "Validity" is checked, set an additional Address and Value to check data validity.

Configure MQTT Topics

Enable checkboxes for variables to be sent or controlled via MQTT, and configure MQTT message parameters.

Note: MQTT Gateway topic naming is flexible; your broker might require specific structures.

For publishing to an MQTT broker:

  • Enter an MQTT Topic (PUB). The [reset-icon] resets the topic to the default format like <DEVICE_NAME>/get/<VARIABLE_NAME>.
  • Choose publication triggers: "On value change" or "At a fixed frequency". Specify a Threshold for value change or an interval (Every (s)) for fixed frequency.
  • Set the Quality of Service (QoS) level.
QoSDescription
0Does not include confirmation of receipt
1Guarantees delivery at least once.
2Guarantees delivery exactly once.
  • Checking "Retain" keeps the last published message for new subscribers.
  • For writing from a subscribed MQTT topic:
    • Enter an MQTT Topic (SUB). The [reset-icon] resets the topic to the default format like <DEVICE_NAME>/set/<VARIABLE_NAME>.
    • Set the Quality of Service (QoS) level.
  • Click SAVE after configuring all variables and topics.

A green LED indicates successful communication; red indicates an error. The [log-icon] icon opens a real-time communication log.

Configure MQTT Broker

Verify your MQTT broker's required settings before configuring the gateway.

Click the MQTT tab to establish the connection.

Configure Broker Address, Broker Port, ClientId, Keep Alive frequency, and optionally Clean session, Username, and Password.

Enable TLS/SSL by uploading a certificate, private key, or CA certificate if needed.

Payload structure customization allows defining message content for valid and invalid values. Select desired information (e.g., Sampled value, Validity, Device name, Timestamps, Communication status) via checkboxes. Each field can be edited using the [edit-icon]. The [reset-icon] reverts values to defaults. A PREVIEW option shows sample messages.

Custom values can be set for invalid sampled values or communication problems.

Message queueing batches transmissions, useful for managing message frequency and complying with IoT service limits. Configure minimum delay, maximum queue length, and message expiration.

Diagnostic messages can be enabled to publish status information on channels, devices, and the MQTT connection.

Click SAVE to finalize MQTT connection settings.

A green LED next to the Broker Port indicates successful connection; red indicates an error. The [log-icon] icon provides access to communication logs.

Other Options

Additional settings are accessible via the "More Options" [menu-icon] icon. Network interface settings were detailed previously.

Date & Time

Set the date and time manually or enable NTP to use an internet time server.

The Date & time interface includes fields for System date, Time zone, Enable NTP, Date, and Time.

Import/Export Configuration

Export the entire configuration (channels, devices, MQTT) as a JSON file or import a configuration to another gateway. A backup prompt appears before importing to prevent data loss.

Change Password

Change the gateway's web UI login password. The username cannot be edited.

Password requirements: minimum 8 characters, including letters, numbers, and specific symbols (_ - ! # $ % ^ &). The new password must differ from the old and default passwords.

Fields include Old password, New password, and Confirm password, with a SAVE button.

Logout

The web UI session times out after inactivity. For immediate logout, select Logout from the "More Options" [menu-icon] menu.

Maintenance

The Maintenance dialog allows firmware updates, system log downloads, and device restarts.

Options include Firmware upgrade, System log, and Restart.

System Log

Download log files (tar.gz archives) to your PC. An unarchive utility like WinZip or 7-Zip is required.

Restart

Click Restart and then Confirm to reboot the gateway.

Firmware

New firmware is announced on the website https://support.automationdirect.com/firmware. Subscribe to firmware notifications at https://notify.automationdirect.com/firmware.

To update firmware: download the file, unzip it, then navigate to More Options [menu-icon] > Maintenance > Firmware upgrade.

Click BROWSE, select the .swu firmware file, and click Open.

The file uploads and verifies. Warnings state: "DO NOT POWER OFF THE DEVICE!" and "Interrupt this operation might corrupt your device!". Recovery Mode is mentioned for failures.

After verification, click UPGRADE and CONFIRM.

The gateway reboots upon successful update. If the update fails, restart in Recovery Mode and try again.

Recovery Mode

Boot into Recovery Mode to reset configurations or perform maintenance and firmware updates.

To enter: press and hold the recessed reset button while cycling power until the ERR light stops blinking (approx. 5 seconds). The gateway starts with default Ethernet configuration (IP address: 192.168.1.100).

Reset

The Reset tab allows selective resetting of Hostname, Network interface, Date & time, Login credentials, or Configuration to default settings.

Options include Reset all, Hostname, Network interface, Date & time, Login credentials (username: admin, password: password), and Configuration. A RESET button is available.

Maintenance (in Recovery Mode)

In Recovery Mode, the Maintenance tab allows checking file system errors, downloading logs, and cleaning temporary files. Log files are tar.gz archives requiring unarchiving software.

Firmware Upgrade (in Recovery Mode)

Firmware upgrades in Recovery Mode follow the same steps as in normal mode. This method is useful if a normal mode upgrade fails.

Reboot and Return to Normal Mode

To reboot and return to normal mode, click the "More Options" [menu-icon] icon and select Reboot. The device will use its configured network settings upon reboot.

PDF preview unavailable. Download the PDF instead.

ch2 Adobe PDF Library 15.0 Adobe InDesign 14.0 (Windows)

Related Documents

Preview CLICK PLUS Applications Guide: Programming Patterns and Node-RED Integration
A comprehensive guide detailing programming patterns, advanced math logic, and Node-RED project examples for the AutomationDirect CLICK PLUS PLC. Learn to implement latching coils, timers, state machines, motion control, and integrate with Node-RED for data acquisition, web services, databases, and IoT.
Preview AutomationDirect PLC Systems Overview: Programmable Logic Controllers
A comprehensive guide to AutomationDirect's range of Programmable Logic Controllers (PLCs), detailing product families like CLICK, Do-more, Productivity Series, LS Electric XGB, and ProductivityOpen. Features, benefits, pricing, programming software, and industrial automation solutions are covered.
Preview AutomationDirect BRX-P-OPCUA: OPC UA Gateway Module
Explore the AutomationDirect BX-P-OPCUA, an OPC UA gateway module designed for secure, reliable data exchange in industrial automation. Features seamless integration with the Do-more! platform and robust IT/OT connectivity.
Preview AutomationDirect C-more EA9-RHMI Hardware User Manual
This comprehensive user manual provides detailed instructions for the installation, wiring, configuration, operation, and troubleshooting of the AutomationDirect C-more EA9-RHMI Human-Machine Interface (HMI).
Preview AutomationDirect CLICK PLUS C2-01CPU Quick Start Guide
A quick start guide for the AutomationDirect CLICK PLUS C2-01CPU, covering installation, hardware setup, wiring, and basic connectivity.
Preview CLICK PLUS PLC Maintenance Guide - C2-USER-M
This chapter of the CLICK PLUS PLC Hardware User Manual (C2-USER-M) details essential maintenance procedures to ensure the longevity and reliable operation of the PLC. It covers checking LED indicators, performing project backups, verifying operating environment conditions (temperature, humidity), confirming operating voltage, inspecting physical condition, and checking project functionality via the CLICK programming software. Safety warnings regarding hot-swapping are also included.
Preview SureServo2 AC Servo Systems: Selection and Application Guide
Explore the SureServo2 AC Servo Systems from AutomationDirect. This guide covers system selection, motor features, drive capabilities, and application tips for precise motion control. Learn about torque-speed curves, inertia considerations, and available configurations.
Preview AutomationDirect GS/DURAPULSE Accessories and ZIPLink Wiring Solutions
Comprehensive guide to AutomationDirect GS and DURAPULSE AC drive accessories, including miscellaneous items like keypads and bezels, replacement fans, and the ZIPLink wiring system for simplified industrial connectivity and automation.