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.

TMS320F28388D: TMS320F28388D communication between Cortex M4 and web portal by enet lwip

Part Number: TMS320F28388D


Hello,

I am trying to post the data from cortex M4 processor to web portal by using enet lwip. Using CGI handlers, I can send get request from portal. But, I would like to send data from M4 to portal using POST request? Can you please tell me how the communication between portal and M4 works?

Thanks,

Khushali Mehta.

  • Hi Khushali,

    The enet lwip Webserver example does not use CGI that is used to create dynamic pages. 

    In the current application, the web client on browser( index.html and javascript.js in libraries\communications\Ethernet\third_party\lwip\lwip-2.1.2\src\apps\http\fs\fs)

    sends HTTP Get request which is handled in libraries\communications\Ethernet\third_party\lwip\lwip-2.1.2\src\apps\http\fs.c  (fs_open function) where it parses the command and sends the reply accordingly.

    Hope it helps.

    Regards,

    Sudharsanan

  • Hi Sudharsan,

    If I am using SSI tags, then how can exchange the data between enet lwip and browser?

    Thanks,

    Khushali Mehta.

  • Hi Khushali,

    I haven't explored much on SSI related flow with HTML.But you will have to modify the enet_lwip accordingly for your needs.

    Regards,

    Sudharsan 

  • Hi Khushali, 

    The flow with CGI/SSI handling is a little subtle as compared to the simple url based interaction with the webserver. A non-exhaustive set (not list) of pointers could be:

    1. Create ".shtml/.shtm/.ssi/" files with SSI tags. The idea is not to rely on the javascript in the browser to generate appropriate requests. Instead, these tags and their values as returned by the webpage are processed by the webserver (F2838x) and corresponding actions are performed. 

    2. Make sure the lwIP is informed that SSI/CGI handling is enabled by setting appropriate flags. You could find more information about this at the start of the "httpd.c" file in the "third_party/lwip/lwip-2.1.2/src/apps/http" directory. 

    3. Write appropriate handler functions that are called when a particular tag is encountered while the web server processes the requested data file. Pointers to these functions must be registered with the lwIP webserver.

    4. These might require you to make changes to the filesystem (webserver pages), your application files (enet_lwip.c) and also the http webserver(httpd.c, lwipopts.c and other relevant files). 

    If you wish to explore more about the SSI/CGI handling for your project, I'd like to point you to a similar project for reference which is present in TivaWare ("enet_io" for a device named "dk-tm4c129x").

    Regards,

    Sudhakar