has anyone experienced RTCS_ping wrong timeouts? (MQX 3.8.1)

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

has anyone experienced RTCS_ping wrong timeouts? (MQX 3.8.1)

Jump to solution
1,409 Views
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?

Labels (1)
Tags (2)
0 Kudos
1 Solution
1,102 Views
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...

View solution in original post

0 Kudos
7 Replies
1,102 Views
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 Kudos
1,102 Views
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,102 Views
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,102 Views
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 Kudos
1,103 Views
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 Kudos
1,102 Views
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 Kudos
1,102 Views
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 Kudos