Print

How to configure the ACE-GTW-MQTT / ACE-GTW-4G

In this tutorial we will show you how to configure the ACE-GTW-MQTT/4G gateway for

  • Connect to the ACE-GTW-MQTT configuration web interface
    • Via its LAN RJ45 port connected to your network
    • Via its WAN RJ45 port connected to your network
  • Connect the ACE-GTW-MQTT to Internet
    • Via its WAN RJ45 port connected to your network
    • Via its WiFi connected to your network
    • Via LTE/4G and its SIM card (ACE-GTW-4G version)
  • Connect the ACE-GTW-MQTTto a MQTT Broker
  • Connect the ACE-GTW-MQTTto the ACE PLC
  • MQTT Topics and Modbus tags configuration

ACE-GTW-MQTT
LAN + WAN + WiFi + MQTT
+ Modbus over USB to ACE PLC

ACE-GTW-4G
LAN + WAN + WiFi + 4G + MQTT
+ Modbus over USB to ACE PLC


Connect to the ACE-GTW-MQTT configuration web interface

 

Via its LAN RJ45 port connected to your network

Connect the ACE-GTW-MQTT on your network (LAN port).

Your PC must be on the same network as the Gateway: 192.168.8.XXX. If it’s not the case, change the IP address of your PC. Don’t use an IP address already taken by a device of your network!

With your bowser, go to the ACE-GTW-MQTT web interface by enter its IP address: 192.168.8.1

Enter the username = root, and the password = root

< ! > Please configure a new root password to protect the web interface.

Once your are connected to the ACE-GTW-MQTT, you can change its IP address if you wish.

Network > Interfaces

And “Edit” the LAN interface

Enter a new IP address that is not already being used by another device on your network.

You PC must be on the same logic network: 192.168.8.xxx


If you want to change the default IP address of the Gateway

Don’t forget to confirm your configuration by clicking on “UNSAVED CHANGES”

Via its WAN RJ45 port connected to your network

It is assumed that you have a DHCP server on your network that assigns IP addresses to the new connected devices.

Connect the ACE-GTW-MQTT on your network (WAN port).

Search what is its IP address assigned by the DHCP server. If you don’t know, you can use the free and open-source software Angry IP Scanner for see all devices connected to your network.

Go to the ACE-GTW-MQTT web interface by enter its new IP address. 192.168.xxx.xxx in our example.

Enter the Username = root and the Password = root

< ! > Please configure a new root password to protect the web interface

Angry IP Scanner for see all IP address used on your network

 


Connect the ACE-GTW-MQTT to Internet

 

Via its WAN RJ45 port connected to your network

Connect the Gateway on your network (WAN port).

If the WAN port is already connected to your network and an IP address has been assigned by a DHCP server . In this case, your ACE-GTW-MQTT must already be able to connect to the Internet.

Go to Network > Diagnostics and ping the “openwrt.org” server on the Internet.

Success! If you have 5 packets received.

Well done! You are connected!

 

Via its WiFi connected to your network

Watch the video on your right or follow these instructions:

In the network configuration web pages of the ACE-GTW-MQTT:

  • Network > Wireless, click on [ Scan ]
  • [ Join Network ] you want to join
  • Enter the passphrase/password if exist
  • Let the name of the new network (wwan)
  • [ Save & Apply ] the “Device Configuration” page
  • [ Save & Apply ] the “Interface Configuration” page

Check you new IP address on WWAN:

  • In Network > Interfaces check the new IP address on WWAN interface

For check your connection to Internet:

  • Go to Network > Diagnostics and ping the “openwrt.org” server on the Internet.
    As above (Via its WAN RJ45 port connected to your network)

Success! If you have 5 packets received.

Short video: Connect your Gateway to Internet via WiFi

 

Via LTE/4G and its SIM card (ACE-GTW-4G version)

This connection is only for the ACE-GTW-4G version, with a SIM card slot and antenna.

It is assumed that you have a SIM card with an Internet access available.

Before insert the SIM card inside the Gateway, it is best to disable the SIM card PIN code with a smartphone.

In the network configuration web pages of the ACE-GTW-MQTT:

  • Network > Add a new network interface for the 4G if it does not already exist
  • Give it the name “4G” for example
  • ..[tutorial in progress]
  • Enter the Username = and the Password =

Check you new IP address on 4G:

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

For check your connection to Internet:

  • Go to Network > Diagnostics and ping the “openwrt.org” server on the Internet.
    As above (“Via its WAN RJ45 port connected to your network”)

Success! If you have 5 packets received.

https://apnsettings.gishan.net/ or https://www.imei.info/faq-apn/

 

< ! > Please configure a new root password to protect the web interface


SIM card slot


