Trying to start using undocumented package MQTTLink to interact with local mosquitto server. First of all I played with toy example pulled from this link:


imAclientForExternal = CreateClient[];

ConnectClient[imAclientForExternal, "localhost:1883"];

TopicSubscribe[imAclientForExternal, "wolframTest", 
  "MessageReceivedFunction" :> (Print[
      ByteArrayToString[#3["Data"]]] &)];

  "wolframTest" -> "my personal message"];

TopicUnsubscribe[imAclientForExternal, "wolframTest"]

Publishing works fine but subscribing doesn't work at all. Nothing happens if a message is published in topic "wolframTest". Official util mosquitto_sub receives the test messages correctly.

MQTTLink is what I looked for for my purposes and subscribing should works unhesitatingly. Could you please help me with this example?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.