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.

LAUNCHCC3220MODASF: HTTP GET Request Only Successful After MCU Reset

Part Number: LAUNCHCC3220MODASF

Hi there, I have a few questions about the httpget example project. I've only minimally modified the stock code to include my Wi-Fi network credentials and the URI of the server API I'm making a GET request to.

After flashing the program to my Launchpad, the following terminal output is printed. The GET request fails, and no statements saying that a successful connection to my Wi-Fi was made.

However, after resetting the MCU via the reset button, the following terminal output is printed. The MCU successfully connects to my Wi-Fi, and the GET request is successful as well.

1. Why is it that the GET request fails and no Wi-Fi connection appears to be made after flashing the program without resetting? Is this intentional?

2. What additional steps would need to be performed in the code for the GET request and Wi-Fi connection to be successful without needing to reset the MCU?

3. Do HTTP requests have to be made by creating an httpTask thread or can they be performed by a function call from the main thread?

I'm very new to the programming process of the Simple Link devices and have had trouble finding resources to answer these questions. Thank you for any help in advance!

  • Hi,

    The first screen shot indicates that you are set in AP mode.

    This is why you are not connected to the AP as station and thus the HTTP request fails.

    The second screen shot indicates you are set as station, hence, you are able to connect.

    Can you check it?

    Shlomi

  • I figured out the answers to my questions 1 and 2. The httpget example project appears to be intentionally designed to only set the Launchpad to Station mode and connect to the Access Point after pressing the reset button. I've rearranged the code to successfully do this without pressing the reset button. However, my question 3 still stands.

    3. Do HTTP requests have to be made by creating an httpTask thread or can they be performed by a function call from the main thread?

    Thanks again for the help!

  • Hi,

    It is just a matter of better code readability and design.

    You can also call it from main and it should be OK but you just need to make sure you do it after you get an IP address assigned.

    Also, be careful not to call any API from the context of event handler. For example, do not call from SimpleLinkNetAppEventHandler().

    Regards,

    Shlomi