I have a Q2686H working on Open At OS v4.21.01; firmware version 663.
I have implemented a timer that sends a PING packet via GPRS each 2 minutes (with WIP plug in v3.00.09).
It works fine 5 or 6 iterations, but after it, starts to fail. Returns WIP_CEV_ERROR, but without any error describing what happened(ev->content.error.errnum is 0).
Does anybody have problems with PING? Is it working fine (stable) with WIP?
Have you set up wip traces? (cf. WIP_NET_OPT_DEBUG_PORT in wip_netInitOpts(), or simply look at samples’ default settings in appli.c)? What do these traces say?
I hadn’t set up WIP traces. I did it, and the result is: ERRLOG ch_ping.c:191: Can’t allocate buffer for PING send
Now, my question is: Can I resolve it with PING options or with wip_netInitOpts()? I don’t change default buffer value, and I am sending 4 pings each time: ping_channel = wip_pingCreateOpts (gServerConf.server_ip, gprsPingHandler, NULL, WIP_COPT_REPEAT, 4, WIP_COPT_END);
It turned out that I had the WIP_NET_OPT_BUF_MAX set to 8 and when I tried to PING to an IP that did not reply (timeout), I got the same error as you got. Directly after 7 pings were sent out and when the application tried with the 8th the application crashed.
(ERRLOG ch_ping.c:191: Can’t allocate buffer for PING send)
When successful replys come back from PING, its not any buffer limitations.
It looks like the unit does not release previously used buffers.
Maybe it takes some time but how long time I do not know.
Maybe someone else know?
Set a ridiculously long timeout, and handle timeouts by yourself
Set WIP_COPT_REPEAT and the amount of sent data to 1
If it’s not enough, use an UDP packet and a dumb echo server on the poked machine, to check its liveliness without using ping.
On unix and windows, netcat will let you write a dumb UDP server which will send an echo back to any UDP port that sends something to it. On an embedded POSIX device, you’ll need a loop with a recvfrom() and a sendto().
Thanks for the tip but thats not going to do it for my application.
How do you mean that a ridiculous long timeout could help… I still need to send multiple ICMP requests in ~every 10 sec or so.
And by extending the timeout there’s no way to handle it better when the next request must be sent out… the allocated resources are still locked and I can hardly free them by force… or can I?
Unfortunately, I need to be a bit more generic than what you suggested. So I guess I’ll just have to wait… or implement a workaround that reboot the unit after a critical number of “no replies”…
i’m receiving these result when i tried to ping some website.
could somebody explain me about these result? because i think there is something weird with the time. because the time is 0ms which is impossible.
this is inside the PingHandler
[WIPEV] WIP_CEV_PING @ PING 0x180c69b8 (seq=1, time=0ms, timeout=true)
this is inside the PingHandler
[WIPEV] WIP_CEV_PING @ PING 0x180c69b8 (seq=2, time=1000ms, timeout=false)
this is inside the PingHandler
[WIPEV] WIP_CEV_PING @ PING 0x180c69b8 (seq=3, time=1000ms, timeout=false)
this is inside the PingHandler
[WIPEV] WIP_CEV_PEER_CLOSE @ PING 0x180c69b8
i compare it with the ping in MsDOS. the ping result will about 128ms average for each probe sent.
could someone give me clue here… thank you very much…
Hi,
I using newest firmware and WIP plugin and problem continuously existing. I use wip_pingCreateOpts function and when ping response not return, probably channel resources doesn’t free correctly. Next using wip_CreateOpts function result in reeboot system. Sometimes I receive TRACE: ARM memory error. When ping response is correct, application working OK.
I encountered a similar problem when using wip-soft.
i could use the command wipping to ping a website, but after issuing about 15 single pings, it returns error.
i think ping channel must be closed properly before creating the new one or just after getting a response. when you close the channel with wip_close(ev->channel); then the buffers allocated for that channel may be freed. The issue is when to close the channel. If you wait for a response to close the current channel but not getting any response, then you may miss closing the channel. So i think it is better to create ping channels with a timer and check the ping timeout on your own. Whenever timeout occurs or a response received, then you should close the channel to release the internal buffers.
I tried the zafer’s idea (previous post) and I’m havin the following problem. When module tries to send the second ping, the module restarts. (It sends the first one, recieves timeout, initiates wip_close() (with r=0), creates a new ping channel (with the same id as the old one) and restarts).
I’m creating pings every minute.
Hi Roko,
i think the problem is trying to close ping handle. You should close the ping channel not the handle itself. I mean you should apply wip_close(ev->event); like this.
here is the code i use. It may work for you.