Helmholz PN MQTT User manual

Notes
All rights reserved, including those related to the translation, reprinting, and reproduction of this
manual or of parts thereof.
No part of this manual may be reproduced, processed, duplicated, or distributed in any form
(photocopy, microfilm, or any other methods), even for training purposes or with the use of
electronic systems, without written approval from Helmholz GmbH & Co. KG.
All rights reserved in the event of the granting of a patent or the registration of a utility model.
To download the latest version of this manual, please visit our website at www.helmholz.de.
We welcome all ideas and suggestions.
Copyright © 2021 by
Helmholz GmbH & Co. KG
Hannberger Weg 2 | 91091 Großenseebach
All trademarks shown or mentioned in this document are the property of their respective owners or
manufacturers. The representation and naming serve exclusively to explain the use and setting options of the
products documented here.
Revision Record:
Version Date Change
1 First version
2 6/18/2021 Update for firmware V1.04
Microsoft Azure example added

PN/MQTT Coupler | Version 2 | 6/18/2021 3
Contents
1General............................................................................................................. 6
1.1 Structure of the manual........................................................................................................... 6
1.2 Target audience for this manual............................................................................................... 6
1.3 Safety instructions ................................................................................................................... 6
1.4 Note symbols and signal words ............................................................................................... 7
1.5 Intended use ........................................................................................................................... 8
1.6 Improper use........................................................................................................................... 8
1.7 Liability.................................................................................................................................... 9
1.7.1 Disclaimer of liability............................................................................................................ 9
1.7.2 Warranty.............................................................................................................................. 9
1.8 Open Source ........................................................................................................................... 9
2Security recommendations.............................................................................10
3System overview.............................................................................................11
3.1 General/area of application ................................................................................................... 11
3.2 PN/MQTT Coupler Features................................................................................................... 12
4Installation and removal.................................................................................13
4.1 Access restriction ................................................................................................................... 13
4.2 Mounting and minimum distances ........................................................................................ 13
4.3 Electrical installation .............................................................................................................. 13
4.4 Protection against electrostatic discharges ............................................................................. 13
4.5 EMC protection ..................................................................................................................... 14
4.6 Operation.............................................................................................................................. 14
4.7 Recycling / WEEE ................................................................................................................... 14
5Connection..................................................................................................... 15
5.1 Power supply ........................................................................................................................ 15
5.2 Network ................................................................................................................................ 15
5.3 network connector ................................................................................................................ 16
6Install GSDML file ...........................................................................................17
7Configuration in TIA Portal............................................................................. 18
7.1 Parameterization of the PN/MQTT coupler............................................................................. 18
7.2 Operating principle of the PN/MQTT coupler ........................................................................ 20
7.3 Assign a name to the PN/MQTT coupler ................................................................................ 22
8Configuration of MQTT connection................................................................23

PN/MQTT Coupler | Version 2 | 6/18/2021 4
8.1 Access to the web page ......................................................................................................... 23
8.2 MQTT basic configuration ..................................................................................................... 24
8.3 MQTT Payload formats .......................................................................................................... 26
9Status and control via the PLC ........................................................................ 27
9.1 Status of PN/MQTT Coupler .................................................................................................. 27
9.2 Control of PN/MQTT Coupler ................................................................................................ 27
9.3 Subscribe Module.................................................................................................................. 27
10 MQTT encryption and authentication..........................................................28
10.1 Generator for certificates and SAS tokens............................................................................... 30
11 More MQTT settings .................................................................................... 31
11.1 Topic Mode ........................................................................................................................... 31
11.2 Last Will Message................................................................................................................... 32
11.3 „Communication Enable“ and „Communication Stopped“ messages ................................... 33
12 Further functions in the web interface......................................................... 34
12.1 Module status........................................................................................................................ 34
12.2 Export/Import of the configuration ........................................................................................ 34
12.3 Account................................................................................................................................. 35
12.4 Upload TLS certificates for HTTPS........................................................................................... 35
12.5 SNTP Settings ........................................................................................................................ 35
12.6 Firmware update ................................................................................................................... 36
12.7 Reset to factory settings ......................................................................................................... 37
12.7.1 Reset to factory settings via website ............................................................................... 37
12.7.2 Reset to factory settings via "IPSet" tool .......................................................................... 37
13 Diagnosis via LEDs .......................................................................................38
14 Client tools for MQTT data exchange........................................................... 39
14.1 MQTT Explorer ...................................................................................................................... 39
14.2 MQTT.fx V5 ........................................................................................................................... 39
14.3 MQTT Box ............................................................................................................................. 39
15 Application example „mosquitto“ ...............................................................40
15.1 Mosquitto Test-Host .............................................................................................................. 40
15.2 Install and use Mosquitto locally............................................................................................ 40
16 Application example „HiveMQ“...................................................................41
16.1 Use of HiveMQ in a virtual machine ....................................................................................... 41
16.2 HiveMQ Cloud....................................................................................................................... 42

