Hi, I've spotted a strange problem with the MQX4.1 web server. After a few hours of working it becomes unresponsive and I can't log into.
It's very random behavior and sometimes server dies after few days, sometimes more frequent.
Restarting the HTTPSRV by using HTTSRV_release() and HTTPSRV_init() is not solving the problem.
I've noticed that every incoming TCP packet has been dropped because the CONN_COUNT>=RTCSCFG_TCP_MAX_CONNECTIONS.
Because of the memory usage the RTCSCFG_TCP_MAX_CONNECTIONS = 2 in my case.
I don't understand why the CONN_COUNT =2. It looks like the RTCS is not releasing the connections properly.
After some tests I can say that the crash happens whenever two clients trying to connect to the server at the same time.
There are few similar problems posted by forum's members but non of the proposed solutions works in this case.
(My setup: MQX4.1, BSP: twrmcf52259).
Any help will be highly appreciated
Regards,
Message was edited by: Tomasz Kulinski
解決済! 解決策の投稿を見る。
Unfortunately it is hard to say what could be reason for that behavior. Since using HTTSRV_release() and HTTPSRV_init() is not solving the problem, problem will be probably somewhere deeper and limited number of TCP connections is probably just side effect.
Because it's very random behavior it could happened that we lost some connection end packet…
It is also possible that this source of this issue was already fixed.
As first I would like to recommend test it on MQX 4.1.1.
Latest released RTCS could be used from MQX4.1.2 for Vybrid or from KSDK1.1.0.
https://freescale.flexnetoperations.com/control/frse/download?element=6003621
https://freescale.flexnetoperations.com/control/frse/download?element=6011601
Could you please test it with some newer RTCS code?
BTW: There is also MQX 4.1.0.1 patch which contains several important RTCS bug fixes. Did you install it?
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Unfortunately it is hard to say what could be reason for that behavior. Since using HTTSRV_release() and HTTPSRV_init() is not solving the problem, problem will be probably somewhere deeper and limited number of TCP connections is probably just side effect.
Because it's very random behavior it could happened that we lost some connection end packet…
It is also possible that this source of this issue was already fixed.
As first I would like to recommend test it on MQX 4.1.1.
Latest released RTCS could be used from MQX4.1.2 for Vybrid or from KSDK1.1.0.
https://freescale.flexnetoperations.com/control/frse/download?element=6003621
https://freescale.flexnetoperations.com/control/frse/download?element=6011601
Could you please test it with some newer RTCS code?
BTW: There is also MQX 4.1.0.1 patch which contains several important RTCS bug fixes. Did you install it?
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Radek,
Your solution works! I have tested the MQX 4.1.1 + RTCS 4.1.2 for Vybrid and the web server is rock solid now. This is the http server I've been waiting for a long time (since MQX3.6) :smileyhappy:. Good job.
Unfortunately, the size of the new RTCS 4.1.2 is bigger than 4.1.1 and I can't use it because my code exceeds the internal memory size for my micro now .
Is there any way to shrink the new RTCS by removing some components i.e. websockets?
Best regards,
I am glad that it works.
By internal memory you mean Flash or RAM?
If you will comment out websocket code, you can save some flash.
If you need save some RAM, you can tune stacksizes for your case (MCU and toolchain). You can also decrease session buffer size and socket buffer size, but it influences throughput – it will be slower.
You can disable components/protocols which you don’t use by macros. E.g ICMP, DHCP, UDP,…
Note: DHCP depends on UDP.