How to Connect the Milesight Gateway to IOTYN via MQTT

Learn how to configure your Milesight IoT Gateway to be able to transmit data to IOTYN using MQTT Protocol.

4/26/20254 min read

Milesight LoRaWAN Gateways provide an MQTT API to transmit LoRaWAN device data from the Gateway built-in network server to the MQTT broker. This article will guide you to transmit LoRaWAN device data to Iotyn via Milesight Gateways.

1. Connect Gateway to iOTYN via MQTT

Step 1: Go to Packet Forwarder > General to enable Embedded NS type network server into the localhost Server Address.

Step 2: In the Network Server > General, enable the Gateway built-in network server.

Step 3: Go to Network Server > Applications to add an application, then click Save.

Step 4: Add Data Transmission for this application, select MQTT as type.

Step 5: Fill in the information of IOTYN MQTT broker.

  • Broker Address: app.iotyn.in

  • Broker Port: 1883

  • Client ID: User-defined (between 10 to 20 random character length)

  • User Credentials: Enable

  • Username: Your IOTYN account TOKEN (Please ask administrator of your organisation to send you token, else send a email to support@iotyn.in)

  • Password: Leave blank

To send data to iotyn broker, you need to publish the topic: /v1.6/devices/$deveui

Step 6: Save all settings, then you can check the MQTT status.

2. Add a LoRaWAN Device to the Gateway

Step 1: Go to Network Server > Profiles to add a device profile according to device type.

Step 2: In the Network Server > Device add a device, select the correct device profile and the application connected to IOTYN, then fill in the device information (Device EUI, App key, etc.).

Once a new value is received in the Gateway from the device, a new device will be automatically created into your IOTYN account.

You can check if the Gateway receives data on Network Server > Device page.

3. Add Payload Decoder

Step 1: Go to Network Server > Payload Codec and go down to Custom Payload Codec section.

Step 2: Select a template for your Payload Codec, depending on the device you want to connect to your Gateway. You can also modify it if you want.

IMPORTANT NOTES:

  • This Payload Codec only applies to the devices under this application. If you need to use other decoders, please create a new application.

  • For more details about the Payload Codec please refer to How to Use Payload Codec on Milesight Gateway.

  • IOTYN only supports numerical data as values, please ensure all your up-link data types are numbers.

4. Data Visualization

Step 1: Select the device created to verify the variables received.

Step 2: Change the device name to a friendly one if needed.

Step 3: Go to Data -> Dashboard section of your IOTYN account to create a dashboard.


Step 4: Select the plus (+) icon located a the upper right side of the page to add widgets to display your data.

Related Articles

What is [Your Brand Name]?

[Your Brand Name] is a [brief description of your business or service]. We are passionate about [your mission statement].

How does your product/service work?

We offer a [brief explanation of how your product or service helps your customers]. Our process is [simple/efficient/convenient] and [positive adjective] for you.

How much does it cost?

Our pricing varies depending on [what factors affect your price]. We offer a variety of options to fit your needs and budget. Please visit our [pricing page/contact us] for more information.

Do you offer [specific service inquiry]?

Unfortunately, we don't currently offer [specific service inquiry]. However, we do offer [alternative service] which might be helpful.

How can I contact you?

You can reach us by [phone number/email address/contact form link]. We are always happy to answer your questions.

Where can I learn more about you?

You can explore other sections of this website, such as the "About Us" page or our blog, to learn more about our company, mission, and team.