2023-07-09 12:56 AM
Hi Folks
I have few question about HTTP server if someone here in the started playing with it.
As i have plenty of flash on the MCU i opted to store a simple html page directly on the mcu flash memory (like done with mkfsdata.exe on LWIP).
Streaming out the payload is not a problem however seems i can't generate the correct http headers.
For streaming out data i do :
if ( strcmp( resource , "/jquery_3.6.0.min.js") == 0 )
{
size_t i = 0;
size_t size_html = sizeof(data__jquery_3_6_0_min_js);
size_t send_size = 0 ;
while ( size_html != 0)
{
if ( size_html < 512 )
send_size = size_html;
else
send_size = 512;
nx_web_http_server_callback_data_send(server_ptr, (void*)&data__jquery_3_6_0_min_js[i], send_size );
size_html -= send_size;
i+=send_size;
}
return(NX_WEB_HTTP_CALLBACK_COMPLETED);
I tried the approach of sending the payload by calling the _nxe_packet_data_append and then the nx_web_http_server_callback_packet_send but as the file is about 30KB it fails in allocating the nx_packet in the pool
My question then are:
I do see in CubeMX examples that a web_server.bin file need to be loaded at a certain address, but nothing explained about how to create this web_server.bin file.
Thanks in advance
Davide
Solved! Go to Solution.
2023-07-10 07:15 AM
Hi @Davide Dalfra,
Unlike LwIP, The NexDuo Web server requires a FileX file system to correctly read data and stream them.
If you need more details about how to create the web_server.bin file could you please contact me via private message.
regards
Haithem.
2023-07-10 07:15 AM
Hi @Davide Dalfra,
Unlike LwIP, The NexDuo Web server requires a FileX file system to correctly read data and stream them.
If you need more details about how to create the web_server.bin file could you please contact me via private message.
regards
Haithem.
2023-07-11 05:01 AM
Hi,
Done, i just sent you a PM.
Thanks in advance
Davide