Topic: Trying to Use MQTT with Microchip Harmony 1.06

I am trying to Add WolfMQTT to Microchip Harmony 1.06 Project.
I am having some Issues so
1> I am Assuming the sample Works.
2>What would be the Newest version of Wolf SSL / Wolf MQTT that will work with that version of the Microchip Network Stack
    Wolf SSL =3.9.0 and Wolf MQTT = V0.10 / Wolf MQTT
3> How Much Heap does it need I am sending to Azure.
4> If I close MQTT and Net The SSL fails when I call MQTT INIT. Is there a way to leave the SSL Initialized. I may send as little as once per day so I do not want to keep the connection Open.

Share

Re: Trying to Use MQTT with Microchip Harmony 1.06

Hi Neil.Kurzman,

Thanks for your interest in wolfMQTT, great questions.

1.  Please confirm which sample you're referring to.  I would strongly recommend that you use our example found here: https://github.com/wolfSSL/wolfMQTT/tre … ip-Harmony
2.  For wolfSSL you'll need to use the Microchip fork which is currently on 5.7.0: https://github.com/Microchip-MPLAB-Harmony/wolfssl/  For wolfMQTT, the latest version should work if you follow the example linked above.
3.  Heap usage will vary depending on your build configuration (especially whether you use small stack which will significantly increase heap usage), your algorithms, how many connections you're opening at once and your platform.  Do you have a target for heap usage?  How much stack do you have available on your system?
4.  Yes, you can use session resumption for this.  We have an example of this here: https://github.com/wolfSSL/wolfssl-exam … 3-resume.c (instructions here: https://github.com/wolfSSL/wolfssl-exam … aster/tls)

Are you able to share any information on your project?  Are you using wolfMQTT in a personal or commercial project?
If any of this information is sensitive or confidential, feel free to contact us at support [AT] wolfssl [DOT] com.

Thanks,
Kareem

Share

3 (edited by Neil.Kurzman 2025-08-05 18:46:22)

Re: Trying to Use MQTT with Microchip Harmony 1.06

Thank you for your Response.
I will Need to look at the links.

1. I will Look (The sample is for MQTT V0.10)

2. Will 5.7.0 work with Harmony 1 or does it need Harmony 3? Or is that a question for Microchip.

3. I am making a single connection to an Azure MQTT Broker.
I did not choose small stack. I should look at that too.
The Question is how much I need add to the Heap / Stack to insure SSL is Good. I still have plenty of RAM
Can I have it do all the mallocs and hold them. I assume large stack will do less mallocs. Does either work faster?

4. I will Look.
(instructions here: https://github.com/wolfSSL/wolfssl-exam … aster/tls) this link is Bad

Right now my Subscription is working well.
This is a Commercial Product. (Or will Be)
Will the two links help a shut down and start up if the connection is lost.
My Application will run for months at a time unattended. I would like it to restore the connecyion on its own.

Share

Re: Trying to Use MQTT with Microchip Harmony 1.06

Hi Neil,

2.  It may require Harmony 3, that is ultimately a question for Microchip.
3.  I would recommend small stack if you need to minimize stack usage on your platform, we generally recommend it for embedded systems.  You can find an overview of our commonly used build settings here: https://github.com/wolfSSL/wolfssl/blob … template.h
If wolfSSL/wolfMQTT tries to allocate memory from the heap and fails, it will return -125 MEMORY_E.  Your application can then try freeing memory and call the relevant function again.
Your toolchain should be able to measure and print the max stack usage when building your application, you may need to configure this.  Heap usage will vary.
You are correct, the tradeoff for small stack is that more heap memory is used and therefore there are more malloc calls.  Unless malloc takes a significant amount of time on your system, I would expect both options to perform the same.

4. Apologies for the bad link, please try:
https://github.com/wolfSSL/wolfssl-exam … master/tls
Yes, if you save the session you can resume it when the connection is lost as long as the server hasn't marked the session as expired.  Otherwise you will need to perform a full handshake again.  Either way you can restore the connection, it will just take longer if you are unable to resume a session.

Thanks,
Kareem

Share

Re: Trying to Use MQTT with Microchip Harmony 1.06

Change from Harmony 1 to 3 is a major rewrite.  I will Check with Microchip.
To me, for embedded use, the Stack is better.  The Heap can get fragmented.

Right now the Connection to Azure is working very well. Subscribe and Publish.
I just need to handle disconnects. 
MqttClient_NetDisconnect() and MqttClient_Disconnect() seem to cause exceptions an do no restore the connection.
They maybe better in later versions.
I need to handle certificate expiration, Sever timeouts, and Network disconnects.

I will Check with Microchip about updates.
If not I will need to make my own reconnect function.

Thank you for all you help

Share