FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [January 2017 Threads] freeRTOS 9.0+ TCP/IP keepalivePosted by liuzs on January 22, 2017 In my TCP/IP project , I can not modify keepalive times&period of a socket by modify ipconfigTCPKEEPALIVE_INTERVAL. need help! thanks!
freeRTOS 9.0+ TCP/IP keepalivePosted by rtel on January 22, 2017 We would like to help, but unfortunately your post doesn't say what the
problem is. For example, can not modify could mean keepalive isn't
working at all, keepalive is working but you can't change the period,
you can change the period but the period is not accurate.......or simply
that the file is read only so you can't save changes. Please help us
help you!
freeRTOS 9.0+ TCP/IP keepalivePosted by liuzs on January 22, 2017 thanks for your answers and sorry for my question. My keepalive is working (in socket client and server ), the period is about 20s , but I modify ipconfigTCPKEEPALIVEINTERVAL to 2 or 3 or 8 or 20 or ... ,the period is about 20s always. In LWIP ,I can change it by modify some parameters. And the other parameter "ipconfigTCPHANGPROTECTIONTIME" is 10 now , I modify it ,but no use for anything. (sorry for my english)
freeRTOS 9.0+ TCP/IP keepalivePosted by heinbali01 on January 22, 2017 Hi,
It sounds like a problem with compiling your project.
In the demo projects, ipconfigTCP_KEEP_ALIVE_INTERVAL is defined as 20 seconds. When you observe that the actual keep alive messages are sent every 20 seconds, it looks like FreeRTOS_TCP_IP.c doesn't see your new value.
You should make the setting in your FreeRTOSIPConfig.h . Make sure that the include path for the compiler points to the proper FreeRTOSIPConfig.h .
Advice: never put private files into the public include directories, such as FreeRTOS-Plus-TCP/include or FreeRTOS/source/include .
You could write the following in your FreeRTOSIPConfig.h :
~~~~
#warning setting keep-alive
#define ipconfigTCPKEEPALIVE_INTERVAL 120
~~~~
and make sure the the compilere sees the #warning :-)
freeRTOS 9.0+ TCP/IP keepalivePosted by rtel on January 23, 2017 Which platform are you using? In some Xilinx SDK versions changing a
header file necessitates a complete clean and rebuild for the new value
to get used.
freeRTOS 9.0+ TCP/IP keepalivePosted by liuzs on January 23, 2017 hi,
My platform is stm32f107RC + keil mdk 5.22 and compiler is v5.06(update 4) .
I do your test,and see #warning .... so ....
I set ipconfigTCPKEEPALIVEINTERVAL =40 , keep alive messages is 40s
I set ipconfigTCPKEEPALIVEINTERVAL =30 , keep alive messages is 40s
I set ipconfigTCPKEEPALIVEINTERVAL =20 , keep alive messages is 20s
I set ipconfigTCPKEEPALIVEINTERVAL =15 , keep alive messages is 20s
I set ipconfigTCPKEEPALIVEINTERVAL <10 , keep alive messages is 20s
I set ipconfigTCPKEEPALIVEINTERVAL =60 , keep alive messages is 60s
I set ipconfigTCPKEEPALIVE_INTERVAL =50 , keep alive messages is 60s
and the period of keepalive is variable , about 2s~10s
......
freeRTOS 9.0+ TCP/IP keepalivePosted by heinbali01 on January 23, 2017 Good, so changing the value of ipconfigTCP_KEEP_ALIVE_INTERVAL does make a difference.
What you observe is that the actual times are being rounded up to a multiple of 20 seconds.
That is caused by the function prvTCPNextTimeout() , which let's the socket 'sleep' for 20 seconds when it is idle.
If you want, I will prepare a patch in which this sleeping time will be configurable.
Regards.
freeRTOS 9.0+ TCP/IP keepalivePosted by liuzs on January 23, 2017 Thanks. Could you do a new version to improve and perfect it and Release new version to all ? I think this function is very important for checking socket ok or not.
I hope get your patch at first :)
My e-mail: liuzhisong@139.com
And this TCP/IP lib is better than LWIP. Thanks for your work!
freeRTOS 9.0+ TCP/IP keepalivePosted by heinbali01 on January 23, 2017 Normally I would set the keep-alive period ìpconfigTCP_KEEP_ALIVE_INTERVAL at least 60 seconds. Only when a keep-alive message is not responded to (and ucKeepRepCount increases), the intervals will be much shorter. After three times now answer, the socket will be forcefully closed.
I have sent you an email with patched source code. If you test it we can make it an official change.
Note that for an embedded TCP application, the keep-alive messages are essential. It avoids that sockets stack in a connected state for hours, thus occupying valuable resources.
The keep-alive messages do not always work, some routers might refuse to pass them through.
Thanks, Hein
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|