PN/MQTT Coupler | Version 2 | 6/18/2021 5
17 Application example „Amazon IoT Core“ .................................................... 44
17.1 Create a policy....................................................................................................................... 45
17.2 Create „AWS IoT Things“....................................................................................................... 46
17.3 Configure PN/MQTT Coupler for AWS Access ........................................................................ 49
17.4 Testing the MQTT Connection in AWS................................................................................... 50
18 Application example „Microsoft Azure“....................................................... 52
18.1 Create device in Azure ........................................................................................................... 52
18.2 Configure PN/MQTT Coupler for Azure ................................................................................. 55
18.3 Checking the data transfer in Microsoft Azure........................................................................ 57
19 Technical data..............................................................................................58

PN/MQTT Coupler | Version 2 | 6/18/2021 6
1General
This operating manual applies only to devices, assemblies, software, and services of Helmholz GmbH
& Co. KG.
1.1 Structure of the manual
This manual is divided into 19 sections.
Section 1 contains general information and safety instructions.
Section 2 refers to Security Recommendations.
Section 3 explains the system overview and features of the product.
Section 4+5 explain the mounting and electrical connection of the product.
Sections 6-11 explain the configuration and programming of the product.
Sections 12+13 describe functions for maintaining and diagnosing the product.
Sections 14-18 contain application examples.
The technical data can be found in section 19.
1.2 Target audience for this manual
This description is only intended for trained personnel qualified in control and automation
engineering who are familiar with the applicable national standards. For installation, commissioning,
and operation of the components, compliance with the instructions and explanations in this
operating manual is essential.
Configuration, execution, and operating errors can interfere with the proper operation of the device and
result in personal injury, as well as material or environmental damage. Only suitably qualified personnel
may operate the devices!
Qualified personnel must ensure that the application and use of the products described meet all the
safety requirements, including all relevant laws, regulations, provisions, and standards.
1.3 Safety instructions
The safety instructions must be observed in order to prevent harm to living creatures, material goods,
and the environment. The safety notes indicate possible hazards and provide information about how
hazardous situations can be prevented.

PN/MQTT Coupler | Version 2 | 6/18/2021 7
1.4 Note symbols and signal words
If the hazard warning is ignored, there is an imminent danger to life and health of people from electrical
voltage.
If the warning is ignored, there is a probable danger to life and health of people.
If the caution note is ignored, people can be injured or harmed.
Draws attention to sources of error that can damage equipment or the environment.
Gives an indication for better understanding or preventing errors.

PN/MQTT Coupler | Version 2 | 6/18/2021 8
1.5 Intended use
The "PN/MQTT Coupler" enables data exchange between a PROFINET network and MQTT brokers.
All components are supplied with a factory hardware and software configuration. The user must carry
out the hardware and software configuration for the conditions of use. Modifications to hardware or
software configurations which are beyond the documented options are not permitted and nullify the
liability of Helmholz GmbH & Co. KG.
The device may not be used as the only means for preventing hazardous situations on machinery and
systems.
Problem-free and safe operation of the device presumes proper transport, storage, setup, assembly,
installation, commissioning, operation, and maintenance.
The ambient conditions provided in the technical specifications must be adhered to.
The device has a protection rating of IP20 and must be installed in an electrical operating room or a
control box/cabinet in order to protect it against environmental influences. To prevent unauthorized
access, the doors of control boxes/cabinets must be closed and possibly locked during operation.
1.6 Improper use
The consequences of improper use may include personal injuries of the user or third parties as well as
property damage to the control system, the product, or the environment. Use the PN/MQTT Coupler
only as intended!

