A MQTT client with blueprint support for Unreal Engine 4, based on Mosquitto.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Source/ProjectName
ThirdParty
LICENSE
README.md

README.md

UnrealMosquitto

A MQTT client with blueprint support for Unreal Engine 4, based on Mosquitto.

unrealmosquittoscreenshot

How to install

Because this has not been developed as a plugin, the installation process is slightly very cumbersome. Only Windows x64 is supported so far.

  1. Make sure your project is set-up for C++. If it's not already the case, add a simple C++ Actor in Unreal that you could remove later.
  2. Add the ThirdParty folder to the UnrealProject.
  3. Edit your project's build file, named YourProjectName.Build.cs in the Source/YourProjectName folder. The changes are based on the Source/ProjectName/ProjectName.Build.cs file.
    1. Add the using System.IO;
    2. Add the two new methods ThirdPartyPath and LoadThirdPartyDLL.
    3. Add the two LoadThirdPartyDLL at the end of the constructor.
  4. Add the source files in the Source/ProjectName/Private and Source/ProjectName/Public folders to your respective Source/YourProjectName/Private and Source/YourProjectName/Public folders.
  5. In these files, replace all occurences of ProjectName by YourProjectName and PROJECTNAME_API by YOURPROJECTNAME_API.
  6. Finally, add the mosquitto.dll and mosquittopp.dll in the Binaries/Win64 folder. You can find these two DLLs in the ThirdParty subfolders, but you will have to to remove .x64 from their pathname.
  7. Right-click on YourProject.uproject file, and select Generate Visual Studio Project files.
  8. Open YourProject.sln and compile everything.
  9. (Re)Start the Unreal Engine Editor.

How to use

To use the MQTT client, the simplest method is to create a blueprint child class from it.

  1. Find the C++ Unreal Mosquitto class in the content browser.
  2. Right click and select Create Blueprint class based on UnrealMosquitto.

This new child class has access to the events in its event graph. You can also configure the client in the MQTT section in the details panel of the root element. The router can dispatch executions flows based on MQTT topics.