This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem with CC32xx XMPP Reference Application

Other Parts Discussed in Thread: CC3200, CC3200SDK

Hi,

I am encountering problems trying the CC32xx XMPP Reference Application.

I’ve configured:

  • the SSID_NAME and SECURITY_KEY (inside file common.h) according to my Access Point configuration;
  • the CLIENT_USER_NAME and CLIENT_PASSWORD (inside file main.c) according to the gmail account I’ve created for the CC3200.

 

When I build the application and launch the debug, the CC3200 seems to connect to the AP (the red led blinks few times, then turns ON).

But when I send a message from another gmail account to the CC3200 account, nothing happens, the orange led does not blink, and the CC3200 does not replies to the message.

 

I am using:

Code Composer Studio Version: 6.0.1.00040

with CC3200SDK_1.0.0, tirtos_simplelink_2_01_00_03 and xdctools_3_30_03_47_core.

 

Thanks for help,

Simone

  • by the way, I am sure that the code runs up to line 791 of the main.c.

    The remaining part of the main task (code attached below) is not performed.

       Status = sl_NetAppXmppRecv(pRemoteJid, REMOTE_USERID_LEN, pRecvMessage, \

                                   RECV_MSG_LEN );

       while(1)

       {

           while ( Status < 0)

           {

               MAP_UtilsDelay(10000);

               Status = sl_NetAppXmppRecv(pRemoteJid, REMOTE_USERID_LEN, \

                                           pRecvMessage, RECV_MSG_LEN );

           }

           //

           // Toggle Orange LED to indicate if it gets some chat message

           //

           GPIO_IF_LedOn(MCU_ORANGE_LED_GPIO);

           MAP_UtilsDelay(800000);

           GPIO_IF_LedOff(MCU_ORANGE_LED_GPIO);

           Status = sl_NetAppXmppSend(pRemoteJid, strlen((char*)pRemoteJid), \

                                       pRecvMessage, strlen((char*)pRecvMessage) );  

       }

    }

  • Hi,

    I am encountering problems trying the CC32xx XMPP Reference Application.

    I’ve configured:

    • the SSID_NAME and SECURITY_KEY (inside file common.h) according to my Access Point configuration;
    • the CLIENT_USER_NAME and CLIENT_PASSWORD (inside file main.c) according to the gmail account I’ve created for the CC3200.

     

    When I build the application and launch the debug, the CC3200 seems to connect to the AP (the red led blinks few times, then turns ON).

    But when I send a message from another gmail account to the CC3200 account, nothing happens, the orange led does not blink, and the CC3200 does not replies to the message.

     

    I am using:

    Code Composer Studio Version: 6.0.1.00040

    with CC3200SDK_1.0.0, tirtos_simplelink_2_01_00_03 and xdctools_3_30_03_47_core.

    I am sure that the code runs up to line 791 of the main.c.

    The remaining part of the main task (code attached below) is not performed.

       Status = sl_NetAppXmppRecv(pRemoteJid, REMOTE_USERID_LEN, pRecvMessage, \

                                   RECV_MSG_LEN );

       while(1)

       {

           while ( Status < 0)

           {

               MAP_UtilsDelay(10000);

               Status = sl_NetAppXmppRecv(pRemoteJid, REMOTE_USERID_LEN, \

                                           pRecvMessage, RECV_MSG_LEN );

           }

           //

           // Toggle Orange LED to indicate if it gets some chat message

           //

           GPIO_IF_LedOn(MCU_ORANGE_LED_GPIO);

           MAP_UtilsDelay(800000);

           GPIO_IF_LedOff(MCU_ORANGE_LED_GPIO);

           Status = sl_NetAppXmppSend(pRemoteJid, strlen((char*)pRemoteJid), \

                                       pRecvMessage, strlen((char*)pRecvMessage) );  

       }

    }

     

    Thanks for help,

    Simone

  • Hi Simone,

    Can you please confirm that sl_NetAppXmppConnect has succeeded?
    If you still see the sl_NetAppXmppRecv failing, can you please tell the return value?

    Regards,
    Raghavendra
  • Hi. I will check this later with a debug session.
    Anyway, when I login with my account in gmail chat, and I start the CC3200, it connects to the AP (red led turns ON), then in my gmail account I can see the CC3200 account becoming available (green) on chat.
    I suppose this means the sl_NetAppXmppConnect succeeds, isn't it?

    thank you,
    Simone

  • Hi Simone,

    Yes, in that case sl_NetAppXmppConnect is successful.
    Can you please login to the cc3200 account and check if the message was received there?

    Regards,
    Raghavendra
  • Hi Raghavendra!

    Yes, I confirm that the messages are received.

    Simone

  • Hi Simone,

    Can you please confirm the return type of receive?

    Regards,
    Raghavendra
  • Hi,
    unfortunately the sl_NetAppXmppRecv seems not to return.
    If I place a breakpoint after the first occurrence of sl_NetAppXmppRecv inside the XmppClient function, the breakpoint is never reached, both if I send a message to the CC3200 or not.

    Regards,
    Simone
  • I notice a strange thing in EDIT mode:

    if I right click on sl_NetAppXmppRecv and select "Open declaration" CCS brings me to the function signature in xmpp.h file, not in xmpp.c. Is it normal?

    Moreover in DEBUG mode:

    if I place a breakpoint just before the sl_NetAppXmppRecv in the main loop (after the sl_NetAppXmppConnect) the breakpoint is reached but when I perform a "step into" the following error displays:

    sl_NetAppXmppRecv(unsigned char*, unsigned short, unsigned char* unsigned short) at D:/CC32xx/SDK_0.9.0.0_RC/netapps/xmpp/client/xmpp.c:495 0x200047e8

    Can't find a source file at "D:/CC32xx/SDK_0.9.0.0_RC/netapps/xmpp/client/xmpp.c" 

    Locate the file or edit the source lookup path to include its location.

    That is not my location.

    What should I do? I suppose I should select C:\ti\CC3200SDK_1.0.0\cc3200-sdk\netapps\xmpp\client (the real path where xmpp.c is), is it correct?

     

    Regards,

    Simone

  • Hi Simone,

    Yes, please choose the file relevant to your project using "Locate File..." button.

    Regards,
    Raghavendra
  • Hi,

    I located the file, but unfortunately the program does not work properly. As I said the sl_NetAppXmppRecv is not completed.

    The debug of such function is very difficult, since when I perform a step into operation the debug "pointer" seems to point not to the expected code line, but a few lines before.

    For example when I enter the sl_NetAppXmppRecv the CCS brings me to the

    ccPtr += 72;

    line of function sl_NetAppXmppSend.

    Thanks for help,

    Simone

  • Hi Simone,

    Are you able to print the return code of this function?

    Regards,
    Raghavendra
  • Hi,

    Which function do you mean? If you mean the sl_NetAppXmppRecv function, it seems that it's not completed, so there's no return value.

    Regards,

    Simone

  • Hi Simone,

    Are you saying that the flow is stuck inside sl_NetAppXmppRecv? Is it during the first call to sl_NetAppXmppRecv or the 2nd call inside the while loop? If it is the second one, then you can add a log after the first failure. If not, then can you please step in and add a log after the TCP sl_Recv fails inside xmpp.c?

    Regards,
    Raghavendra
  • Hi,

    yes, the flow is stuck inside the first call to sl_NetAppXmppRecv.

    As a first step I've placed 2 Breakpoints as in Figure 1.
    The BP at line 792 is reached. Then if I click the resume button, the BP at line 794 is never reached.


    So as a second step I added two additional BPs into sl_NetAppXmppRecv as in Figure 2.


    The BP at line 516 is reached. Then if I click on resume button the BP at line 525 is reached, showing a Status value of 1158, as in Figure 3 (please consider that at this time I'm not sending messages to the CC3200). (I tried with other debug sessions and the Status value was different, e.g. 407, 855..., always in absence of messages - is it a random value?).

    Anyway, then I expect that if I click Resume again the program would go back to the main.c, reaching the BP at line 794, since the sl_Recv (and also the sl_NetAppXmppRecv) in my opinion are completely executed.

    However, clicking on Resume button the program goes to the BP at line 516 in the xmpp.c, then at the next resume it goes at line 525 (with a Status value of -11), then again at line 516, and so on.
    It is like if the content of sl_NetAppXmppRecv function is performed infinite times, so the function never ends.

    P.S. I'd like to specify that also if I send a message to the CC3200, the content of sl_NetAppXmppRecv is repeated and the function never returns.

    Thanks for your help,

    Simone

  • Hi Simone,


    Please enable "Access for less secure apps" settings in gmail account for device.


    Regards,
    Aashish
  • Dear all,

    We have almost tryed everything (including verification of option you suggested above). We tried also with the last sdk & firmware release (including conf file) with both CCS and IAR project (provided by ti).

    Nothing is working. It seems clear to us there are problems in xmpp libraries (provided by ti).

    Could you pls try the example included in the downloadable SDK (last one) and have a look if it works for you?

    We are stuck from 2 weeks...

    If it works for you, could you please send us to a.bartolini2@gmail.com the entire working package/project you are using?(I would expect the one provided by ti).

    Hoping to let it work as soon as possible,

    Thank you,

    Best Regards,

    Alessandro Bartolini

  • Hi Alessandro,


    Can you please change macro "REMOTE_USERID_LEN" value from 50 to 100 and try.


    Regards,
    Aashish
  • Hi Aashish,
    we will try to modify the macro value.

    Anyway I do not understand how this would explain the loop internal to the sl_NetAppXmppRecv function that I have described in my last reply to Raghavendra.
    In fact if REMOTE_USERID_LEN was too small, then the following if:

    if (strlen(pFromPtr)+1 < Jidlen)

    internal to sl_NetAppXmppRecv would fail and the function would return with -2, isn't it?
    Instead the function never returns.


    Regards,
    Simone

  • Hi Simone,

    Can you please point exactly what point it stuck in sl_NetAppXmppRecv(). 

    Simone Riccardi said:
    (I tried with other debug sessions and the Status value was different, e.g. 407, 855..., always in absence of messages - is it a random value?).

    Simone, server keep on sending some data that may have information related to online status of your friends even you are not sending any message to cc3200.

    eg. 

    <presence from="1mpbv2sya4acp3vk26iwaeej42@public.talk.google.com/MessagingAd442a9f5" to="iot.iot.test@gmail.com/work55A8EB92"><show>away</show>

    Simone Riccardi said:
    However, clicking on Resume button the program goes to the BP at line 516 in the xmpp.c, then at the next resume it goes at line 525 (with a Status value of -11)

    -11 means try again. As socket set as non-blocking and if there is no data available sl_recv -11 error code.

    Simone Riccardi said:
    P.S. I'd like to specify that also if I send a message to the CC3200, the content of sl_NetAppXmppRecv is repeated and the function never returns.

    Can you please post content of g_RecvBuf buffer.

    Regards,

    Aashish

  • Hi,
    sl_NetAppXmppRecv() does not get stucked.
    It simply repeats its instructions: once the end of function is reached, it starts again from the beginning and so on.
    So we can say that the main gets stucked at sl_NetAppXmppRecv call, not that the function itself gets stucked.

    About the content of g_RecvBuf buffer, in which point of the function are you interested in? Just after the sl_Recv?

    thanks for your help,
    Simone
  • Hi Aashish,
    we have modified the macro and now the program works!

    thanks for all your support

    best regards,
    Simone
  • Hi Simone,


    We are closing this thread, for follow up queries please open a new thread and add a link to this one for reference.


    Regards,
    Aashish