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.
Tool/software: Code Composer Studio
Dear Sir or Madam,
I have made the enet_lwip example project run normally as following screenshot from PC.
But where is the data "101" from, I guess it is from the httpd_init() function as follows,
httpd_init(void)
{
struct altcp_pcb *pcb;
#if HTTPD_USE_MEM_POOL
LWIP_MEMPOOL_INIT(HTTPD_STATE);
#if LWIP_HTTPD_SSI
LWIP_MEMPOOL_INIT(HTTPD_SSI_STATE);
#endif
#endif
LWIP_DEBUGF(HTTPD_DEBUG, ("httpd_init\n"));
/* LWIP_ASSERT_CORE_LOCKED(); is checked by tcp_new() */
pcb = altcp_tcp_new_ip_type(IPADDR_TYPE_ANY);
LWIP_ASSERT("httpd_init: tcp_new failed", pcb != NULL);
httpd_init_pcb(pcb, HTTPD_SERVER_PORT);
}
I would like to work on this example project to implement data transmit and receive between PC and F28388.
And I guess there is supposed to be a txBuffer or rxBuffer function to transmit or receive the data.
But I can not find any clues in the httpd_init() function.
Could you please give some clues?
Thanks a lot!
zhou ping
Hi Ping,
In order to have your custom html webserver page, you would have to update the fsdata.c. Please go through the following e2e for more information https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/952362 .
Thanks,
Yashwant
Dear Yashwant,
Actually I am totally new with Perl. Is it OK for me to start from scratch to update the fsdata.c file?
My question is that how is the fsdata.c file connected with the httpd_init() function?
I really can not find the function call relation.
Actually I have installed Strawberry Perl as follows,
This is perl 5, version 32, subversion 0 (v5.32.0) built for MSWin32-x64-multi-thread
Is there any instruction on how to update the fsdata.c file?
Thanks a lot!
zhou ping
Hi,
Perl here is just a tool which is being used to convert the webserver pages to C arrays. You can just use it as a black box.
Instructions on updating the fsdata.c:
1. Design your own webserver pages and store them in a folder under {LWIP_DIR}/src/apps/http/fs.
2. As the script uses unix system commands like find, cp open a unix shell like git bash ternminal or mingw if you are on windows. Go to the directory lwip2.1.2\src\apps\http\fs. Run ./makefsdata fs to process the files in sub directory fs.
3. Program which will generate "fsdata.c" file in the same directory which has all the files converted and stored as C arrays.
4. Copy the contents of this file "fsdata.c" into the {LWIP_DIR}/src/apps/http/fsdata.c file. This file is included in this enet_lwip project and hence the webserver will get updated in the device and query to the device IP address in the network will show the updated webpages.
Regarding how the fsdata.c file is connected with the project:
Other than enet_lwip.c there are few files linked in the lwip project. In them you can find fs.c file which has a line "#include HTTPD_FSDATA_FILE" If you click on the macro definition of HTTPD_FSDATA_FILE you can see it is fsdata.c.
The variable that keeps getting updated on click in the red box is "unsigned int httpHit" in the same file fs.c which is read from webserver page with element id "/param".
Include links : #include "lwip/apps/httpd.h" -> #include "lwip/apps/fs.h"(in httpd.c) -> #include HTTPD_FSDATA_FILE (in fs.c)
Thanks,
Yashwant
For additional details on lwIP, refer to the lwIP web page at:
savannah.nongnu.org/.../