Jump to content

MQTT - Mosquitto - Unilogic


JWARD

Recommended Posts

I'm just learning PLC programming and need to implement MQTT so I figured I's start with the simple MQTT example provided by Unitronics. My setup is a Mosquitto Broker running on Ubuntu, a US5-B10-RA28 plc and I'm programing with the latest version of Unilogic.  

I have tested to ensure the Broker is working both from the Ubuntu machine and from a windows machine using MQTT Explorer. I then open the simple example, modify the Broker connection and IP address of my broker and download it to the PLC.  I click the connect button, but nothing seems to happen, I change the Publish ID and click the publish button, but no data is received by the broker.

I have tested using the URL or IP address of the broker but neither worked. 

I guess my question would be, what is the least amount of configuration required to publish to a broker, I know I need to configure the broker, configure at least 1 publication, and configure the IP connection of the PLC, where I'm stuck is on the ladder. would someone be able to provide a very simply explication of the minimum ladder needed to send data to the broker.    

Thanks in advance!!

Joe

Link to comment
Share on other sites

1st. to check if your broker is working, use postman -> a free tool to check rest api's and mqtt 

2. check your broker connection in mqtt protocol settings in unilogic -> below an example of my broker connection - first setup your broker without user and password to test it

image.thumb.png.2466ec0c0aec0385c1411c55aaa7eec9.png

3. make a subscription like following example, use raw data as format, after you can implement json....

image.thumb.png.6c0714725b04277a78d85b3b3794052a.png

4. make a ladder rung to subscribe to all topics like this

image.png.893d4b53d9bccf5538b771624f52edc9.png

 

 

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.