TWRK64 MQX 4_2 WebServer demo web_hvac_v2 is slower than in MQX 4_1_1 and generates ERR_CONNECTION_TIMEOUT/ERR_CONNECTION RESET (Browser Chrome)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TWRK64 MQX 4_2 WebServer demo web_hvac_v2 is slower than in MQX 4_1_1 and generates ERR_CONNECTION_TIMEOUT/ERR_CONNECTION RESET (Browser Chrome)

Jump to solution
1,127 Views
francescocontin
Contributor II

Hi,

we need to move from MQX 4.1.1 and upgrade to a newer version of MQX:

- to resolve MFS bugs and concurrency (SD-CARD with FTP Server)

- to resolve TCP-IP RTCS socket bugs

- to enhance RTCS FTP and HTTP servers

I'm analying the two solutions:

- move from MQX 4.1.1 to MQX 4.2 (and eventually, in the future, to KSDK)

- move to KSDK 1.2

Results:

A) KSDK 1.2 demo web_hvac Test With IAR 7.40 and Tower K64, default configuration:

- works only with SYS_LIGHTWEIGHT_PROT to 1

- the lwip WebServer is "slower" than in MQX 4.1.1 with cgi

B)MQX 4.2 demo web_hvac_v2 Test With IAR 7.40 and Tower K64, default configuration:

#define DEMOCFG_ENABLE_SERIAL_SHELL    1   /* enable shell task for serial console */

#define DEMOCFG_ENABLE_SWITCH_TASK     0   /* enable button sensing task (otherwise keys are polled) */

#define DEMOCFG_ENABLE_AUTO_LOGGING    0   /* enable logging to serial console (or USB drive) */

#define DEMOCFG_ENABLE_USB_FILESYSTEM  0   /* enable USB mass storage */

#define DEMOCFG_ENABLE_RTCS            1   /* enable RTCS operation */

#define DEMOCFG_ENABLE_FTP_SERVER      0   /* enable ftp server */

#define DEMOCFG_ENABLE_TELNET_SERVER   0   /* enable telnet server */

#define DEMOCFG_ENABLE_WEBSERVER       1   /* enable web server */

#define DEMOCFG_ENABLE_KLOG            0   /* enable kernel logging */

#define DEMOCFG_USE_POOLS              0   /* enable external memory pools for USB and RTCS */

#define DEMOCFG_USE_WIFI                0  /* USE WIFI Interface */

  - in project usb_v2 usbh_twrk64f120m.bat miss to copy some files (manually added to usb_v2/output...)

  - the HVAC Web Server page generates ERR_CONNECTION_TIMEOUT/ERR_CONNECTION_RESET to Chrome Requests (Page not available/found on Microsoft Explorer)

  - sometimes (after 7 seconds up to 21 seconds) the server responds to all the the pending requests but cgi generates ERR_CONNECTION_TIMEOUT/ERR_CONNECTION_RESET to Chrome requests

Note:

the 4.1.1 demo works well

Question:

  1) Could be a Problem with HTTPSRVCFG_SES_BUFFER_SIZE in MQX 4_2?

  2) it's better to move directly to KSDK and lwip?

 

Regards

Francesco

Labels (1)
Tags (3)
0 Kudos
1 Solution
659 Views
francescocontin
Contributor II

The problem is in TWR-K64 configuration:

J33 jumper must go OFF and J32 jumper must go ON for the correct clock.

somehow the MQX 4.1.1 demo still works with the 50MHz OSC configuration, or the PHY configuration is different in the MQX 4.1.1 BSP.

Now the WebServer demo works correctly.

Thank you

Regards

Francesco Contin

View solution in original post

0 Kudos
4 Replies
659 Views
soledad
NXP Employee
NXP Employee

Hello Francesco,

Time for which HTTP server waits for request is defined by macro HTTPSRVCFG_RECEIVE_TIMEOUT. Its value is by default 50ms. If no request is received in 50ms (return value of read() is 0), session is closed to preserve resources. Please try increasing  value of this macro to at least 10 seconds (#define HTTPSRVCFG_RECEIVE_TIMEOUT 10000 in your user_config.h). You might also run into such problems on slow networks. If that is the case, increasing value to something like 250-500ms should resolve your problems. It is also possible to enable HTTP keep-alive to preserve the connection after response is sent. This can be done by defining HTTPSRVCFG_KEEPALIVE_ENABLED as 1. Session lifetime is then controlled by value of HTTPSRVCFG_KEEPALIVE_TO (200ms by default). Macro HTTPSRVCFG_SES_TO (20 seconds by default) sets timeout for sessions which does not use HTTP keep-alive but use i.e CGI.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
659 Views
francescocontin
Contributor II

Could be simply a problem with the TWR-SER board?

The Tower is composed by

  • TWR-K64F120M  boad (default jumper settings)
  • TWR-SER (700-26004 REV.E, SCH-26004 REV.G)

with the default jumper settings in TWR-SER the PHY doesn't works.

changes:

  • J2 setting 3-4 (50MHz)
  • J3 setting 2-3
  • J12 setting 9-10

Regards

Francesco Contin

0 Kudos
660 Views
francescocontin
Contributor II

The problem is in TWR-K64 configuration:

J33 jumper must go OFF and J32 jumper must go ON for the correct clock.

somehow the MQX 4.1.1 demo still works with the 50MHz OSC configuration, or the PHY configuration is different in the MQX 4.1.1 BSP.

Now the WebServer demo works correctly.

Thank you

Regards

Francesco Contin

0 Kudos
659 Views
francescocontin
Contributor II

Hi Soledad,

thank you for your answer, but even with a HTTPSRVCFG_RECEIVE_TIMEOUT of 10 seconds the problem persists.

chrome_grab_1.png

this is a grab of the chrome page.

the http session task is halted waiting for receiving data packets and the request for the javascript file is failed.

Could be a problem in the maximum session allowed parameter HTTPSRVCFG_DEF_SES_CNT == 2?

The issue is so "evident" that i think it's only a configuration problem.

Regards

Francesco Contin

0 Kudos