At+wipping to myself. good idead? bad idea?


#1

Hi

I’m looking for a relyable method to be sure that my module is still connected to the APN. I am thingking of using at+wipping to ping myself.

Currently if I ping some server connected to the same APN as my module, the ping response time is approx 800ms. If I ping myself, the response time is 5ms. It seems a bit suspicious that the self-ping response time is so much lower.

Does ping-ing yourself even use the GSM network, or does the OpenAT recognise the self-ping and just say it was successfull?

Would opening one server socket and one client on the same module and then sending data beteween the sockets be a better (and fool-proof) test?

Suggestions welcome.

Thanks


#2

I did what I described above, creating a server and a client on the same module, with reasonable success:

// setup
at+wipcfg=1
OK

at+wipbr=1,6
OK

at+wipbr=2,6,11,my_private_apn
OK

at+wipbr=4,6,0
OK

// get my own ip address
at+wipbr=3,6,15
+WIPBR: 6,15,"xxx.xxx.xxx.xxx"

// create a server in IDx 1, allow client on IDx 3
at+wipcreate=3,1,5111,3,3
OK

// create a client to my own server
at+wipcreate=2,1,"xxx.xxx.xxx.xxx",5111
OK

+WIPREADY: 2,1

+WIPACCEPT: 1,3  // URC: server IDx 1 accepted an client in IDx 3

// send something to the server
at+wipdata=2,1,1
CONNECT
hello world
+++

+WIPDATA: 2,3,1  // URC: IDx 3 received said TCP protocol stuff

OK

I have the same question as with the self-ping: Is this a thorough test of whether I am connected to the APN, or is OpenAT bypassing the GSM network, because it realises I’m talking to myself?


#3

just noticed something:

Why was I allowed to create a sever and a client both with the same IDx?


#4

I have also managed to do the server <-> client thing using ADL functions (not WIP AT commands) and received all the expected call-backs:

wip_netInit();
wip_bearerOpen(&br, "GPRS", brHandler, NULL);
wip_bearerSetOpts(br, WIP_BOPT_GPRS_APN, "ci.co.za", WIP_BOPT_END);
wip_bearerStart(br);
...
wip_bearerGetOpts(br, WIP_BOPT_IP_ADDR, &wipIpAddress, WIP_BOPT_END);
wip_inet_ntoa(wipIpAddress, szIpAddress , sizeof(szIpAddress));
...
tTcpServer = wip_TCPServerCreate(PORT, SpawnedHandler, NULL);
tTcpClient = wip_TCPClientCreate(szIpAddress, PORT, &TcpClientHandler, NULL);

got the following call-backs (debug printed from within the handler functions):

(12:39:05.4) gsmctl: TcpClientHandler: wip open
(12:39:05.4) gsmctl: TcpClientHandler: wip write
(12:39:05.4) testAt: SpawnedHandler: wip open
(12:39:05.4) testAt: SpawnedHandler: wip write

// my GSM management state machine automatically closes open sockets that are not is use
(12:39:07.0) gsmctl: mx_gsmcontrolSocketClose: closing socket

(12:39:07.0) testAt: SpawnedHandler: wip close

It looks good, but I’m still not 100% sure if this is legit, or if OpenAT is bypassing the GSM network.


#5

Why would you want to know that?

Why not just ping your end server - and remove any doubt about whether the ping actually leaves the module?!