Specifications
AVIDdirector-M2M™ Technical Reference Guide
February 5, 2009 ©AVIDwireless 2004-2009 All Rights Reserved Page 9 of 55
PSoC, RAM, Flash and all other components are available in Industrial temperature (–40
o
C to +85
o
C) versions,
which would allow the device to operate at these temperatures with a suitable modem.
The case is constructed from rugged polystyrene plastic. It is not water or dust tight but should not allow
contaminants to enter with normal use.
WatchDog Timer Technical Notes
Release: 1.6.0
A WatchDog timer (WDT) is used to monitor mission critical aspects of a computer system and determine if the
system is not operating correctly and take steps to put the computer back into a correct operating mode. A WDT
is often used in embedded systems to ensure the system continues to operate correctly regardless of any
system fault or if part of the hardware/software has stop working. A WatchDog typically requires the various
pieces it is monitoring to "check-in" or "pet the watch dog" at regular periods and if a program doesn't check in,
the WatchDog will try to restart the program, or restart the computer system so it can start from a known
condition.
The Java processor and Imsys Technologies has an internal WatchDog in the Java execution engine (or JVM)
and if the system stop executing the Java opcodes it will force a hardware reset of the system. This detects
hardware problems or a bug in the JVM, but it doesn't often detect application problems (loops, block threads, or
dead-lock conditions) since the JVM is executing correctly.
In release 1.6.0 of the AVIDdirector Application Framework (M2MApp) a separate Watch Dog thread is added
that monitors the multiple threads in M2MApp. If one of these threads stops responding then it will log the
thread, which has stopped responding and reset the AVIDdirector-M2M. The Watchdog timer is implemented in
the class com.avidwireless.avidirector.WatchDogTimer, which is part of the ADM2MLib.jar file and whose
source is located in AVIDirector-Software/Adlibrary/source/com/avidwireless/avidirector/WatchDogTimer.java. It
provides methods for a thread to register itself to be monitored, un-register itself and "pet" the watch dog (sorry
for the "Pet" references but they are hard to resist when describing a WatchDog). Specifically the common
methods are:
watchDogTimer.registerWatchDogMonitoredItem(this," ", 60000); // tell the dog to start watching and
check in every 60 seconds (60000 ms)
watchDogTimer.resetWatchDogTimer(this); // pet the watch dog
watchDogTimer.removeMonitoredItem(this); // remove from threads to check
watchDogTimer.startMonitoringItem(this); // start monitoring again use old period
watchDogTimer.startMonitoringItem(this, 60000); // start monitoring this again checking
every 60 seconds
watchDogTimer.stopMonitoringItem(this); // stop checking
Unless a thread registered itself with the WatchDog is not monitored. Along with system threads, user written
Device drivers and M2Mlets can be registered with the WatchDog to be monitored.
The WatchDogTimer is implemented as a separate Java thread that is started with a defined periodic interval for
checking for dead threads. This is normally 60 seconds. The time period for the threads it monitors can be as
long as required, but the WatchDog will check on them every 60 seconds. This period can be made shorter but
then you have the risk of the WatchDog's processing time impacting the overall available processor time.
The WatchDogTimer is enabled by an entry in the M2MApp.ini file called "SYSTEM.WATCHDOG". The default
is "true" to have the WatchDog time run but it can be disabled by setting this entry to "false". When initialized,
the WatchDogTimer class first calls "SNAP.setWatchdogTimeout(period + MARGIN)". This enables the SNAP
JVM to check that the method call "SNAP.feedWatchdog()" is called by the WatchDogTimer at least once each
period time plus the MARGIN time. The MARGIN time is currently set to 30 seconds to prevent false WatchDog