Hello,
I have an order in process for Embedded Studio Pro so I don't have paid support quite yet but will soon. In the meantime, I have a question concerning file uploads with the emWeb Server. It seems that the WebS InBuffer might need to be as large as the file that I am uploading? When I upload about a 3KByte file I get the log below that the InBuffer is too small for POST data. When I upload a 10 byte text file it appears to work better with no InBuffer warning but the file is not actually saved to the file system when checked running the FTP Server separately (probably a different issue?). What would be the proper way to upload files up to a maximum of 1 Megabyte using emWeb? The goal would be for customers to upload new firmware files. I thought maybe using the IP_RxTask might help but I still get the error. Best Regards.
4:807 MainTask - INIT: embOS/IP init started. Version 3.31a
4:807 MainTask - *********************************************************************
4:807 MainTask - * embOS/IP Configuration *
4:807 MainTask - *********************************************************************
4:807 MainTask - * IP_DEBUG: 2
4:807 MainTask - * Memory added: 24576 bytes
4:808 MainTask - * Buffer configuration:
4:808 MainTask - * 12 buffers of 256 bytes
4:808 MainTask - * 6 buffers of 1516 bytes
4:808 MainTask - * TCP Tx/Rx window size per socket: 4380/4380 bytes
4:808 MainTask - * Number of interfaces added: 1
4:808 MainTask - * Interface #0 configuration:
4:808 MainTask - * Type: ETH
4:808 MainTask - * MTU: 1500
4:808 MainTask - * HW addr.: 00:22:C7:FF:FF:FF
4:809 MainTask - * IPv4 static addr.: 10.135.246.111
4:809 MainTask - *********************************************************************
4:829 MainTask - INIT: Link is down
4:829 MainTask - DRIVER: Found PHY with Id 0x2000 at addr 0x0
4:830 MainTask - INIT: Init completed
4:830 IP_Task - INIT: IP_Task started
4:830 IP_RxTask - INIT: IP_RxTask started
6:829 IP_Task - LINK: Link state changed: Full duplex, 100MHz
6:830 PTPClient - Correction applied onto state "uncalibrated": 1551196467s, 917091479ns
6:830 PTPClient - Not synced
6:831 IP_WebServer - WEBS: Using a memory pool of 10996 bytes for 2 connections.
7:207 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0222:C7FF:FEFF:FFFF added to IFace: 0
11:830 PTPClient - Not synced
16:830 PTPClient - Not synced
21:830 PTPClient - Not synced
26:830 PTPClient - Not synced
28:900 Webserver Child - WebS: Get /Upload.cgi
28:901 Webserver Child - *** Warning *** WebS: InBuffer too small for POST data.
//
// Webserver buffer sizes from WEBS_Conf.h
//
#define WEBS_IN_BUFFER_SIZE 2920 // Buffer size should be at least 256 bytes.
#define WEBS_OUT_BUFFER_SIZE 1460 // Buffer size can be decreased. To small buffers will result in a
// lack of performance and decreases the quality of service.
// Default is max. MTU(1500 bytes) - best case IPv4/TCP headers (40 bytes).
#define WEBS_PARA_BUFFER_SIZE 512 // Required for dynamic content parameter handling.
#define WEBS_FILENAME_BUFFER_SIZE 64
//
// Maximum allowed root path length of the Web server
// in multiples of a CPU native unit (typically int).
// If the root path of the Web server is the root of
// your media you can comment out this define or set
// it to zero.
// Example:
// For the root path "/httpdocs" the define needs
// to be set to at least 9 . As this is not a multiple
// of an int, set it to 12.
//
#define WEBS_MAX_ROOT_PATH_LEN 24 /*12*/
//Defines from TASK Start Code
//
// Web server and IP stack
//
#define MAX_CONNECTIONS 2
#define BACK_LOG 20
#define MAX_CONNECTION_INFO 10
#define IDLE_TIMEOUT 1000 // Timeout [ms] after which the connection will be closed if no new data is received.
#define SERVER_PORT 80
#define CHILD_ALLOC_SIZE 5498 // NumBytes required from memory pool for one connection. Should be fine tuned according
// to your configuration using IP_WEBS_CountRequiredMem() .
#ifndef STACK_SIZE_SERVER
#define STACK_SIZE_SERVER (2200 + APP_TASK_STACK_OVERHEAD)
#endif
#ifndef TASK_STACK_SIZE_WEBSERVER_TASK
#define TASK_STACK_SIZE_WEBSERVER_TASK (2048 + APP_TASK_STACK_OVERHEAD)
#endif
I have an order in process for Embedded Studio Pro so I don't have paid support quite yet but will soon. In the meantime, I have a question concerning file uploads with the emWeb Server. It seems that the WebS InBuffer might need to be as large as the file that I am uploading? When I upload about a 3KByte file I get the log below that the InBuffer is too small for POST data. When I upload a 10 byte text file it appears to work better with no InBuffer warning but the file is not actually saved to the file system when checked running the FTP Server separately (probably a different issue?). What would be the proper way to upload files up to a maximum of 1 Megabyte using emWeb? The goal would be for customers to upload new firmware files. I thought maybe using the IP_RxTask might help but I still get the error. Best Regards.
4:807 MainTask - INIT: embOS/IP init started. Version 3.31a
4:807 MainTask - *********************************************************************
4:807 MainTask - * embOS/IP Configuration *
4:807 MainTask - *********************************************************************
4:807 MainTask - * IP_DEBUG: 2
4:807 MainTask - * Memory added: 24576 bytes
4:808 MainTask - * Buffer configuration:
4:808 MainTask - * 12 buffers of 256 bytes
4:808 MainTask - * 6 buffers of 1516 bytes
4:808 MainTask - * TCP Tx/Rx window size per socket: 4380/4380 bytes
4:808 MainTask - * Number of interfaces added: 1
4:808 MainTask - * Interface #0 configuration:
4:808 MainTask - * Type: ETH
4:808 MainTask - * MTU: 1500
4:808 MainTask - * HW addr.: 00:22:C7:FF:FF:FF
4:809 MainTask - * IPv4 static addr.: 10.135.246.111
4:809 MainTask - *********************************************************************
4:829 MainTask - INIT: Link is down
4:829 MainTask - DRIVER: Found PHY with Id 0x2000 at addr 0x0
4:830 MainTask - INIT: Init completed
4:830 IP_Task - INIT: IP_Task started
4:830 IP_RxTask - INIT: IP_RxTask started
6:829 IP_Task - LINK: Link state changed: Full duplex, 100MHz
6:830 PTPClient - Correction applied onto state "uncalibrated": 1551196467s, 917091479ns
6:830 PTPClient - Not synced
6:831 IP_WebServer - WEBS: Using a memory pool of 10996 bytes for 2 connections.
7:207 IP_Task - NDP: Link-local IPv6 addr.: FE80:0000:0000:0000:0222:C7FF:FEFF:FFFF added to IFace: 0
11:830 PTPClient - Not synced
16:830 PTPClient - Not synced
21:830 PTPClient - Not synced
26:830 PTPClient - Not synced
28:900 Webserver Child - WebS: Get /Upload.cgi
28:901 Webserver Child - *** Warning *** WebS: InBuffer too small for POST data.
//
// Webserver buffer sizes from WEBS_Conf.h
//
#define WEBS_IN_BUFFER_SIZE 2920 // Buffer size should be at least 256 bytes.
#define WEBS_OUT_BUFFER_SIZE 1460 // Buffer size can be decreased. To small buffers will result in a
// lack of performance and decreases the quality of service.
// Default is max. MTU(1500 bytes) - best case IPv4/TCP headers (40 bytes).
#define WEBS_PARA_BUFFER_SIZE 512 // Required for dynamic content parameter handling.
#define WEBS_FILENAME_BUFFER_SIZE 64
//
// Maximum allowed root path length of the Web server
// in multiples of a CPU native unit (typically int).
// If the root path of the Web server is the root of
// your media you can comment out this define or set
// it to zero.
// Example:
// For the root path "/httpdocs" the define needs
// to be set to at least 9 . As this is not a multiple
// of an int, set it to 12.
//
#define WEBS_MAX_ROOT_PATH_LEN 24 /*12*/
//Defines from TASK Start Code
//
// Web server and IP stack
//
#define MAX_CONNECTIONS 2
#define BACK_LOG 20
#define MAX_CONNECTION_INFO 10
#define IDLE_TIMEOUT 1000 // Timeout [ms] after which the connection will be closed if no new data is received.
#define SERVER_PORT 80
#define CHILD_ALLOC_SIZE 5498 // NumBytes required from memory pool for one connection. Should be fine tuned according
// to your configuration using IP_WEBS_CountRequiredMem() .
#ifndef STACK_SIZE_SERVER
#define STACK_SIZE_SERVER (2200 + APP_TASK_STACK_OVERHEAD)
#endif
#ifndef TASK_STACK_SIZE_WEBSERVER_TASK
#define TASK_STACK_SIZE_WEBSERVER_TASK (2048 + APP_TASK_STACK_OVERHEAD)
#endif