IP address from the cellular network


Generally no username/password are required


Most of the cases, GPRS is enough for MQTT Data

 


Connect the ACE-GTW-MQTT to a MQTT Broker

In this chapter we will show you how to:

  • Declare a Broker and add a topic in ACE-GTW-MQTT
  • Use MQTT.Explorer to view Broker topics for tests and debugs
    • Declare a Broker
    • Add a Topic
As a tool, for testing, debugging and to view your data, you can use this powerful MQTT Client software: http://mqtt-explorer.com/

With this tool, you will see your topics published by the ACE Portal and you will also be able to publish topics to retrieve them in your ACE API!

 

  • IP address or URL of the Broker to connect to
  • Port number: Usually 1883, or 8883 over TLS/SSL
  • Quality of Service (QoS)
    • At most once
    • At least once
    • Exactly once
    • Dynamic
  • Use Login/Password ? If used by the Broker with or without TLS/SSL
  • Advanced parameters ? Only if you know what you’re doing!

You can test these MQTT Brokers below. Some of them are free and/or require an account and monthly fee.

The free versions are only there for your tests, not to be used in your application.

MQTT Broker ACE-GTW-MQTT Gateway parameters
SHIFTR – Free – Create an account
https://shiftr.io/get-started

  • broker.shiftr.io
  • 1883

 

HIVEMQ – Free 7 days
https://www.hivemq.com/cloud/

  • broker.hivemq.com
  • 1883
MOSQUITTO – Free
https://test.mosquitto.org/

  • test.mosquitto.org
  • 1883
CLOUD MQTT – Fee based
https://www.cloudmqtt.com/

  •  hairdresser.cloudmqtt.com
  • 18773
  • Use Login/Password

Try to connect the MQTT.Explorer to one of this Broker. If success, you can do same with your Gateway.


Connect the ACE-GTW-MQTT to the ACE PLC

Just connect the USB cable between the Gateway and the ACE PLC.

* except the ACE-7096.

 


 

MQTT Topics and Modbus tags configuration

MQTT web configuration page of the ACE-MQTT Gateway

  • 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 Bit/Ana:
    • The Payload is value (Bit or Word). The content and format is 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 for send the MQTT topic and its Payload (value) to the MQTT Broker
      •  You can publish the values from the ACE PLC Modbus register or from system payload (GPS,..)
      • I publish a topic/value for give an information to the others MQTT Clients (Smartphone, tablet, scada,…)
    • Subscribe for receive the MQTT topic and its Payload (value) from the MQTT Broker
      • You can subscribe any values (bit or word) to write in PLC, from the Broker or from system payload (GPS, Broker,..)
      • I subscribe a topic/value for get and manage an information

 

Examples of MQTT configuration

MQTT Topic to Pub/Sub Payload Bit Payload Ana Pub🡹/🡻Sub
Machine785/Back/Speed @[0;1] Not use Back speed:@ m/s PUB🡹
Machine785/Back/NumberColours @[0;1] Not use
@ colours in progress PUB🡹
Machine785/Front/Speed @[0;1] Not use
Front speed:@ m/s PUB🡹
Factory/Paris/Production @[0;1] Not use Paris:@ PUB🡹
Machine785/Power @[ON;OFF] @ Not use 🡻SUB
Machine785/State The machine is @[stopped;running] @ Not use PUB🡹

 

List of the special Payload Bit/Ana

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

 

Examples of MQTT configuration

MQTT Topic to Pub/Sub Payload Bit Payload Ana Pub🡹/🡻Sub
Site9246/GPS/Lattitude @[0;1] Not use Latitude=$GPSLAT$ PUB🡹
Site9246/GPS/Longitude @[0;1] Not use
Longitude=$GPSLON$ PUB🡹
Truck/AE-541-ZK/Speed @[0;1] Not use
Speed: $GPSSPE$ Km/h PUB🡹
Truck/AE-541-ZK/Speed @[0;1] Not use $GPSSPE$ *
🡻SUB
Site9246/GPS/Signal $GPSVAL$[Good;Bad] @ Not use PUB🡹
Site9246/GPS/Signal $GPSVAL$ *
@ Not use 🡻SUB

* As these Payloads (GPS) are local to the Gateway, they are simply written in the ACE PLC Modbus register. They are not subscribed. The Broker receives nothing.

 


 

Example of an MQTT visualisation application

For this example, we use:

 

We will implement on the HMI MQTT Virtuino:

  • a 2-position switch
  • an indicator light
  • an analog slider
  • a digital indicator

This Virtuino tutorial is in progress


 

How to reset the ACE-GTW-MQTT to the factory default settings?

See here

 

 

 

 

 

 

 

 

 

.