PN/MQTT Coupler | Version 2 | 6/18/2021 9
1.7 Liability
The contents of this manual are subject to technical changes resulting from the continuous
development of products of Helmholz GmbH & Co. KG. In the event that this manual contains
technical or clerical errors, we reserve the right to make changes at any time without notice.
No claims for modification of delivered products can be asserted based on the information,
illustrations, and descriptions in this documentation. Beyond the instructions contained in the
operating manual, the applicable national and international standards and regulations must also be
observed in any case.
1.7.1 Disclaimer of liability
Helmholz GmbH &Co. KG is not liable for damages if these were caused by use or application of
products that was improper or not as intended.
Helmholz GmbH & Co. KG assumes no responsibility for any printing errors or other inaccuracies
that may appear in the operating manual unless there are serious errors about which Helmholz GmbH
& Co. KG was already demonstrably aware.
Beyond the instructions contained in the operating manual, the applicable national and
international standards and regulations must also be observed in any case.
Helmholz GmbH & CO. KG is not liable for damage caused by software that is running on the user’s
equipment which compromises, damages, or infects additional equipment or processes through the
remote maintenance connection and which triggers or permits unwanted data transfer.
1.7.2 Warranty
Report any defects to the manufacturer immediately after discovery of the defect.
The warranty is not valid in case of:
•Failure to observe these operating instructions
•Use of the device that is not as intended
•Improper work on and with the device
•Operating errors
•Unauthorized modifications to the device
The agreements met upon contract conclusion under “General Terms and Conditions of Helmholz
GmbH & Co. KG” apply.
1.8 Open Source
Among other things, our products contain open source software. This software is subject to the
relevant license terms. The relevant license terms, including a copy of the full license text, are
downloadable from the product website. They are also provided in our download area of the
respective products at www.helmholz.de.
Furthermore, we offer to send the complete corresponding source code of the respective open source
software to you and to any third party as a DVD upon your request for a contribution towards
expenses of Euro 10.00. This offer is valid for a period of three years. This offer is valid for a period of
three years, calculated from the delivery of the product.

PN/MQTT Coupler | Version 2 | 6/18/2021 10
2Security recommendations
Managed switches are network infrastructure components, and thus an important element in the
security considerations of a system or network. When using the PN/MQTT Coupler, therefore please
consider the following recommendations in order to prohibit unauthorized access to plants and
systems.
General:
•Ensure at regular intervals that all relevant components fulfill these recommendations and
possibly any other internal security guidelines.
•Evaluate your system holistically with a view to security. Use a cell protection concept with
corresponding products.
You can find extensive information, for example, in the “ICS Security Compendium”
of the Federal Office for Information Security (BSI):
https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/ICS/
ICS-Security_compendium.html
Physical access:
•Limit physical access to components of relevance to security to qualified personnel.
Security of the software:
•Always keep the firmware of all communications components up to date.
•Inform yourself regularly of firmware updates for the product. You can find information on
firmware update in this manual.
•Only activate protocols and functions you really need
Passwords:
•Define rules for usage of the devices and the awarding of passwords.
•Update passwords and keys regularly
•Change standard passwords
•Only use strong passwords. Avoid weak passwords like, for example, “password1”, “123456789”,
or similar.
•Ensure that all passwords are protected and inaccessible to unauthorized personnel.
•Do not use one password for various users and systems.

