# Best external watchdog interval

**URL:** <https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586>\
**Category:** Open AT\
**Created:** [May 3, 2012, 8:06am UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586 "2012-05-03T08:06:52Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [May 3, 2012, 8:06am UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/1 "2012-05-03T08:06:52Z")

</div>

Hello,

We have a modem design which uses Q2687RD inside. We only use Airprime Q2687RD modules and all other companents are our own desing. We want to add an external watchdog companent to our device.

Acoourding to software/firmware download, we try to decide what the interval of this watchdog should be. For instance, if it is 15 seconds, will it be enough for DOTA both type 1 and 2? You know on DOTA, i first download the file from FTP and save on A&D memory. Then module restarts with the new firmware/software. I try to decide the best interval for a watchdog so that i can operate firmware/software and other long-responsed tasks.

For Instance, when i execute AT+WOPEN=6,1028 , then module restarts itself and waits until its operation completes. And this takes about 10 seconds. So this means that i need a watchdog whose interval is more than 10 seconds. Like this, i must measure how much time a dota operation takes after adl\_install.

I wonder if you use external watchdog in your design and what kind of watchdog is it if you have? What is its time interval?

---

<div class="post-metadata">

**Author:** ![tomridl](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/tomridl/32/2704_2.png) [@tomridl](https://forum.sierrawireless.com/u/tomridl)\
**Post date:** [May 3, 2012, 9:09am UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/2 "2012-05-03T09:09:20Z")

</div>

I have found that an application file DOTA (not including a Firmware DOTA) install takes 26 seconds for approx. 700k application file. I have my watchdog set for 32 seconds to be safe. Not sure how long a Firmware install takes.

---

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [May 3, 2012, 9:22am UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/3 "2012-05-03T09:22:49Z")

</div>

> [@tomridl](#):
>
> Not sure how long a Firmware install takes.

Hello tomridl,  
Downloading a firmware file(R7.46, around 1.2MB) takes about 1 minute. This shows i must set my watchdog more than 1 minute. Can anything take longer than a firmware download?  
Thanks.

---

<div class="post-metadata">

**Author:** ![henrietta](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@henrietta](https://forum.sierrawireless.com/u/henrietta)\
**Post date:** [May 7, 2012, 10:39am UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/4 "2012-05-07T10:39:48Z")

</div>

You need to be careful about putting a timeout on downloading. If the module gets into area with especially poor radio coverage, this will seriously drop.

adl\_adInstall() does not seem to be affected by watchdog, at least from my experience, so you can skip considering time to install from calculations. Anyway, when you issue this command, control is taken away from you.

---

<div class="post-metadata">

**Author:** ![tomridl](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/tomridl/32/2704_2.png) [@tomridl](https://forum.sierrawireless.com/u/tomridl)\
**Post date:** [May 7, 2012, 10:50am UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/5 "2012-05-07T10:50:25Z")

</div>

> [@](#):
>
> We want to add an external watchdog companent to our device.

He was referring to an external watchdog, for example, an additional microcontroller that communicates with the modem via UART or SPI or a watchdog chip that is reset via a GPIO pulse. If the communication stops, the external watchdog resets the unit. When an install of new firmware is being done, there is no comms possible, however it is still possible while the modem is downloading the firmware update, so the watchdog will be reset.

> [@](#):
>
> Can anything take longer than a firmware download?

I’ve found that reformating the A&D memory (AT+WOPEN=6,X) takes quite a long time if you are using a large portion of your memory for A&D, but I don’t know the exact time. This can also only be done with the application stopped, so you may never need to do it apart from initial programming.

---

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [May 7, 2012, 1:05pm UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/6 "2012-05-07T13:05:17Z")

</div>

Yes, we are going to use an external watchdog as tomridl said. So adl\_adInstall() will also be effected by watchdog. So i need to take care of this.  
I have done some tests and we decided to use a watchdog 1.5 minutes interval.  
An other question… Which pin of your module do you apply your watchdog pin? Reset pin of your module or ON/OFF pin of your module?  
Thanks.

---

<div class="post-metadata">

**Author:** ![tomridl](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/tomridl/32/2704_2.png) [@tomridl](https://forum.sierrawireless.com/u/tomridl)\
**Post date:** [May 7, 2012, 1:43pm UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/7 "2012-05-07T13:43:43Z")

</div>

In my application, remove power completely by shutting down my power supply. However, you should use the reset line as the ON/OFF line is only used after a CPOF is issued by the modem to power off the modem, and to power on the modem. So pulling this line low does not force a reset. If you just want to force a reset, you should hook up to the reset line as suggested in the PTS (i.e. though a transistor). Alternatively, you can place a low resistance FET in your power supply line and perform a complete power cycle, but I think reset is better.

---

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [May 7, 2012, 2:40pm UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/8 "2012-05-07T14:40:13Z")

</div>

Hi tomridl,  
We have tried both ON/OFF pin and reset pin.  
As you mentioned, in order to use ON/OFF pin i must first execute AT+CPOF command. Otherwise module will not be reset. There is a possibility that our open at software may get stuck and we may not perform CPOF. Then our watchdog would be useless.  
Reset pin is a preferred way to reset module. However, there are still some companents(like internal power managment unit, rf unit) on power while performing reset through reset pin. So actually, this wouldnt be the same as powering off/on the modem. This is still a good choice but we will probably preffer removing power completly like you do in your application.  
I want to know if you have some logic which performs hardreset(removing power) by watchdog in your open at application. And if yes, have you ever experienced any issue like memory curroption or anything? I am asking this because we have plan to perform a hardreset onpurpose by watchdog once a day.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [May 7, 2012, 3:20pm UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/9 "2012-05-07T15:20:29Z")

</div>

There have been reports on this forum of cases where only a power cycle would clear an issue - a reset was not sufficient.

> [@zafer](#):
>
> we have plan to perform a hardreset onpurpose by watchdog once a day.

Always be sure that your application attempts to shut down cleanly before you remove power.

---

<div class="post-metadata">

**Author:** ![tomridl](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/tomridl/32/2704_2.png) [@tomridl](https://forum.sierrawireless.com/u/tomridl)\
**Post date:** [May 7, 2012, 3:37pm UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/10 "2012-05-07T15:37:26Z")

</div>

> [@awneil](#):
>
> Always be sure that your application attempts to shut down cleanly before you remove power.

Very true. You should always issue a AT+CPOF or AT+CFUN=0 before performing a power reset, otherwise you may have to run through a flash clean-up procedure when powering on again. I have been guilty of not always doing this 😊

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [May 7, 2012, 7:11pm UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/11 "2012-05-07T19:11:06Z")

</div>

> [@tomridl](#):
>
> You should always issue a AT+CPOF or AT+CFUN=0 before performing a power reset

Also, if you don’t de-register from the network cleanly, it may “blacklist” your device as (potentially) faulty - especially if this happens frequently…

---

<div class="post-metadata">

**Author:** ![tomridl](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/tomridl/32/2704_2.png) [@tomridl](https://forum.sierrawireless.com/u/tomridl)\
**Post date:** [May 8, 2012, 6:26am UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/12 "2012-05-08T06:26:40Z")

</div>

> [@awneil](#):
>
> Also, if you don’t de-register from the network cleanly, it may “blacklist” your device as (potentially) faulty - especially if this happens frequently…

AT+CFUN=0 or AT+CFUN=4 perform an IMSI detach. Am I correct in assuming that this is a clean de-registration?

---

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [May 8, 2012, 9:33am UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/13 "2012-05-08T09:33:18Z")

</div>

> [@awneil](#):
>
> Also, if you don’t de-register from the network cleanly, it may “blacklist” your device as (potentially) faulty - especially if this happens frequently…

> [@tomridl](#):
>
> AT+CFUN=0 or AT+CFUN=4 perform an IMSI detach. Am I correct in assuming that this is a clean de-registration?

Falling into blacklist…This is something that i am really afraid of.  
Accourding to this, i am told to apply gprs deattach first, then gsm deattach, module power off and then reset.  
wip\_bearerStopwip\_bearerCloseAT+CFUN=4AT+CFUN=0 or AT+CPOF or both Reset

Finally, whenever i am going to perform a hardreset (or soft), i will first deattach from gprs/gsm.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [May 8, 2012, 6:04pm UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/14 "2012-05-08T18:04:55Z")

</div>

I think AT+CPOF or AT+CFUN=0 should be sufficient.

---

<div class="post-metadata">

**Author:** ![tomridl](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/tomridl/32/2704_2.png) [@tomridl](https://forum.sierrawireless.com/u/tomridl)\
**Post date:** [May 9, 2012, 6:57am UTC](https://forum.sierrawireless.com/t/best-external-watchdog-interval/5586/15 "2012-05-09T06:57:09Z")

</div>

> [@awneil](#):
>
> I think AT+CPOF or AT+CFUN=0 should be sufficient.

Sounds good to me 🙂
