has anyone experienced RTCS_ping wrong timeouts? (MQX 3.8.1)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

has anyone experienced RTCS_ping wrong timeouts? (MQX 3.8.1)

ソリューションへジャンプ
1,888件の閲覧回数
anteantee
Contributor II

while using RTCS_ping function i get wrong return code.

I checked that by putting message to debug port when i get ICMP reply message.

ICMP reply message gets printed as MCU got reply but RTCS_ping function returns timeout...

:smileyconfused:

has anyone experienced this behaviour?

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
1,581件の閲覧回数
anteantee
Contributor II

I've looked in mqx 4.02 source and compare it to 3.8.1

In "rtcs/source/tcpip/tcpip.c" I've noticed how timeouts are differently  handled

I've also updated ping function to version from MQX 4.02

so it solved my problem...

元の投稿で解決策を見る

0 件の賞賛
返信
7 返答(返信)
1,581件の閲覧回数
anteantee
Contributor II

unfortunately i do set ping_timeout every time before calling RTCS_ping

also i'm seting gpio output high at begining of ping function

and low after ping function and measure that time on scope

when i get return 0x1580 from RTCS_ping

and i'm measuring on scope wrong timeout  as if function RTCS_ping immediately exited

0 件の賞賛
返信
1,581件の閲覧回数
David_Wu
Contributor III

I am using MQX 4 and the RTCS_ping returned 0 with ping_timeout changed to 0 on return - sometime I will get 0x1580 back but not very often. I think the problem might be related how it handles the timeout - it seems incorrect.

I did not dive into the code and see how it is implemented - but no surprise it not working correctly.

If you could, try to debug MQX code and help MQX guys. :smileywink:

1,581件の閲覧回数
karelm_
Contributor IV

Hi,

just to clarify things: We changed the way RTCS handles events a little in MQX 4.0.2 (because we similiar bug earlier) and further improvement will be added in MQX 4.1 (to fix another related bug). We also plan to release fix for this bug as separate patch. Thank you for effort you put in analysis of this problem and helping us in improving MQX and RTCS.

Best Regards

Karel

1,581件の閲覧回数
anteantee
Contributor II

i left system working overnight...

total ping call's were about ~47000.

Of that number RTCS_ping  timeout exceeded 200ms about ~4000 times

this is shown in histogram

I'm pinging adresses which i know doesn't exist in network so function should timeout.

so my question is.... why so much non determinism? has anyone experienced similar behaviour?

kJbKSba.png

0 件の賞賛
返信
1,582件の閲覧回数
anteantee
Contributor II

I've looked in mqx 4.02 source and compare it to 3.8.1

In "rtcs/source/tcpip/tcpip.c" I've noticed how timeouts are differently  handled

I've also updated ping function to version from MQX 4.02

so it solved my problem...

0 件の賞賛
返信
1,581件の閲覧回数
David_Wu
Contributor III

seems I know the reason - the ping_timeout needs to be set every time - I do not understand why it requires a pointer and also modify the value. This does not make sense.

    ping_timeout =5000;
   ping_ret = RTCS_ping(IPData.gateway, &ping_timeout, ++pingid);
0 件の賞賛
返信
1,581件の閲覧回数
David_Wu
Contributor III

Well, I do - but not sure it received ICMP reply or not. From the Ethereal capture YES - it should get the reply. Once it got the timeout (return 0x1580 from RTCS_ping) it seems never recover from it.

0 件の賞賛
返信