# Problem with CFUN and WBHV

**URL:** <https://forum.sierrawireless.com/t/problem-with-cfun-and-wbhv/6665>\
**Category:** Legacy AirPrime modules\
**Created:** [August 7, 2013, 2:29pm UTC](https://forum.sierrawireless.com/t/problem-with-cfun-and-wbhv/6665 "2013-08-07T14:29:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forum.sierrawireless.com/u/tobias)\
**Post date:** [August 7, 2013, 2:29pm UTC](https://forum.sierrawireless.com/t/problem-with-cfun-and-wbhv/6665/1 "2013-08-07T14:29:22Z")

</div>

Configure module for ACTIVE mode with the GSM stack turn-off  
AT+WBHV=1,1  
Restart module  
AT+CFUN=1

Turn on GSM stack without restart  
AT+CFUN=1,0  
AT+CSQ and other commands work fine for a few seconds, then  
+WIND: 8  
+WIND: 0  
And GSM stack is turned off…  
AT+CFUN?  
+CFUN: 0  
OK

After that I have to run AT+CFUN=1,0 AGAIN in order for everything to start up properly…

Full example log:

```auto
AT+WBHV=1,1
OK
AT+CFUN=1
OK
+WIND: 3
+WIND: 13
AT+CFUN=1,0
OK
AT+CFUN?
+CFUN: 1
OK
+WIND: 7
AT+CSQ
+CSQ: 24,0
OK
+WIND: 8
+WIND: 0
AT+CFUN?
+CFUN: 0
OK
AT+CFUN=1,0
OK
+WIND: 1
+WIND: 16
+WIND: 15,4,"13/08/07,14:16:29+08",6,"1"
+WIND: 7
+WIND: 4
+WIND: 10,"SM",0,"FD",0,"ON",0,"SN",0,"EN",0
+WIND: 11,,,,"505641C3BDDEDD3048674D0FCDA34382","19A48D9236D32DFF1E1A6BD2AD77CB17","E554E183848BAC9B7451CE3D126279DA"
```

Tested on Q2687RD and SL6087 with R7.46 and R7.52 firmwares.

Question is, why does the GSM stack not turn on reliably on the first AT+CFUN=1,0?  
How can I be certain that I only need to run AT+CFUN=1,0, wait for +WIND: 8, then run AT+CFUN=1,0 again in order for the GSM stack to turn on properly?

Adding in a AT+WBHV=1,0 before turning on GSM stack with AT+CFUN=1,0 does not help…

I’m not certain I can go into the reasons for why I need to be able to start the module without GSM stack turned on, and then turn it on later.

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forum.sierrawireless.com/u/tobias)\
**Post date:** [August 8, 2013, 10:10am UTC](https://forum.sierrawireless.com/t/problem-with-cfun-and-wbhv/6665/2 "2013-08-08T10:10:27Z")

</div>

AT+CFUN=1,0;+CFUN=0;+CFUN=1,0 seems to work when testing without OpenAT  
With OpenAT however, that causes an exception and restart.  
Also, I’ve found that it’s not reliable anyway as the GSM stack is randomly turned off afterwards again.

The only reliable way to turn on the GSM stack is to actually restart the module, which makes AT+CFUN=1,0 completely useless.
