Mosquitto working

Some rework had to be done
Brett sent me answers on what to do about SSL 1.x.x, and the problem I had with one of the sample programs: SSL 1.0.x has been staticly linked into the shareable image, so linking against that file (libmqttv3c$shr.exe) instead of the object library (libmqttv3c.olb) would solve the problem.
He also added a somewhat reworked version of paho_c_pub.c, I had to do some re-editing to solve issues that were the result of retrieving this source from the message and store it in my (WIN10) workstation, and moving is (ASCII) to the VMS box. But once these were addressed, the program starts and runs.

Next issue was to figure out how to pass a message from the VMS box to the application on my mobile….
First do it the easy way:

  • On my mobile (in MQTT Dashboard) define a connection giving it a easy name enter login nredentials as connecting to the server (since I am using Brett’s additional module for authentication), and let it listen to any subject (“+” so I don’t have to bother on that to begin with. Start the connection on mobile, it will start listening.
  • On the server start paho_c_pub, any topic will now do; Enter the connection on the mobile as clientid;

  • So there the commands and results are:
    $ pub :== $DKA0:[MQTT.PAHO.EXAMPLES]PAHO_C_PUB.EXE
    $ pub test --clientid (Name on Mobile) --username (username) --password (password)
    Using topic test
    Connecting

    Connected
    redo

    Any test that is now entered, will show up in MQTT Dashboard in this client, under topic “test”

    Backlink has to be done – will be (I guess) paho_c_sub.c; Same setup for subject, it will show all that is sent – together with subject – until cancelled – it will listen to any topic (due to wildcard “+”):

    $ sub :== $DKA0:[MQTT.PAHO.EXAMPLES]PAHO_C_SUB.EXE
    $ sub + --clientid (Name on Mobile) --username (username) --password (password)
    Subscribing to topic + with client (clientid) at QoS 2
    test redo
    Oktest redo
    Oktest redo
    Oktest Done

    These messages show up in the subcsscription area in MQTTDashboard as well – obvious, since I’m listening to any subject 🙂
    I also added –delimiter \n to add delimiter beyond, but that does not work the way I anticipated. But is newline is included in the message it will show up in output:

    $ sub + --clientid (Name on Mobile) --username (username) --password (password) --delimiter \n
    topic is +
    Subscribing to topic + with client htc at QoS 2
    test Done \test Done
    \test With crlf

    But that is possibly a matter of understanding on how to read the documentation, it might well be the way it should work.

    If sub is started without clientid,

    sub + --username (username) --password (password)
    topic is +
    Subscribing to topic + with client stdout-subscriber-async at QoS 2

    messages from my mobile are not accepted. Which is fine for what I’m planning to use it for.

    Now the first hurdles have been taken: Connection works both ways and I have a fair impression on how the use it both ways. Next is creating API-calls (that Brett already started to do) and use these.

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.