How Can We Help?

Print

Quick start with ACE-GTW-4G-M MQTT Gateway

 

Here are a tutorial to get you started with your ACE-GTW-4G-M Gateway

Firstly: Good to know: Feel free to use the comments in the bubbles!

Almost all fields have a mouse-over help: hover the mouse over the field title or column headings to get more details on the parameters.

Connect to the Gateway web interface

  • Default IP address: 192.168.8.1 (Your PC must be on the same network 192.168.8.xxx)
  • Login = admin
  • Password = admin (Don’t forget to replace the password with a strong one if need)

 

Note 1: Multiple IP addresses for the PC (Screenshot)
On your PC, if you have no IT restrictions, you can configure several different IP addresses. For example, you can set up

  • 192.168.8.200 for gateway access to 192.168.8.1
  • 192.168.22.200 for access to your 192.168.22.xxx network

Note 2: Change the LAN IP address
If you change the LAN IP address of your gateway, you need to connect to the new LAN IP address immediately for it to take effect and avoid rollback

 

Setting up and checking a WiFi Internet connection

It’s very simple. You can follow this video:

Setting up a connection to a MQTT Broker and send the first MQTT Topic

 

 

  • MQTT Topic: SYS/Available
  • Payload: $SYSUPTIME$
    • This internal payload $SYSUPTIME$[0;1] indicates whether internal GPS data are available
  • Common tag prefix for PUBs and SUBs (optional): ACE/
    • Don’t forget the / at the end
    • This function avoids the need to enter at each time a common prefix and/or suffix for all topics

 

Check with another MQTT Client the Topic we sent from the ACE-GTW-4G

  • Topic to be displayed: “ACE/SYS/Uptime

In our example we will use the MQTT client software MQTT-Explorer

The parameters are the same as for the gateway:

 

 

About “Modbus Fonctions Code”

Modbus code function used in “Topics – Publish” section

  • 0x01 Read Coils: Read the state of relays or digital outputs
  • 0x02 Read Discrete Inputs: Read digital input signals such as push buttons
  • 0x03 Read Holding Registers: Read process parameters or setpoints stored in holding registers
  • 0x04 Read Input Registers: Read analog input values, such as sensor readings from a PLC

Modbus code function used in “Topics – Subscribe” section

  • 0x05 Write Single Coil: Set the state of a single digital output (ON/OFF), such as activating a relay
  • 0x0F Write Multiple Coils: Set the states of multiple digital outputs (ON/OFF) in a single request
  • 0x06 Write Single Holding Register: Write a single 16-bit value to a holding register, such as setting a parameter or command
  • 0x10 Write Multiple Holding Registers: Write multiple 16-bit values to consecutive holding registers, such as multiple setpoints at once or updating a string

 

TE-M/4G connection configuration

About the LTE-M

LTE-M is an extension of the 4G / LTE network, and completes the market for LPWA (Low Power Wide Area) technologies. Based on the cellular IoT network, this solution is reliable and sustainable for many years to come. Unlike other LPWA connectivities, LTE-M does not require the physical deployment of antennas. In fact, only a software update of the antennas is required for objects to have access to the LTE-M network.

Configuration

You must

  • have a SIM card with an Internet access available
  • find out your SIM card’s APN (Access Point Name)
  • know the PIN code, or better still, deactivate it with a smartphone
  • correctly positioned the SIM card in the dedicated drawer

Edit the “4G” interface in Network > Interfaces

You must restart the gateway electrically after changing the 4G/LTE parameters

In Network > Interfaces check the new IP address on 4G interface

 

 

Go to Network > Diagnostics and ping the “openwrt.org” server on the Internet
Success! If you have 5 packets received.

 

MQTT Topics and Modbus tags configuration

MQTT Topic

MQTT Topic to Pub/Sub are a form of addressing that allows MQTT clients to share information.

MQTT Topics are structured in a hierarchy similar to folders and files in a file system using the forward slash ( / ) as a delimiter.

Topic names are: Case sensitive, use UTF-8 strings, must consist of at least one character to be valid.

Payload

The payload is a message or data (plain text, JSON, bit, word, etc.). Content and format are virtually free and application-specific.

Payload Bit format:

@[Value_for_state_0;Value_for_state_1]

@[0;1]

@[ON;OFF]

The machine is @[stopped;running] now !

Payload Ana format:

@

Water level= @ m

Machine speed: @ m/s

@ products in progress

PUB / SUB

PUBlish to send the MQTT  Topics and its Payload (value) to the MQTT Broker

  • You can publish values from any Modbus device connected to the gateway and from internal SysVar data (GPS, SYS, 4G, etc.)
  • I publish a topic/value to give information to other MQTT clients (Smartphone, tablet, scada, etc.)

SUBscribe to receive the MQTT Topics and its Payload from the MQTT Broker

  • You can subscribe any values (bit or word) to write in any Modbus device connected to the gateway, from the Broker or from some internal SysVar data (GPS, SYS, 4G, etc.)
  • I subscribe a topic/value for get and manage an information

 

Examples of MQTT Payload

MQTT Topic to Pub/Sub Payload Pub?/?Sub
Machine785/Back/Speed Back speed:@ m/s PUB
Machine785/Back/NumberColours @ colours in progress PUB
Machine785/Front/Speed Front speed:@ m/s PUB
Shop/Paris/Production/Request @ SUB
Machine785/Power @[1;0] SUB
Machine785/State The machine is @[stopped;running] PUB

 

List of the special Payload

SYSTEM

Description Payload bit/ana Type of register
Bit set to 1 on MQTT connection $SYSSTARTED$[0;1] or $SYSSTARTED$[0;STARTED] BIT
Time elapsed since start-up $SYSUPTIME$ I32

4G

Description Payload bit/ana Type of register
International Mobile Equipment Identity $IMEI$
Integrated Circuit Card Identifier $ICCID$
Received Signal Strength Indicator $4GRSSI$
Bit Error Rate $4GBER$

 GPS

Description Payload bit/ana Type of register
GPS signal is available or not $GPSVAL$[0;1] or $GPSVAL$[NOK;OK] BIT
Date and time from the GPS $GPSYEA$, $GPSMON$, $GPSDAY$, $GPSHOU$, $GPSMIN$, $GPSSEC$ UI8
Lattitude $GPSLAT$ FLOAT
Longitude $GPSLON$ FLOAT
Speed Kmh/h $GPSSPE$ FLOAT
Course $GPSCOU$ FLOAT
MagneticVar $GPSVAR$ FLOAT