I didn’t know if I should post this here or in the FCM section, so here it goes:
First of all, this is how my application should behave:
GPRS connection should always be active (I do it using WIP GPRS bearer).
One socket is connected to UART 1 when it is active.
GSM data calls should always be accepted. When a data call is active, it has to be connected to UART 1 (automatically answered with ats0>=2).
So far it is easy, but here comes the problem:
The data coming from the GSM call has to be monitored for certain purposes.
This means that I need to subscribe to GSM flow with adl_fcmSubscribe. Obviously, I can’t subscribe to GSM flow while WIP is using GPRS flow.
How I do it:
Subscribe to GSM call events with adl_callSubscribe.
Establish GPRS connection with WIP.
Open sockets, etc…
When I get ADL_CALL_EVENT_RING_DATA:
Close sockets.
Disconnect with wip_bearerStop (I get WIP_BERR_OK_INPROGRESS).
After 1 second, and without waiting for WIP_BEV_STOPPED event, subscribe to GSM flow with adl_fcmSubscribe (this is why ats0 is set to >=2, so that I can subscribe the flow before the call is answered).
I have been unable to think of a better way to do it. Anyway, this works, but only the first time.
The second (and subsequent) times, adl_fcmSubscribe returns ADL_FCM_RET_ERROR_GSM_GPRS_ALREADY_OPENNED. And in fact, it is correct, as WIP library never gets past WIP_BERR_OK_INPROGRESS, so I guess it gets stuck somewhere in there and doesn’t release GPRS flow.
Anyone has experienced something similar, or is it just me?
By the way, I initialize the WIP library in my adl_main function with wip_netInit and never terminate it. I’ve tried terminating it too with same results.
Wouldn’t it be better to use ATS0=0 (ie, no auto-answer), and have your Open-AT application handle the call?
That way, your application would be in complete control, and not in a “race” to beat the auto-answer…
See above - I think that’s why you need to wait for WIP_BEV_STOPPED ?
Sorry, I didn’t explain it all. I do it that way because it takes 9 rings for WIP_BEV_STOPPED to arrive when there is an incoming call, and some operators end the call before that.
I know, but for legacy reasons it is done like that. It was done like that when I took the project from someone else, and clients don’t like to see stuff changed in GSM related things. They think that this way it will always work, even if I have a bug in my app.
Actually, I tried some stuff that I didn’t include in my post (it already was quite long).
One of them was manually establishing and terminating the connection with custom commands. This way, I could do a wip_bearerStop and wait for WIP_BEV_STOPPED whenever I wanted.
I could connect and disconnect at my wish. This worked all the time:
Connect.
Open sockets, etc.
Disconnect and wait for WIP_BEV_STOPPED.
Go back to 1.
This didn’t work:
Connect.
Open sockets, etc.
Disconnect and wait for WIP_BEV_STOPPED.
Receive a call (made by me with another modem), answer it, hang up (from the other modem).
Go back to 1 → get stuck in WIP_BERR_OK_INPROGRESS, no WIP_BEV_STOPPED event.
When there is no incoming data call the event comes almost immediately, at least in my case.
You are absolutely right, but I have been unable to find another way.
I’ve asked for a decent solution to this issue for over a year now (to our provider here in Spain, not directly to wavecom), as I had similar problems with edLib too.
I guess we are not important enough, but it seems like such an obvious need to me. Letting the wavecom do it’s stuff and send GSM data to UART 1 on it’s own works great, I should be able to do it too.
Sure, and it does, but I meant that they don’t want to get rid of the ats0 because, for them, that “always works”.
When you open your GSM data flow, do you first check with adl_fcmIsAvailable that the flow is available for subscription?
After your GSM data call is finished, do you make sure you receive the ADL_FCM_EVENT_FLOW_CLOSED if it’s the calling side that hangs up, or manually close the flow if you are the one who hang up?
You might also want to check afterwards that GSM and GPRS flows are available with the above command, before start up GPRS again.
Yes, I do, but it’s quite unnecessary because it always returns TRUE, even when adl_fcmSusbscribe returns ADL_FCM_RET_ERROR_GSM_GPRS_ALREADY_OPENNED.
Yes, I always receive ADL_FCM_EVENT_FLOW_CLOSED.
For the sake of curiosity, I’ve put some adl_fcmIsAvailable calls around. It always returns TRUE. For example, both GSM and GPRS flows are available in WIP_BEV_IP_CONNECTED event!
In my application, the unit is normally idle and can accept an incoming Data Call (CSD), or establish a GPRS session as required.
If a GPRS session is started after a data call has been handled (and correctly closed with ADL_FCM_EVENT_FLOW_CLOSED etc), I find that I never get the WIP_BEV_STOPPED when trying to close the GPRS session.
In other words, this is not just a problem when a data call “interrupts” a GPRS session - it seems be be a fundamental problem with WIP whenever any Data call has previously used the FCM GSM Flow!!
I don’t do GSM Data calls in the products I work on now, but it’s interesting to know if it’s the 3.1x series (Q24…) or 4.1x or 4.2x (Q2686/Q2687) that is affected.
I’m currently working with SDK 3.15/FW6.57c and SDK 4.21/FW6.62 myself.
I believe we have been bitten by this bug too now…
A bug report has been sent and I hope that it reaches Wavecom in time…
So far we have only seen this bug after first setting up GPRS, then disconnecting due to incoming data call, subscription and unsubscription of the GSM data flow, then set up GPRS again.
Our testing has been with Q2686/6.63/4.22a.
If anyone knows of a solution, or if Wavecom has responded to this issue, please post.
I can receive “WIP_BERR_OK_INPROGRESS” info, but I can’t receive “WIP_BEV_IP_CONNECTED” message.
And I often meet this situation when I install machine in the car.
When I drove on the freeway and speed is approximately 80-100 KM, this situation happen “Everytime”,
But when I test in office (in one place, don’t move), this situation don’t happen.
I confused about this situation so I search the forum.
Now I think maybe this situation is a bug.
Because I don’t know how to solve this question, I share my test experience to everyone.
I hope wavecom can solve this question quickly.