PN/MQTT Coupler | Version 2 | 6/18/2021 11
3System overview
3.1 General/area of application
The MQTT protocol has become established in recent years as a simple transmission protocol for
messages in the IoT world. MQTT stands for "Message Queue Telemetry Transport Protocol" and is an
OASIS standard. Information on the MQTT protocol can be found here: mqtt.org
The MQTT protocol always uses a central
broker for communication between devices,
which receives messages from e.g. a sensor and
forwards them to interested devices, e.g. a
control unit.
When a sensor sends data to the broker, this is
called "publish". If a device needs data, it must
“subscribe” to the broker. The broker delivers
the data to all subscribers when new data has
arrived from the publisher.
Data is always transmitted under a freely definable identifier - the "Topic". The "Topic" is a descriptive
text, e.g. "Temperature". In order to distinguish between different topics of the same type, groupings
are used, e.g. "Living room/temperature". The groupings are divided by a slash ('/'). Thus the data can
be mapped into more complex structures: "Upper floor/Living room/Temperature" or "Upper
floor/Living room/Humidity".
The data delivered via MQTT can be transmitted in binary format, text format or structured in JSON
format.
With the PN/MQTT Coupler a transfer of values between a PROFINET controller (PLC) and a MQTT
broker is possible. It is possible to send values from the PLC via PROFINET to a broker ("Publish") as
well as to subscribe values from a MQTT broker and receive them in the PLC via PROFINET
("Subscribe").

PN/MQTT Coupler | Version 2 | 6/18/2021 12
The integration into the PLC engineering tool is enabled by a GSDML file, an additional extra
configuration software is not necessary. The configuration of the I/O data to be exchanged is done in
the Siemens engineering tool. All settings for the MQTT connection can be done on the web page of
the device.
MQTT brokers can be connected both locally ("On premise") and via the Internet ("Cloud"). A local
broker can be operated, for example, with the open-source software "Mosquitto" in the company
network on a PC/server or also on a small computer, such as a Raspberry PI.
The PN/MQTT coupler can only establish a connection with one broker! If the data is also
to be distributed to other brokers, the connection must be established between the brokers (Multi
Broker).
In the cloud, IoT systems such as HiveMQ, Amazon IoT, Microsoft Azure or Siemens Mind-sphere (in
preparation) can be connected directly. For a description of how to connect to the various cloud
systems, see later in this manual or ask support.
3.2 PN/MQTT Coupler Features
The "PN/MQTT Coupler" has the following features:
•PROFINET IO Device as of IEC 61158-6-10
•Up to 1024 bytes of input and output data
•Supports OASIS MQTT standards V3.1.1 and V5
•Easy assignment of IO data via GSDML file
•Up to 100 values can be configured for transmission at the same
time (100 slots)
•Flexible configuration via web browser
•Separate networks for PROFINET and MQTT connection
•Connection to brokers in the local network or directly with the
"cloud”
•Authentication (password, certificate) and encryption (TLS)
•Supports AWS IoT, Microsoft Azure, HiveMQ, IBM Watson, Google IoT, Siemens Mindsphere (in
preparation)
•Very compact design for DIN rail mounting
•Redundant power supply
•Galvanic isolation of the networks

PN/MQTT Coupler | Version 2 | 6/18/2021 13
4Installation and removal
4.1 Access restriction
The modules are open operating equipment and must only be installed in electrical equipment
rooms, cabinets, or housings.
Access to the electrical equipment rooms, cabinets, or housings must only be possible using a tool or
key, and access should only be granted to trained or authorized personnel.
4.2 Mounting and minimum distances
The PN/MQTT Coupler can be mounted on a DIN rail and installed in any position. It is
recommended to keep minimum distances when mounting. By keeping the minimum distances
•the modules can be mounted or dismantled without having to dismantle other parts of the
system.
•there is enough space to connect all existing connections and contacting possibilities with
commercially available accessories.
•There is space for any necessary cable routing.
Installation must be carried out in accordance with VDE 0100/IEC 364 and applicable national standards.
The device has protection level IP20. If a higher degree of protection is required, it must be installed in
an enclosure or a control cabinet.
4.3 Electrical installation
Observe the regional safety regulations.
4.4 Protection against electrostatic discharges
To prevent damage through electrostatic discharges, the following safety measures are to be followed
during assembly and service work:
•Never place components and modules directly on plastic items (such as polystyrene, PE film) or in
their vicinity.
•Before starting work, touch the grounded housing to discharge static electricity.
•Only work with discharged tools.
•Do not touch components and assemblies on contacts.

