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.

CC3220SF-LAUNCHXL: Send data from local database to CC3220SF

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF

Hi, support team

My customer has the questions as follow:

I was able to send data from CC3220SF-LAUNCHXL and store it to a local database via HTTP GET example project.
However, I don't know how to do data transmission in vice-versa.
Is it possible to send data coming from a local database or cloud database to CC3220SF-LAUNCHXL device?
If yes, can you please provide or suggest methods on how to do it?

Thanks so much.

Best regards,
Yuki

  • Hi Yuki,

    In the httpget example, the CC32xx connects to a server and performs a GET request, which retrieves information from the server. To send data to the server, the user can use a HTTP POST request.

    The HTTP Client library documentation can be found in docs/ns/NS_API_Reference.html

    Best regards,

    Sarah

  • Thank you for informing me.

    However, what I want to know is how can I send the data coming from the local database going to the CC3220SF device. Like, I want to send a value of 98 from local database's table and send it back to the CC3220SF device via HTTP.

    Since mentioned the HTTP POST method when sending data to the local server, can you tell me how to modify the httpget example to perform POST method instead?

  • Hi Yuki,

    The demo is the same for POST, except use the HTTP_METHOD_POST method in HTTPClient_sendRequest() instead of HTTP_METHOD_GET. See the documentation in the folder listed above.

    Best regards,

    Sarah

  • Thank you for responding with an answer for my second question.
    However, my first question wasn't answered yet.
    How can I send the data coming from the local database going to the CC3220SF device.
    Like, I want to send a value of 98 from local database's table and send it back to the CC3220SF device via HTTP.

  • Hi,

    There is multiple ways how this can be done. At first stage you need to determine which side will act as server and which side will be client. This decision is important from reason that client side opens TCP communication and this is generally not issue when you sending data between subnets. But server side need to be properly configured network infrastructure (e.g. port forwarding on NAT). If both sides are at same subnet, you don't need to deal with network infrastructure configuration.

    Lets say, that CC3220 will be a http client. You have options how to bidirectionally exchange data:

    • use http GET
      • CC3220 will send data via URI - ?par1=1&par2=2 or http header
      • CC3220 will read data from server response to GET
    • use http POST
      • CC3220 will send data via POST data or http header
      • CC3220 will read data from server response to POST

    There is additional way like a websockets if you need real-time communication. But usage of websockets is out of scope this discussion.

    btw ... I am pretty sure that Sarah answered your first question as well. I think you not understand properly how http communication works. You should not forgot, that server response to GET or POST contains data...

    Jan