Hi Forum,

When using a mqt client.
Is there a way programmatically to change the Broker IP address which the client is pointing to on runtime?
Once the broker ip address is change what needs to be done? Maybe restart the client?
What is the proper function/methods to call/execute?

Thank you

2

(1 replies, posted in wolfMQTT)

Hi Forum,

Is it possible to subscribe to several topics ?

Any example will be appreciated.

Thank you.

3

(2 replies, posted in wolfSSL)

Thank you for response Kareem.

Much appreciated.

4

(2 replies, posted in wolfSSL)

Hi Forum,

Using WolfSSL with mplabx XC32 compiler shows several warnings related to

-Wpacked-not-aligned

Example:

In file included from ../src/config/default/definitions.h:63,
                 from ../src/main.c:28:
../src/config/default/library/tcpip/tcpip.h:272:1: warning: alignment 1 of 'struct _IPV6_ADDR_STRUCT' is less than 2 [-Wpacked-not-aligned]
 } IPV6_ADDR_STRUCT;

The program compiles but the warnings are numerous, very noisy and makes debugging a bit more difficult.
Is there a way to silence these specific warnings?

Thank you.

Eric,

mqttPublish.total_len 

solved the issue.

Thank you very much for your help.

Thank you for feedback Eric.
I will check and let you know.

Hi Forum,

I am using wolfMQTT and MPLABX Harmony 3 with the NET-GLUE (https://github.com/Microchip-MPLAB-Harm … net_glue.h)

Using these configuration values :

#define APP_MQTT_MAX_PUBLISH_MESSAGE_SIZE   1024
#define APP_MQTT_TX_BUFF_SIZE       2048
#define APP_MQTT_RX_BUFF_SIZE       2048
#define APP_MQTT_DEFAULT_QOS            MQTT_QOS_0

The message to publish is a JSON string which is passed / filled to the mqtt context object publish buffer using snprintf :

snprintf(mqttCtx->publishMessage, APP_MQTT_MAX_PUBLISH_MESSAGE_SIZE + 1, MQTT_HW_TOPIC_PAYLOAD_TEMPLATE,
        field1,
        field2,
        ...
        ...
        fieldN);

Total length json string is about 298 characters.

To publish the message I execute :

resCode = MqttClient_Publish(&mqttCtx->mqttClient, &mqttCtx->mqttPublish);
            if (resCode == MQTT_CODE_CONTINUE)
            {
                break;
            }

The message is published successfully but the receiving broker receives randomly some messages incomplete.
Most of the time the message has LAST character missing or an extra null character at the END.

Is correct to fill "mqttCtx->publishMessage" buffer using snprintf or am I doing something wrong?

Any help is appreciated it.

Thanks