PLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. mschneider
  2. PLCnext Technology & PLCnext Controls
  3. Tuesday, 19 May 2020
Hello, I have a question regarding the Mosquitto MQTT Broker application from the PlcNextstore
I have installed the Mosquitto app on my PLC (2020.3)
My goal is to configure Mosquitto as a bridge with my actual OnLine MQTT broker :
So, I have created a mosquitto.conf file that I put in the dedicated directory :
And the content of this file is as follow :
############ port 1888 log_type all connection bridge-01
try_private false
cleansession true
topic # out 0
topic # in 0
remote_clientid broker1
remote_username iamtkn_xxxxxxxxxxxxxxxx
#remote_password ' '
I found this description (help configuration file) here :
But first of all, I would like to know how mosquitto is launched?
I can see that the app is running :
But I can see nothing in the logs that show that the 2152 tries to connect to
Here is the output.log file, and it seems there is nothing about MQTT, nor Beebotte...
So :
1 - Can you tell me how to configure and start automatically the connection to with the mosquitto app so that it acts as a bridge?
2 - Can you tell me if the configuration file is correctly created, and at the correct place?
3 - From PlcNext, how do I access to the tags of the MQTT broker? For example, the access to my data is made with the syntax channel/ressource
How can I set this syntax in an In or Out port?
4 - is there a more complete documentation about how to use this app, and how to configure it in an easy way? The file mosquitto.conf.example is quiet complicated and not easily understandable.
Martin PLCnext Team Accepted Answer Pending Moderation

Hi Michel,

I don't know much about Mosquitto, but I will assume that it is capable of doing what you want (i.e. act as some sort of bridge).

I believe that the Mosquitto app in the store is simply a convenient way of installing the Mosquitto broker (and client tools) on an AXC F 2152. Otherwise, the Mosquitto broker and client tools in that app are 100% standard Mosquitto, so pretty much all the publicly available Mosquitto documentation should also apply to the installation on the PLC. That is probably why, once you have the Mosquitto broker installed and running on the PLC (which you appear to have done), there is not much else the app developer can help you with.

My suggestion is that you should first set aside the PLC and try setting up the configuration you want on a PC, that is, as a bridge between something (?) on your PC, and your "beebotte" server. That removes any complications related to the AXC F 2152. You should be able to use the Mosquitto client tools (mosquitto_pub and mosquitto_sub) to simulate any MQTT client(s) you will be running on the PLC. That should give you a good idea of what a working Mosquitto configuration looks like, which will make it much easier to get a working configuration on the PLC.

To answer your specific questions:

You will not see anything in the Output.log file related to the Mosquitto broker, because the standard Mosquitto broker knows nothing about the PLCnext Runtime or the Output.log file. I don't know where the standard Mosquitto broker writes messages - perhaps to its own log file, or to the syslog. There may be something in the standard Mosquitto documentation about this.

1 - The configuration, startup and automatic connection to as a bridge, will work pretty much 100% the same way as it does with the Mosquitto broker running on your PC, so once you get that set up successfully on your PC, you can simply transfer the configuration to the PLC.

2 - Again, the format and location of the configuration file will be pretty much 100% the same as on your PC. There is nothing special about the Mosquitto broker on the PLC in this respect.

3 - Regarding access to PLCnext GDS port variables - again, the (100% standard) Mosquitto broker running on the PLC has absolutely no concept of the PLCnext Runtime, or GDS port variables, or anything else specific to PLCnext. If the Mosquitto broker can act as an OPC UA client, or a REST client, or a Modbus Client, for example, then it can use these standard interfaces to exchange data with a PLCnext Engineer project.

4 - Regarding documentation, and the mosquitto.conf file - the standard Mosquitto broker documentation will 100% appy to the broker installed on the PLC. So again, I would suggest getting this set up and working on your PC first, and after that, transferring that working configuration to the PLC should be reasonably simple.




Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

mschneider Accepted Answer Pending Moderation

Hello Martin


In fact,  I try to find a simple way to make a link beetween the 2152 variables, and an MQTT broker (beebotte).

So, it seems that the mosquitto install from the strore is not what I need.


But I found one page on the github from you, about an mqtt/gds connector. :

So, that seems to be what I need.


But, in the details, you say that the app must be installed from the store. And that a demo version is available for free.

  • AXC F 2152 with minimum firmware version 2020.0 LTS
  • Valid account for the PLCnext Store with payment credentials (not needed for the trial version)
  • The PLCnext Control must be connected to the internet and must be registered in the PLCnext Store

But where is the free demo version? I can not find it! Is it still available?



Martin PLCnext Team Accepted Answer Pending Moderation

Hi Michel,

There is an MQTT Function Block library currently under development. If you are using PLCnext Engineer, then that FB library will probably suit your application better than the current MQTT Client app in the PLCnext Store.

If you would like to try a pre-release version of this FB library (strictly for non-production use), please send me an email.


Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  • Page :
  • 1

There are no replies made for this post yet.
However, you are not allowed to reply to this post.