2023-05-25 06:09 PM
Hi all,
I'm trying to create a simple webpage server on a NUCLEO-H723ZG. I understand some basics, but overall I'm pretty new to all of this. So I'm starting from the LwIP Server Netconn RTOS example. If I load the default example to the board, it works great. But, after trying everything I can think of, and looking all over the internet, I cannot seem to change the homepage to my own static HTML file. I've figured out how to use the MAKEFS scripts and all that, but, assuming it compiles without errors, the default homepage does not change. I've tried different options and saving the fsdata file to different directories, but nothing works.
This is for a proof-of-concept for my company's latest project, and I don't need to be an LwIP expert quite yet (maybe later). So, simple question: starting from the default LwIP Server Netconn RTOS example, and running MAKEFS script on my HTML files, how do I get them into my project so they show up? That's it: just how do I switch to a different homepage?
Thanks!!
Robert
Solved! Go to Solution.
2023-05-25 10:55 PM
After you have created the fsdata file, you have to copy it.
I have to copy it into the project's lwip http folder:
projectname\Middlewares\Third_Party\LwIP\src\apps\http
Important thing is that you don't let CubeIDE compile that file (somehow with right click menu).
I have that html stuff in some other folder, and then use a windows batch file *.bat for renaming and copying it to the project folder:
:: *******************************************************
:: file rename and copy batch
:: *******************************************************
@echo off
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo fsdata file batch copy and rename utility
echo ------------------------------------------------------------------
@echo off
:: ******* get OLD file DATE
for %%a in (fsdata_custom.c) do set FileModDate=%%~ta
set FileModDate=%FileModDate: =_%
set FileModDate=%FileModDate:.=-%
set FileModDate=%FileModDate::=-%
echo FileModDate: %FileModDate%
@echo on
:: ******* rename OLD file
rename fsdata_custom.c fsdata_custom_%FileModDate%.c
:: ******* move OLD file
move fsdata_custom_%FileModDate%.c 0_backup
:: ******* rename NEW file
rename fsdata.c fsdata_custom.c
:: ******* copy NEW file
copy fsdata_custom.c "D:\01 Development\STM32\STM32H723_ETA_Nucleo\Middlewares\Third_Party\LwIP\src\apps\http"
pause
2023-05-25 10:55 PM
After you have created the fsdata file, you have to copy it.
I have to copy it into the project's lwip http folder:
projectname\Middlewares\Third_Party\LwIP\src\apps\http
Important thing is that you don't let CubeIDE compile that file (somehow with right click menu).
I have that html stuff in some other folder, and then use a windows batch file *.bat for renaming and copying it to the project folder:
:: *******************************************************
:: file rename and copy batch
:: *******************************************************
@echo off
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo fsdata file batch copy and rename utility
echo ------------------------------------------------------------------
@echo off
:: ******* get OLD file DATE
for %%a in (fsdata_custom.c) do set FileModDate=%%~ta
set FileModDate=%FileModDate: =_%
set FileModDate=%FileModDate:.=-%
set FileModDate=%FileModDate::=-%
echo FileModDate: %FileModDate%
@echo on
:: ******* rename OLD file
rename fsdata_custom.c fsdata_custom_%FileModDate%.c
:: ******* move OLD file
move fsdata_custom_%FileModDate%.c 0_backup
:: ******* rename NEW file
rename fsdata.c fsdata_custom.c
:: ******* copy NEW file
copy fsdata_custom.c "D:\01 Development\STM32\STM32H723_ETA_Nucleo\Middlewares\Third_Party\LwIP\src\apps\http"
pause
2023-05-26 02:46 PM
Thank you, LCE! I was finally able to get it! Greatly appreciated.
For the record, here's what I did (slightly modified from the above answer):