Adding Custom Webpages to the Firmware Image¶
The SDK is able to embed files in the final .rom image so that the files are available to be served by the webserver. This can be done without the additional step of manually installing the files in the filesystem.
To add custom webpages to the firmware image:
- Create a directory in your module root directory named http/
(i.e. <sdk base>/custom/module/<module name>/http/). - Place your files in the folder you created.
- In the bom/ directory, create or copy from the custom_data example module the file named binary_embedded.make.
- Edit that file to add each file that you would like to embed.
You can also use the preproc_embedded.make file to add files that will be run through the compiler's preprocessor and the gzip_embedded.make file to add files that will be compressed prior to be being installed to save flash space.
After the firmware is installed on the gateway, the files will be served by the web server at the following URI:
http://<address of device>/embedded/<module name>/http/<file name>
For example, if the device's IP is 192.168.0.5, the module name is myModule, and the file is data.html, it will be accessible at:
http://192.168.0.5/embedded/myModule/http/data.html
Overriding Built-in Files¶
If you would like to override any of the built-in files that are overridable (check the OEM Branding and Customization chapter of the User Guide for which files can be overridden), they must be placed in directory http/web_manager/.
For example, to permanently change the page shown when the web server is accessed from the default Lantronix page to your own, create the following file:
<sdk base>/custom/module/<module name>/http/web_manager/index.html
Any links to load other files in your index.html (such as Javascript or CSS files) should reference the full path of the installed files, e.g. /embedded/<module name>/http/<file name>.