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.

CC3135: HTTP POST request doesn't hit SimpleLinkNetAppRequestEventHandler

Part Number: CC3135MOD
Other Parts Discussed in Thread: CC3135, CC3220SF

I am using STM32 interfaced with TI CC3135 module for my application. I have ported the simplelink host driver to STM32 with FreeRTOS using the Host Driver Porting Guide in the document SWRU455M .

I have mapped all the asynchronous event handlers in the user.h file.  The slcb_NetAppRequestHdlr is mapped to SimpleLinkNetAppRequestEventHandler.

I am using the latest SDK simplelink_sdk_wifi_plugin_4_20_00_10.

For provisioning, I start the NWP in AP mode and also start the internal HTTP server. I need to store the IP address of my server and so send a HTTP POST request with a custom token for it. I expect the SimpleLinkNetAppRequestEventHandler function to get called from which I can parse the required data but it doesnot happen. I am unable to trace the request in any of the event handlers.

All other events such as WLAN events, NETAPP events (for IP acquisition) work fine except for the NetAppRequest event.

Could you please guide me on how to solve this?

  • It can be the HTTP Server configuration.

    Please refer to "ConfigureHttpServer" in the Local OTA as an example (in general - i would use the local OTA or out of the box examples as reference to using the internal HTTP server and the SimpleLinkNetAppRequestEventHandler ).

    Once the HTTP server is configured correctly (secure or not - i suggest starting with non-secure connection first) then if both the HTTP client and the SimpleLink are on the same network (connected to the same AP, share the same subnet) and the port in the correct - this should just work. 

    Br,

    Kobi

  • Hi Kobi,

    Thanks but I am able to access the index.html webpage and also add a profile correctly with my HTTP Client.

    I do a Sl_NetAppStop(SL_NETAPP_HTTP_SERVER_ID) and Sl_NetAppStart(SL_NETAPP_HTTP_SERVER_ID) in order to start the web server. The default port number is 80.

    I dont think there is an issue with the Server configuration. What else do you think could possibly go wrong here?

    Regards,

    SN

  • Hi SN,

    Kobi is out of the office today, but will be able to follow-up again on this issue at the beginning of next week.

    Thank you,

    Ben M

  • If you are able to access the ROM/flash pages, then probably the request itself has something wrong.

    You mentioned you are using POST. Did you also try the GET request (with an "unreserved" resource)?

    Again, my recommendation is to start with local OTA that supports the GET and POST requests through the SimpleLinkNetAppRequestEventHandler. There is no special configuration to enable the the callback.

    You can just add the OTA.html from the localOta example to your flash. This page issues the POST when uploading the image.

    Then use a browser to open the ota.html (<device-name-or-ip>/ota.html).

    It also issue several GET requests to learn the device status. Both POST and GET requests should trigger the callback.

     

  • Hi Kobi,

    I can confirm that the GET request with an unreserved resource doesn't work too. I am sure of the HTTP request because it works fine in my CC3220SF setup.

    Unfortunately I haven't had the chance to flash the OTA.html and check yet. I will do it and update the findings here.

    Thanks,

    SN

  • please refer to the ConfigureHttpServer in the localOta (does the localOTA works for you?)

    There is no real configuration for the host callback (slcb_NetAppRequestHdlr needs to be defined as your SimpleLinkNetAppRequestEventHandler callback when you campile the SimpleLink.a) - if the rom/flash pages are working than the host callback will get invoked anytime the resource is unknown to the NWP.