PN/MQTT Coupler | Version 2 | 6/18/2021 14
4.5 EMC protection
To ensure electromagnetic compatibility (EMC) in your control cabinets in electrically harsh
environments, the known rules of EMC-compliant configuration are to be observed in the design and
construction.
Observe all standards, regulations and rules regarding shielding when setting up the system and laying
the necessary cables. Strictly adhere to the corresponding writings of the PROFIBUS user organization for
setting up PROFINET.
Errors in the shielding can lead to malfunctions or even failure of the system.
4.6 Operation
Operate the device only in flawless condition. The permissible operating conditions and performance
limits must be adhered to.
Retrofits, changes, or modifications to the device are strictly forbidden.
The device is a piece of operating equipment intended for use in industrial plants. During operation,
all covers on the unit and the installation must be closed in order to ensure protection against contact
When the PN/MQTT Coupler is switched off, bus connections are interrupted! Before starting any work
on the device, make sure that no impermissible interference occurs in connected systems when the bus
connections are interrupted.
4.7 Recycling / WEEE
The company Helmholz GmbH & Co. KG is registered as a manufacturer with the HELMHOLZ brand
and the device type "Small devices of information and telecommunications technology for exclusive
use in households other than private households" as well as the following registration data:
Helmholz GmbH & Co. KG,
Location / Headquarters: 91091 Großenseebach,
Address: Hannberger Weg 2,
Name of authorized representative: Carsten Bokholt,
Registration number: DE 44315750
The electrical devices described in this document are to be recycled. According to Directive
2012/19/EU on waste electrical and electronic equipment (WEEE), they must not be disposed of by
municipal waste disposal companies.

PN/MQTT Coupler | Version 2 | 6/18/2021 15
5Connection
5.1 Power supply
The PN/MQTT coupler must be supplied with DC 24 V at the wide-range input DC 18 ... 30 V via the
supplied connector plug. The power supply is redundant, at least one supply path PS 1 or PS 2 must be
connected.
The housing of the PN/MQTT Coupler is not grounded. Please connect the functional earth terminal (FE)
of the PN/MQTT Coupler properly to the reference gantry.
5.2 Network
The left RJ45 sockets "X1 P1" and "X1 P2" are used to connect the PROFINET network, the right RJ45
sockets "X2 P1" and "X2 P2" are used to connect the Ethernet network in which the MQTT broker is
accessible. The ports X1 P1 and X1 P2, as well as X2 P1 and X2 P2 are each internally connected to a
switch.
The interfaces X1 and X2 are logically separate networks and not physically connected. Thus a clear
separation between the machine data (PROFINET) and the MQTT data connection is possible.
A network penetration with other functions by the
PN/MQTT coupler is not possible.
The configured values are exchanged in the PN/MQTT
coupler only as IO data between both network sides.
If the MQTT broker needs to be placed in the same network (subnet) as the PROFINET PLC, the network
X2 can be configured in the same subnet as the network X1. The interface X2 then needs its own IP
address and must be connected to the network X1 with an Ethernet cable.

PN/MQTT Coupler | Version 2 | 6/18/2021 16
5.3 network connector
Pin signal RJ45 connector color Wire pair
1 TD+ Transmission Data + Yellow 1
2
TD-
Transmission Data -
Orange
1
3
RD+
Receive Data +
White
2
4
-
-
-
-
5
-
-
-
-
6 RD- Receive Data - Blue 2
7
-
-
-
-
8
-
-
-
-

