Skip to main content
Version: 1.2.0

Troubleshooting

Connection issues

MQTT won't connect to external broker

Usually this problem arises from an improperly configured network.

  • Make sure, the external broker is available from the network you're running a smoothMQTT app in.
  • Your smoothMQTT app needs to have one MQTTManager prefab instance in the scene.
  • Confirm the IP address and Port on the settings component match the address and port of your broker.
  • Check if the broker's firewall accepts incoming connections on the MQTT port(s)
  • If it still doesn't work, restart the broker and restart the unity app.
  • NOTE: If you have a very slow network connection, you might want to increase connection timeout (on settings component) to above 3, however if this is necessary your MQTT experience will be far from realtime.

I can connect but neither send nor receive messages

Check if the broker has user management and restrictions in place. Use proper username and password in settings component.

I can connect and either send or receive messages, but not both

There are user restrictions in place in the broker configuration. Make sure the client user has access to all topics to be used.

Leading Slash in Topics

This is a syntactical problem typically encountered in MQTT. The topic /test/topic and test/topic are not the same. While both are valid, some other client not from your unity app (for example a sensor or a python script) might use URL-notation for MQTT where the second slash might be autoremoved, i.e. mqtt://user:password@hostname//test/topic does write to test/topic instead of /test/topic. This is very hard to find and debug, so my suggestion is to never use a leading slash in your topics.

Tools Menu does not do anything

Check your console for any warnings. If it says "No Gameobject selected" you need to select a gameobject in your scene or hierarchy before trying to add the components.