DTU gateway connects to MQTT server, MQTT.fx tool test

4G DTU gateway connects to MQTT server + MQTT.fx tool debugging

Today, I will introduce how to configure the DTU gateway to connect to the MQTT server in a few simple steps, and then use the MQTT.fx client for serial port testing.

1. Equipment preparation

1. Hardware preparation

DTU gateway (ZL-LTE-300 ), SIM card, USB data cable, antenna, 485 to usb converter

2. Software preparation

DevelopLink_DTU1.0.9 host computer
Insert picture description here
MQTT.fx 1.7.1 host computer
Insert picture description here

2. DevelopLink_DTU host computer configuration

The DevelopLink_DTU host computer configuration is to solve the communication problem between DTU and MQTT server.

1.DevelopLink_DTU configuration

  1. Select MQTT channel
  2. Fill in the server address and port number, test server address: 115.159.225.58, port number 1883
  3. Set account and password
  4. Set DTU subscription and publish message topic
  5. Select the theme to add IMEI, the best option is to ensure uniqueness
  6. Click to write configuration, the device will automatically restart
  7. It takes a few seconds to restart, and then read the configuration to see if the writing is successful. After the
    Insert picture description here
    device restarts, wait a few seconds and observe that the DTU indicator Link indicator (green) is always on, then the MQTT server is connected.

2 FAQ

If the connection is not successful, check the following reasons:

  • Whether to install the antenna, click to check the signal strength
    Insert picture description here
  • Whether to install a SIM card, or whether the SIM card has traffic, click to query the ICCID number
    Insert picture description here

Three, MQTT.fx client debugging

MQTT.fx is the current mainstream mqtt client. It supports subscription and publishing of messages through Topic, which can quickly verify whether the device can communicate with the IoT cloud platform. The device sends the current state as an MQTT topic to the server, and the MQTT proxy server sends the received topic to all subscribed clients.

1.MQTT.fx configuration

  1. home page
    Insert picture description here
  2. Connection configuration interface
    Click "Set configuration file" to edit the connection configuration.
    Change the MQTT server IP/domain name to the corresponding IP/domain name, here is: 115.159.225.58
    port number to the corresponding port number, here is: 1883
    click OK
    Insert picture description here
  3. Connect to the MQTT server
    Click the connect
    icon green, the MQTT.fx customer service terminal connects to the server successfully; if the icon is red, it fails, check the configuration
    Insert picture description here
  4. Subscribe to the corresponding topic
    Select subscribe to subscribe
    to the topic published by DTU: /device/pub/imei (imei is the only 15-digit number) and
    click subscribe to subscribe
    Insert picture description here
  5. Publish the corresponding topic
    Select publish to publish
    the topic subscribed by DTU: /device/sub/imei (imei is a unique 15-digit number)
    Insert picture description here

Four, debugging

1. Basic preparation

DTU transmits and receives data through the 485 serial port, and connects to the computer through a 485-to-usb converter. The
Insert picture description here
default serial port parameters are shown in the figure.
Insert picture description here

2. Send message test

  • DTU publishes messages to the (Broker) message broker server, and MQTT server publishes to the client.
    The operation is shown in the figure, you can see that the DTU 485 serial port successfully publishes data, and check whether the MQTT.fx client receives the subscribed message. The
    Insert picture description here
    MQTT.fx client successfully receives the message
    Insert picture description here

3. Receive message test

  • The MQTT.fx client publishes messages to the (Broker) message broker server, and the MQTT server publishes to the DTU.
    MQTT.fx client publishes a message, check whether the DTU485 serial port has received the subscribed message,
    Insert picture description here
    you can see that the DTU 485 serial port successfully received the data
    Insert picture description here

————————————————————————————————————————
Interested in IoT technology, please join us Group, welcome all kinds of technical exchanges,
QQ group: 830407941 If you
are interested in our products, please check Taobao, free customized projects:
DEVELOPLINK
DEVELOPLINK ____DTU

Guess you like

Origin blog.csdn.net/sym_robot/article/details/112326587