PN/MQTT Coupler | Version 2 | 6/18/2021 17
6Install GSDML file
Please download the GSDML file ("GSDML-V2.35-Helmholz-PN-MQTT-coupler-
____.xml") at www.helmholz.de or scan the QR code. Install the GSDML file in the
"Tools" / "Manage device description file (GSD)" menu in the TIA Portal.
The PN/MQTT Coupler can be found in the hardware catalog at
"Other field devices / PROFINET IO / Gateway / Helmholz GmbH &
Co. KG".

PN/MQTT Coupler | Version 2 | 6/18/2021 18
7Configuration in TIA Portal
Add the PN/MQTT coupler to the project and connect the coupler to the PROFINET network.
Name the device name and check the Ethernet address for the device.
7.1 Parameterization of the PN/MQTT coupler
The parameterization of the PN/MQTT coupler is performed via the PROFINET hardware configurator
(e.g. TIA Portal). The PROFINET parameters and the I/O data to be transmitted via MQTT are defined
here. The configuration of the MQTT network connection (connection to the MQTT broker) is set via
the web page of the device.

PN/MQTT Coupler | Version 2 | 6/18/2021 19
MQTT IP-address mode (X2): Setting the IP address for the X2 network. Possible options:
"DHCP" = The PN/MQTT Coupler tries to get an IP address as well as a gateway and a DNS server in the
network via a DHCP server.
"Static IP" = The address, subnet mask and date gateway can be fixed directly in the following fields.
The setting of a DNS server can - if required - additionally be done on the web page.
"IP address from web page" = The IP settings of the X2 network can be carried out via the web page. At
the first start-up, the PN/MQTT Coupler is only accessible in the X1 network (PROFINET). Only when
the IP settings for the X2 network have been set there, the coupler is also accessible via X2 or can
establish a connection to the MQTT broker.
Static IP address: If the address mode has been set to "Static IP", the static IP address of the X2
network can be specified here. This setting has no function with "DHCP" and "IP address from web
page".
Static IP subnet mask: If the address mode has been set to "Static IP", the subnet mask of the X2
network can be specified here. This setting has no function with "DHCP" and "IP address from web
page".
Static IP gateway: If the address mode has been set to "Static IP", the gateway of the X2 network can
be specified here. This setting has no function with "DHCP" and "IP address from web page".
Hostname mode: "From PROFINET configuration" or "From webpage".
DHCP hostname: Hostname of the device, is used if the "Hostname mode" option "Take over from
PROFINET configuration" was selected.
Webpage: On which network interfaces should the web page be displayed.
Please note in the commissioning phase in the PROFINET configuration to activate at least
the web page on the PROFINET network side (X1) or "both network sides". Otherwise a complete
configuration is not possible.
For security reasons it is advisable to switch off the web pages in the PROFINET configuration after
commissioning or at least to switch off the web interface on the network side, which is connected in the
WAN or Internet.

PN/MQTT Coupler | Version 2 | 6/18/2021 20
7.2 Operating principle of the PN/MQTT coupler
The data exchange between the PLC and the MQTT broker is organized via individual values. A value
can be 1, 2 or 4 bytes in size and is in the I/O area of the PROFINET controller. Depending on the data
direction, the value is writable to outputs (MQTT Publish) or readable from inputs (MQTT Subscribe).
Up to 100 different values can be exchanged between the PROFINET controller and the MQTT broker
(100 slots). The values can be plugged as modules into the slots of the coupler as required.
A module always represents exactly one value, which is exchanged with the broker via its MQTT topic
name. A value is usually sent via MQTT in a readable form (direct text or JSON formatted). For this
reason, there are different representations for each value size (1, 2, 4, 8 bytes): hexadecimal, unsigned
decimal, signed decimal or floating point.
Configuration example:
Output modules are sent to the broker once after restarting the coupler and then after each change of
the PLC value. If PLC values are sent that change very quickly, it is possible to specify a "publish
interval" on the configuration web page.
The value of the input modules is initialized with 0 after (re-)starting the coupler and is permanently
taken over into the input area when a new value is received via MQTT. A bit additionally indicates the
reception of a value in the PLC.
Table of contents
Other Helmholz Adapter manuals

Helmholz
Helmholz 700-162-3MQ02 User manual

Helmholz
Helmholz 700-159-3MB01 User manual

Helmholz
Helmholz TB20 User manual

Helmholz
Helmholz SSW7-USB User manual

Helmholz
Helmholz 700-158-3DP02 User manual

Helmholz
Helmholz 700-159-3MB02 User manual

Helmholz
Helmholz SSW7-RK512/RS422 User manual

Helmholz
Helmholz SSW7-RK512 User manual