cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

Anonymous
Not applicable

Hello,

I'm currently working with Azure Iot hub and amqp v1.0 protocol on Wiced 6.1.

I have two questions concerning emission and reception frames.

1 - When I send a message I obtain special characters on Azure even if the message is empty (see below) :

(#define AMQP_MESSAGE_STR                "HELLO WICED")

One special character if the frameis empty = #define AMQP_MESSAGE_STR                ""

two special characters if the frame is not empty (with a json frame) =  #define AMQP_MESSAGE_STR                "Json frame"

pastedImage_0.png

what should I do to remove them ?

2 - When I receive a message but it is an empty frame (I added some modifications to use the demo with a receiver link):

WICED_AMQP_EVENT_TRANSFER_RCVD works but data is empty.

Can you help me ?

1 Solution
Anonymous
Not applicable

The problem is in the performative "AMQP Value" , I hope this probleme will be resolved in a next version.

To workarround, you can use the performative "Application data" by replacing 0x77 by 0x75 inAMQP_transfert.c line 290.

View solution in original post

7 Replies
Anonymous
Not applicable

Do you have any idea for this issue  ?

0 Likes
MichaelF_56
Moderator
Moderator

Have you seen anyu​'s help article here MQTT with Microsoft Azure

0 Likes
Anonymous
Not applicable

Thank you for your answer but :

1) I work on azure with AMQP V1.0 protocol (not MQTT).

2) The link show : how to use azure on receiver side but I have this problem on sender side.

0 Likes
Anonymous
Not applicable

I also modified one function in : librairies/protocols/AMQP/AMQPv1_0/amqp_transfer.c wiced_result_t

amqp_frame_get_transfer_performative( wiced_amqp_frame_t *frame, void *arg )

I did it to receive the data correctly during the reception (the decoding of the performative was not done well).

Do you think there might be a similar problem in the show that would explain the special characters?

Anonymous
Not applicable

I did the test by filling the #define of the azure demo without any modification on amqp librairies

Here is the result:

pastedImage_3.png

My problems :

  • I use empty messages (so free) to keep my connection active BUT with special characters, messages are counted in the billing.
  • On Azure Side JSON frames are not decoded.

Would you like to tell me if you are observing the same things?

Anonymous
Not applicable

The problem is in the performative "AMQP Value" , I hope this probleme will be resolved in a next version.

To workarround, you can use the performative "Application data" by replacing 0x77 by 0x75 inAMQP_transfert.c line 290.

View solution in original post

Anonymous
Not applicable

To solve the problem of the transmitter side (sender : device-->Azure), you have to:

  • modify the following lines of codein the function

wiced_result_t amqp_frame_put_transfer( wiced_amqp_frame_t *frame, void* arg )

    /* Encoding payload data */

    AMQP_BUFFER_PUT_SHORT( &frame->buffer, 0x0053 );

AMQP_BUFFER_PUT_OCTET( &frame->buffer, 0x77 );

AMQP_BUFFER_PUT_OCTET( &frame->buffer, 0xa1 );

    AMQP_BUFFER_PUT_SHORT_STRING( &frame->buffer, params->message->data, params->message->data_lenth );

    return WICED_SUCCESS;

Replace by

    /* Encoding payload data */

    AMQP_BUFFER_PUT_SHORT( &frame->buffer, 0x0053 );

AMQP_BUFFER_PUT_OCTET( &frame->buffer, 0x75 );

AMQP_BUFFER_PUT_OCTET( &frame->buffer, 0xa0 );

    AMQP_BUFFER_PUT_SHORT_STRING( &frame->buffer, params->message->data, params->message->data_lenth );

    return WICED_SUCCESS;

Result with empty message :

pastedImage_1.png