0% found this document useful (0 votes)
263 views11 pages

How To Set Up MQTT Server For Gateway - Dusun

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
263 views11 pages

How To Set Up MQTT Server For Gateway - Dusun

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

9/21/2020 How to set up MQTT Server for Gateway | Dusun

A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More

IoT Resources Library


Including IoT development kits, implementation reference documents,
and the newest advances of the internet of things. To help more
developers do more flexible applications on their IoT projects.

IoT Resources Library » How to Connect Gateway to MQTT-Apache-Apollo Server

How to Connect Gateway to MQTT-


Apache-Apollo Server 
What’s MQTT? 
How to set up MQTT apache-Apollo server:
1. Download and install JDK
2. Set JDK evironment variables in Windows
3. Download apache-apollo and install
4. Configure a Dusun gateway to connect to the server

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 1/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun

A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More

How to set up MQTT apache-Apollo server?

1. Download and Install JDK  

Go to the JDK download page: 


http://www.oracle.com/technetwork/java/javase/downloads/ index.html

You will nd the following chart on the page.

 Download the X86 or X64 windows JDK le according to users’ windows version. Launch the le "jdk-

82u211-*. exe" and perform a default install. Then you will see two folders in the /windows/program

les/java folder, one is JDK, the other is JRE, as the gure below shows.

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 3/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun

Easy Setup MQTT Server for IoT Gateways

A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More

What’s MQTT? 

MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed


as an extremely lightweight publish/subscribe messaging transport. It is useful for connections

with remote locations where a small code footprint is required and/or network bandwidth is at a

premium. For example, it has been used in sensors communicating to a broker via satellite link,

over occasional dial-up connections with healthcare providers, and in a range of home automation

and small device scenarios. It is also ideal for mobile applications because of its small size, low

power usage, minimised data packets, and efficient distribution of information to one or many

receivers.

Dusun gateway supports MQTT protocol to connect to cloud platform, Please refer to the frame

below

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 2/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun

A D U S2.USet
N JDK
C O Environment
M P A N Y Products
Variables Developer Zone
in Windows   Downloads Partners About Us More

Open Advanced System Settings

In Windows 10 press Windows key + Pause Key, this will open the System Settings window. Go

to Change settings and select the Advanced Tab. Alternatively: Open “Windows search” – you will nd it

next to the Windows logo. In the search eld type in – advanced system settings, then click on the

match on top of the list.

Set JAVA_HOME Environment variable

In “System Properties window” click “Environment Variables…”

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 4/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun

A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More

Under “System variables” click the “New…” button and enter JAVA_HOME as “Variable name” and the

path to your Java JDK directory under “Variable value”.

Update System PATH

1. In “Environment Variables” window under “System variables” select Path

2. Click on “Edit…”

3. In “Edit environment variable” window click “New”

4. Type in  %JAVA_HOME%\bin

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 5/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun

Test your con guration


A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More
Open a new command prompt and type in:
Command:  Java -version
 
This will print out the version of the java if the Path variable is set correctly 

3. Download Apache-apollo and install

Use the links below to download the Apache-appollo software for windows: 

http://mirrors.hust.edu.cn/apache/activemq/activemq-apollo/1.7.1/apache-apollo-1.7.1-windows-

distro.zip   

Uncompress the package to a local drive (e.g. E:)

Run cmd with administrator privilege and use cd command to locate the apache-apollo bin directory as

the gure below shows:

Type in command:”apollo create myapollo c:\apache-apollo\broker” to create the broker:

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 6/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun

A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More

The following directory appears in c:\ root directory.

Open a new command prompt and type in: “cd c:\apache-apollo\broker\bin\; apollo-broker run”, this

will print out the following information: 

Open a web browser and type in http://127.0.0.1:61680/, username: admin, password:password 

Then the MQTT server has been setup successfully, but right now, there are no devices connecting to

this server:

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 7/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun

A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More

4. Con gure a Dusun Gateway to Connect to the Server   

Connect a Dusun gateway to a PC; open a web browser and type in - 192.168.66.1; then log in the

gateway to do some con guration:

Username: root

Password: root

Con gure MQTT in the con guration page:

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 8/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun

A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More

Setting up the MQTT con guration as below:

MQTT Server address: ll in the PC’s IP address.

MQTT Server Port: the TCP port

Username: admin

Mqtt Password: password

>
Press enter and the Mqtt con guration is completed. 

https://www.dusuniot.com/set-up-mqtt-server-for-gateway 9/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun
You can see the gateway indication light is o and the gateway has connected to the server:

A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More

Related Link
Dusun Smart Gateway
Dusun Zigbee Gateway
Dusun Edge Computing Gateway
MQTT Website

Download this Document


Apply for the document

How to Connect Gateway to MQTT-Apache-Apollo Server 

Email: [email protected] Tel: +86057186796578

Address: No. 640 FengQing Street, Deqing, Huzhou, Zhejiang, China

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 10/11
9/21/2020 How to set up MQTT Server for Gateway | Dusun

Hubs & Gateways Sensors & Detectors Supports About Us

Zigbee Gateways Smart Sockets Product Catalog Our Blog


A D U S U N C O M P A N Y Products Developer Zone Downloads Partners About Us More
Zwave Gateways Smart Plugs Documents Download Our Customers

BLE 5 Gateways PIR Sensors Developer Resources Roombanker Forum


Smart Gateway P Serial Window & Door Sensors

Edge Computing Gateways

Dual Band Gateways


Contact Us Now
Industrial Gateways Smoke Dectectors
CO Alarm
Gas Alarm

Thermostats

Water Leak Sensor


Wi-Fi Portable Router
Alexa Wi-Fi Speaker

© 2018 DUSUN Electron LTD.  All Rights Reserved

>
https://www.dusuniot.com/set-up-mqtt-server-for-gateway 11/11

You might also like