There seems to be some confusion about the “Include HTTP NET Custom Template” option in the HTTPNET Server. I could find no description in the Harmony documentation for this option so the only information I know of is what I have observed on my own and what people have posted on this forum.
SAM E70 Xplained Ultra Kit
Windows 10 PC
MPLAB X v5.40
On a PC, if
there is no web_pages directory in the project src-directory, when you run MHC/Generate, MHC copies the web_pages directory and its contents from the net repo to the project src-directory.
On a MAC, if
there is no web_pages directory in the project src-directory, when you run MHC/Generate, MHC copies a tree structure into the project src-directory (web_pages/Applications/microchip/harmony/v3/net/web_pages) and the contents of the final web_pages directory in that tree are the files from the net repo. This appears (to me) to be an error.
When the web_pages directory does exist in the src-directory, then MHC/Generate copies the mpfs_net_img.c file from the web_pages directory to the src-directory of the project (whether or not the option is checked). From what I can determine, it does NOT run the mpfs_net.jar utility program because all the necessary files are already in the net repo and are simply copied to the project src-directory.
Note: these actions with the web_pages directory occur even when the Demo option is unchecked.
My recommendations to Microchip for the HTTP NET custom template option:
- Change the title of the option “Include HTTP NET Custom Template” to "Microchip Web Demo" (see @floatingpoint’s post above which makes it clear that the option is only to include and process the Microchip Web Demo.
- If the "Microchip Web Demo" option is unchecked, MHC should do nothing. Do not copy the web_pages directory or the mpfs_net_img.c file to the project src-directory.
- Fix the documentation to describe how this option works and also how to add custom web pages using the unchecked option.
- Fix the MAC version of MHC to copy the web_pages directory exactly as it occurs in the repo file (the same way the PC version does it).
Until changes are made to the HTTP NET custom template option, do not touch the web_pages directory or any of its contents because they get refreshed from the net repo tcpip/config/custom_app/ ftl and pyton files (even if the option is not checked!).
If you want to add custom web pages to a project, do not use the web_pages directory (leave it alone). Create a folder in the src-directory and fill it with your custom web pages. For example, create a folder named my_pages and fill it with your own html files. Create a mypages.c file that processes your web pages. [Use the template file for the Microchip Demo as a guide for what needs to be in that file.] Now run the mpfs_net.jar program to create a mypages_img.c file with the my_pages as the source directory and the output going to the project src-directory. Finally, exclude the mpfs_img.c file from the project and then include the mypages_img.c file.